From owner-freebsd-hackers Tue Jul 13 9:46:50 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from wall.polstra.com (rtrwan160.accessone.com [206.213.115.74]) by hub.freebsd.org (Postfix) with ESMTP id 510EF14C1E; Tue, 13 Jul 1999 09:46:46 -0700 (PDT) (envelope-from jdp@polstra.com) Received: from vashon.polstra.com (vashon.polstra.com [206.213.73.13]) by wall.polstra.com (8.9.3/8.9.1) with ESMTP id JAA20403; Tue, 13 Jul 1999 09:46:27 -0700 (PDT) (envelope-from jdp@polstra.com) From: John Polstra Received: (from jdp@localhost) by vashon.polstra.com (8.9.3/8.9.1) id JAA36852; Tue, 13 Jul 1999 09:46:26 -0700 (PDT) (envelope-from jdp@polstra.com) Date: Tue, 13 Jul 1999 09:46:26 -0700 (PDT) Message-Id: <199907131646.JAA36852@vashon.polstra.com> To: green@freebsd.org Subject: Re: Why 'dd' does not seek over 'char' devs (specifically raw disk In-Reply-To: Organization: Polstra & Co., Seattle, WA Cc: hackers@freebsd.org Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In article , Brian F. Feldman 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