Date: Tue, 13 Jul 1999 15:02:38 -0400 (EDT) From: "Brian F. Feldman" <green@FreeBSD.org> To: John Polstra <jdp@polstra.com> Cc: hackers@FreeBSD.org Subject: Re: Why 'dd' does not seek over 'char' devs (specifically raw disk Message-ID: <Pine.BSF.4.10.9907131501270.86113-100000@janus.syracuse.net> In-Reply-To: <199907131646.JAA36852@vashon.polstra.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 13 Jul 1999, John Polstra wrote:
> In article <Pine.BSF.4.10.9907131042310.76301-100000@janus.syracuse.net>,
> Brian F. Feldman <green@FreeBSD.ORG> wrote:
> > On Tue, 13 Jul 1999, Luigi Rizzo wrote:
> >
> > > couldn't we first try lseek and only do the reads on char devs where
> > > the lseek fails ?
> >
> > lseek() won't usually fail unless it's something like EBADF. It merely
> > sets the current fd's offset. It would be nice to be able to tell from
> > a device driver if it supports seeking (da) or not (sa). Hmm... actually,
> > if we just specify somehow that we support either direct or sequential
> > access... this would be possible.
>
> It would be a big improvement if dd could handle seeking on character
> disk devices. I'm reasonably certain there exists some ioctl (perhaps
> related to reading disk labels) which could be used to figure out
> whether a character device was a disk or not. A simple fix like that
> would make dd a lot more useful for the case Luigi brought up.
Okay, I implemented it, and it's in -CURRENT. I forgot about dsioctl()...
I was thinking in majors and minors, and that they'd have to be hardcoded
in... ;) This is better.
>
> John
> --
> John Polstra jdp@polstra.com
> John D. Polstra & Co., Inc. Seattle, Washington USA
> "No matter how cynical I get, I just can't keep up." -- Nora Ephron
>
Brian Fundakowski Feldman _ __ ___ ____ ___ ___ ___
green@FreeBSD.org _ __ ___ | _ ) __| \
FreeBSD: The Power to Serve! _ __ | _ \._ \ |) |
http://www.FreeBSD.org/ _ |___/___/___/
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" 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.10.9907131501270.86113-100000>
