aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/sys
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/sys')
-rw-r--r--lib/libc/sys/mkdir.22
-rw-r--r--lib/libc/sys/revoke.24
-rw-r--r--lib/libc/sys/write.220
3 files changed, 23 insertions, 3 deletions
diff --git a/lib/libc/sys/mkdir.2 b/lib/libc/sys/mkdir.2
index 3cbe9ad794ea..854c692f24e3 100644
--- a/lib/libc/sys/mkdir.2
+++ b/lib/libc/sys/mkdir.2
@@ -178,4 +178,4 @@ system call appeared in
The
.Fn mkdir
system call appeared in
-.At v1 .
+.Bx 4.2 .
diff --git a/lib/libc/sys/revoke.2 b/lib/libc/sys/revoke.2
index dc92512d3129..db0c8a85558b 100644
--- a/lib/libc/sys/revoke.2
+++ b/lib/libc/sys/revoke.2
@@ -30,7 +30,7 @@
.\"
.\" @(#)revoke.2 8.1 (Berkeley) 6/4/93
.\"
-.Dd January 25, 2016
+.Dd October 24, 2025
.Dt REVOKE 2
.Os
.Sh NAME
@@ -64,7 +64,7 @@ using a special close method which does not block.
Access to a file may be revoked only by its owner or the super user.
The
.Fn revoke
-system call is currently supported only for block and character special
+system call is currently supported only for character special
device files.
It is normally used to prepare a terminal device for a new login session,
preventing any access by a previous user of the terminal.
diff --git a/lib/libc/sys/write.2 b/lib/libc/sys/write.2
index adf60aa91d7a..2f0a9d034038 100644
--- a/lib/libc/sys/write.2
+++ b/lib/libc/sys/write.2
@@ -134,6 +134,26 @@ and
may write fewer bytes than requested;
the return value must be noted,
and the remainder of the operation should be retried when possible.
+.Sh ATOMICITY OF WRITES
+When operating on regular files on local file systems, the effects of
+.Fn write
+are atomic.
+As required by the POSIX standard,
+the
+.Fn read ,
+.Fn write ,
+and
+.Fn ftruncate
+functions and their variations are atomic with respect to
+each other on the file data and metadata for regular files.
+See for instance
+.St -p1003.1-2024
+Volume 2, Section 2.9.7 for more information.
+.Pp
+.Fx
+implements the requirement by taking
+a read/write range lock on the file byte range
+affected by the corresponding function.
.Sh RETURN VALUES
Upon successful completion the number of bytes which were written
is returned.