From owner-freebsd-alpha Tue May 2 20:53:54 2000 Delivered-To: freebsd-alpha@freebsd.org Received: from feral.com (feral.com [192.67.166.1]) by hub.freebsd.org (Postfix) with ESMTP id 5F6B637B934; Tue, 2 May 2000 20:53:50 -0700 (PDT) (envelope-from mjacob@feral.com) Received: from semuta.feral.com (semuta [192.67.166.70]) by feral.com (8.9.3/8.9.3) with ESMTP id UAA03667; Tue, 2 May 2000 20:53:19 -0700 Date: Tue, 2 May 2000 20:53:31 -0700 (PDT) From: Matthew Jacob Reply-To: mjacob@feral.com To: "David O'Brien" Cc: alpha@FreeBSD.ORG, bde@FreeBSD.ORG Subject: Re: (FWD) `dd' patch pertaining to Alpha In-Reply-To: <20000502204027.A94062@dragon.nuxi.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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 ----- > --- dd.c 1999/10/03 18:49:51 1.27 > +++ dd.c 2000/05/02 05:13:21 > @@ -54,2 +54,3 @@ > #include > +#include > #include > @@ -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