Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Apr 1999 09:54:12 +0300 (EEST)
From:      Narvi <narvi@haldjas.folklore.ee>
To:        Jason Thorpe <thorpej@nas.nasa.gov>
Cc:        Ville-Pertti Keinonen <will@iki.fi>, Matthew Dillon <dillon@apollo.backplane.com>, hackers@FreeBSD.ORG
Subject:   Re: read() and pread() syscalls 
Message-ID:  <Pine.BSF.3.96.990413094321.13437L-100000@haldjas.folklore.ee>
In-Reply-To: <199904121916.MAA07413@lestat.nas.nasa.gov>

next in thread | previous in thread | raw e-mail | index | archive | help

On Mon, 12 Apr 1999, Jason Thorpe wrote:

> On 12 Apr 1999 17:01:50 +0300 
>  Ville-Pertti Keinonen <will@iki.fi> wrote:
> 
>  > This may come as a shock to you, but read(2)/write(2) aren't atomic in
>  > updating the file pointer, either.
> 
> Then that's a bug in the FreeBSD kernel.
> 
>  > Actually, read(2) is equivalent to lseek(2)+pread(2)+lseek(2), with the
>  > last lseek(2) being SEEK_CUR by the read count returned by pread(2).
>  > The difference is that read(2) can only be pre-empted if it blocks
>  > doing I/O (which is not unusual).
> 
> Geez, how did this get implemented in FreeBSD?!  It's certainly not that
> complicated.
> 

I can say nothing but that you shouldn't believe everything you are told. 

*IF* NetBSD read in sys_generic does the same that OpenBSD read does, then
all the three do the same things:

	a) they do permission checking
	b) they set up the iovec
	c) they call (*fp->f_ops->fo_read)
	d) they check for error

And that's it. 

Anybody claiming otherwise is *STRONGLY* advised to point me to the code
where I can see that it isn't so.

	Sander

	There is no love, no good, no happiness and no future -
	all these are just illusions.

>         -- Jason R. Thorpe <thorpej@nas.nasa.gov>
> 





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?Pine.BSF.3.96.990413094321.13437L-100000>