Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 May 2000 20:53:31 -0700 (PDT)
From:      Matthew Jacob <mjacob@feral.com>
To:        "David O'Brien" <obrien@FreeBSD.ORG>
Cc:        alpha@FreeBSD.ORG, bde@FreeBSD.ORG
Subject:   Re: (FWD) `dd' patch pertaining to Alpha
Message-ID:  <Pine.BSF.4.05.10005022052580.11416-100000@semuta.feral.com>
In-Reply-To: <20000502204027.A94062@dragon.nuxi.com>

next in thread | previous in thread | raw e-mail | index | archive | help

Well, the right thing to do is to fix the label code. Bruce whacked me the
last time on this, so I'll recuse myself from beinginvolved.


On Tue, 2 May 2000, David O'Brien wrote:

> I sent Matt's patch to Brian (maintainer for `dd') and he reworked it
> into this.  Can people comment if this fixes their `dd' problems, etc..
> 
> ----- Forwarded message from Brian Fundakowski Feldman <green@FreeBSD.org> -----
> --- dd.c	1999/10/03 18:49:51	1.27
> +++ dd.c	2000/05/02 05:13:21
> @@ -54,2 +54,3 @@
>  #include <sys/conf.h>
> +#include <sys/disklabel.h>
>  #include <sys/filio.h>
> @@ -220,4 +221,10 @@
>  				io->flags |= ISTAPE;
> -			else if (type & (D_DISK | D_MEM))
> +			else if (type & (D_DISK | D_MEM)) {
> +				if (type & D_DISK) {
> +					const int one = 1;
> +
> +					(void)ioctl(io->fd, DIOCWLABEL, &one);
> +				}
>  				io->flags |= ISSEEK;
> +			}
>  			if (S_ISCHR(sb.st_mode) && (type & D_TAPE) == 0)
> 
> If the disk supports DIOCWLABEL or not, we have no way of knowing, so it
> makes no sense to check the error return.  The error return may be EBADF
> for trying to set DIOCWLABEL on a non-FWRITE file descriptor, or it may
> be ENODEV for a device which doesn't support it, or it could be a valid
> error.  In any case, DIOCWLABEL will make it not fail for da(4) devices,
> and the error return DIOCWLABEL won't matter in the end.
> 
> How does that work for you?  I don't have da(4) disks...
> 
> Now to try to figure out what the difference between EPERM and EACCES is...
> These things are so annoying.
> 
> --
>  Brian Fundakowski Feldman           \  FreeBSD: The Power to Serve!  /
>  green@FreeBSD.org                    `------------------------------'
> 
> ----- End forwarded message -----
> 
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-alpha" in the body of the message
> 



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-alpha" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.05.10005022052580.11416-100000>