From owner-freebsd-hackers Sun Apr 11 18:23:51 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 B195C14FF4 for ; Sun, 11 Apr 1999 18:23:14 -0700 (PDT) (envelope-from green@unixhelp.org) Received: from localhost (green@localhost) by janus.syracuse.net (8.9.2/8.8.7) with ESMTP id VAA35677; Sun, 11 Apr 1999 21:20:55 -0400 (EDT) Date: Sun, 11 Apr 1999 21:20:53 -0400 (EDT) From: Brian Feldman X-Sender: green@janus.syracuse.net To: Jason Thorpe Cc: jwm@CSUA.Berkeley.EDU, freebsd-hackers@FreeBSD.ORG Subject: Re: read() and pread() syscalls In-Reply-To: <199904120102.SAA24587@lestat.nas.nasa.gov> 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 Sun, 11 Apr 1999, Jason Thorpe wrote: > On Sun, 11 Apr 1999 14:16:45 -0700 > John Milford wrote: > > > Should read() be turned into a library function now that we > > have pread(), and read() is a proper subset of pread()? I am not sure > > Not that I care too much, since read/pread, etc work fine in NetBSD (which > is what I use), but... > > read() is _NOT_ a subset if pread() in the common sense. read() works > from the current file offset, while pread() always takes an explicit offset. > > There is no way to emulate read() with pread() in userspace. > > > if this is a POSIX compliance issue, but I've been digging around in > > this code recently, and it seems that there is a lot of overlap in the > > read system calls, and we might want to consider doing something > > similar to the approach taken with wait(). I could understand that > > this case is different so we may not want to be doing conversion of > > read() or readv() into a hypothetical preadv(), but I can see no issue > > with converting read()'s into pread()'s. > > ...and why not implement preadv()? I did when I implemented pread()/pwrite() > in NetBSD. > > But, see above about it not being possible to emulate read() with pread() > in userspace. You mean, without lseek(2) =) > > -- Jason R. Thorpe > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > Brian Feldman _ __ ___ ____ ___ ___ ___ green@unixhelp.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