From owner-freebsd-hackers Sun Apr 4 1: 6:40 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from ren.detir.qld.gov.au (ns.detir.qld.gov.au [203.46.81.66]) by hub.freebsd.org (Postfix) with ESMTP id 5C08D151B5 for ; Sun, 4 Apr 1999 01:06:36 -0800 (PST) (envelope-from syssgm@detir.qld.gov.au) Received: by ren.detir.qld.gov.au; id TAA18601; Sun, 4 Apr 1999 19:07:26 +1000 (EST) Received: from ogre.detir.qld.gov.au(167.123.8.3) by ren.detir.qld.gov.au via smap (4.1) id xma018599; Sun, 4 Apr 99 19:07:23 +1000 Received: from atlas.detir.qld.gov.au (atlas.detir.qld.gov.au [167.123.8.9]) by ogre.detir.qld.gov.au (8.8.8/8.8.7) with ESMTP id TAA19505; Sun, 4 Apr 1999 19:04:08 +1000 (EST) Received: from nymph.detir.qld.gov.au (nymph.detir.qld.gov.au [167.123.10.10]) by atlas.detir.qld.gov.au (8.8.5/8.8.5) with ESMTP id TAA23498; Sun, 4 Apr 1999 19:04:07 +1000 (EST) Received: from nymph.detir.qld.gov.au (localhost.detir.qld.gov.au [127.0.0.1]) by nymph.detir.qld.gov.au (8.8.8/8.8.7) with ESMTP id TAA24558; Sun, 4 Apr 1999 19:04:05 +1000 (EST) (envelope-from syssgm@nymph.detir.qld.gov.au) Message-Id: <199904040904.TAA24558@nymph.detir.qld.gov.au> To: Brian Feldman Cc: freebsd-hackers@freebsd.org, syssgm@detir.qld.gov.au Subject: Re: dd(1) seek/skip limited why? References: In-Reply-To: from Brian Feldman at "Sat, 03 Apr 1999 10:13:50 -0500" Date: Sun, 04 Apr 1999 19:04:05 +1000 From: Stephen McKay Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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