In article <pine.bsf.4.10.9907131042310.76301-100...@janus.syracuse.net>,
Brian F. Feldman <gr...@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.

John
-- 
  John Polstra                                               j...@polstra.com
  John D. Polstra & Co., Inc.                        Seattle, Washington USA
  "No matter how cynical I get, I just can't keep up."        -- Nora Ephron


To Unsubscribe: send mail to majord...@freebsd.org
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to