From owner-freebsd-hackers Tue Jul 13 7:45:21 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from janus.syracuse.net (janus.syracuse.net [205.232.47.15]) by hub.freebsd.org (Postfix) with ESMTP id 1465215132 for ; Tue, 13 Jul 1999 07:45:18 -0700 (PDT) (envelope-from green@FreeBSD.org) Received: from localhost (green@localhost) by janus.syracuse.net (8.9.2/8.8.7) with ESMTP id KAA77800; Tue, 13 Jul 1999 10:45:06 -0400 (EDT) X-Authentication-Warning: janus.syracuse.net: green owned process doing -bs Date: Tue, 13 Jul 1999 10:45:05 -0400 (EDT) From: "Brian F. Feldman" X-Sender: green@janus.syracuse.net To: Luigi Rizzo Cc: luigi@iet.unipi.it, hackers@FreeBSD.org Subject: Re: Why 'dd' does not seek over 'char' devs (specifically raw disk In-Reply-To: <199907131212.OAA08560@labinfo.iet.unipi.it> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, 13 Jul 1999, Luigi Rizzo wrote: > > > Hi, i have a question. > > > > > > Why 'dd' does not seek over 'char' devs (specifically raw disk partitions). > > > > Not all character devices support seeking. So, we work with the LCD... > > Sorry, I don't like this either. It would be better, maybe, just to fix > > character devices. > > 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. > > > You certainly make a good case. modify your local copy of dd to do > > what you want. > > generally this is not the kind of things you can do when your system > has already gone bad (this was a laptop's disk...) > The problem is that dd skip= is used a lot on tape devices. Here, a seek would not work. > > > > > > I notice that on output lseek _is_ used also on char devices. > > > > And how else would you do it? > > ok, stupid observation! > > cheers > luigi > > -----------------------------------+------------------------------------- > Luigi RIZZO, luigi@iet.unipi.it . Dip. di Ing. dell'Informazione > http://www.iet.unipi.it/~luigi/ . Universita` di Pisa > TEL/FAX: +39-050-568.533/522 . via Diotisalvi 2, 56126 PISA (Italy) > > http://www.iet.unipi.it/~luigi/ngc99/ > ==== First International Workshop on Networked Group Communication ==== > -----------------------------------+------------------------------------- > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > Brian Fundakowski Feldman _ __ ___ ____ ___ ___ ___ green@FreeBSD.org _ __ ___ | _ ) __| \ FreeBSD: The Power to Serve! _ __ | _ \._ \ |) | http://www.FreeBSD.org/ _ |___/___/___/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message