Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Apr 1999 12:16:12 -0700
From:      Jason Thorpe <thorpej@nas.nasa.gov>
To:        Ville-Pertti Keinonen <will@iki.fi>
Cc:        dillon@apollo.backplane.com (Matthew Dillon), hackers@FreeBSD.ORG
Subject:   Re: read() and pread() syscalls 
Message-ID:  <199904121916.MAA07413@lestat.nas.nasa.gov>

next in thread | raw e-mail | index | archive | help
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.

        -- 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?199904121916.MAA07413>