Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Jul 1999 09:46:26 -0700 (PDT)
From:      John Polstra <jdp@polstra.com>
To:        green@freebsd.org
Cc:        hackers@freebsd.org
Subject:   Re: Why 'dd' does not seek over 'char' devs (specifically raw disk
Message-ID:  <199907131646.JAA36852@vashon.polstra.com>
In-Reply-To: <Pine.BSF.4.10.9907131042310.76301-100000@janus.syracuse.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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.

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


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?199907131646.JAA36852>