Date: Sun, 04 Apr 1999 19:04:05 +1000 From: Stephen McKay <syssgm@detir.qld.gov.au> To: Brian Feldman <green@unixhelp.org> Cc: freebsd-hackers@freebsd.org, syssgm@detir.qld.gov.au Subject: Re: dd(1) seek/skip limited why? Message-ID: <199904040904.TAA24558@nymph.detir.qld.gov.au> In-Reply-To: <Pine.BSF.4.05.9904031006360.6761-100000@janus.syracuse.net> from Brian Feldman at "Sat, 03 Apr 1999 10:13:50 -0500" References: <Pine.BSF.4.05.9904031006360.6761-100000@janus.syracuse.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Saturday, 3rd April 1999, Brian Feldman wrote: > Also, I find that dd(1) refuses to lseek for the skip operation (pos_in) on >a cdev, even though it certainly does seem to work on all that I've tried >except sndstat... Now I could have dd(1) work around this if lseek actually >worked correctly on these cdevs. However, lseek succeeds on devices that >cannot be seeked (joy0, sndstat, etc). Am I the only one who thinks this is >wrong? Historically, the only thing lseek() failed on was a pipe (extended to include sockets when they turned up). For other things that you wouldn't expect to be seekable (like ttys), lseek() "worked" in as much as it set the file position pointer. But then the pointer was ignored. When I was a young pup, I asked why it was so. The answer would have been very close to "Some devices are incapable of seeking. The value of the file pointer associated with such a device is undefined." That's not likely to change. I assume you want dd to work better on raw disks. Find an ioctl() that only works on raw disks (and optionally other seekable things) and you have a winner. Stephen. 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?199904040904.TAA24558>