Page MenuHomeFreeBSD

D20867.id59479.diff
No OneTemporary

D20867.id59479.diff

Index: lib/libc/sys/read.2
===================================================================
--- lib/libc/sys/read.2
+++ lib/libc/sys/read.2
@@ -28,7 +28,7 @@
.\" @(#)read.2 8.4 (Berkeley) 2/26/94
.\" $FreeBSD$
.\"
-.Dd December 1, 2017
+.Dd July 6, 2019
.Dt READ 2
.Os
.Sh NAME
@@ -128,6 +128,25 @@
The system guarantees to read the number of bytes requested if
the descriptor references a normal file that has that many bytes left
before the end-of-file, but in no other case.
+.Pp
+In accordance with
+.St -p1003.1-2004 ,
+both
+.Xr read 2
+and
+.Xr write 2
+syscalls are atomic with respect to each other in the effects on file
+content, when they operate on regular files.
+If two threads each call one of the
+.Xr read 2
+or
+.Xr write 2 ,
+syscalls, each call see either all of the changes of the other call,
+or none of them.
+The
+.Fx
+kernel implements this guarantee by locking the file ranges affected by
+the calls.
.Sh RETURN VALUES
If successful, the
number of bytes actually read is returned.

File Metadata

Mime Type
text/plain
Expires
Fri, Mar 6, 10:30 AM (6 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29310439
Default Alt Text
D20867.id59479.diff (1 KB)

Event Timeline