From owner-freebsd-hackers Mon Apr 12 12:21:31 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from lestat.nas.nasa.gov (lestat.nas.nasa.gov [129.99.50.29]) by hub.freebsd.org (Postfix) with ESMTP id E47231557D for ; Mon, 12 Apr 1999 12:20:48 -0700 (PDT) (envelope-from thorpej@lestat.nas.nasa.gov) Received: from lestat (localhost [127.0.0.1]) by lestat.nas.nasa.gov (8.8.8/8.6.12) with ESMTP id MAA07413; Mon, 12 Apr 1999 12:16:12 -0700 (PDT) Message-Id: <199904121916.MAA07413@lestat.nas.nasa.gov> To: Ville-Pertti Keinonen Cc: dillon@apollo.backplane.com (Matthew Dillon), hackers@FreeBSD.ORG Subject: Re: read() and pread() syscalls Reply-To: Jason Thorpe From: Jason Thorpe Date: Mon, 12 Apr 1999 12:16:12 -0700 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 12 Apr 1999 17:01:50 +0300 Ville-Pertti Keinonen 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 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message