about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCarlos O'Donell <carlos@redhat.com>2014-11-06 15:58:52 -0500
committerCarlos O'Donell <carlos@redhat.com>2014-11-06 15:58:52 -0500
commita2887bdb2729e77786a56139d02a6d8cb1290bce (patch)
treebbf0d26769eb86dc740b7dafd36657bff0177355
parentda53d6dbc28d2a90d6e14dd661e68611c3b741cf (diff)
downloadglibc-a2887bdb2729e77786a56139d02a6d8cb1290bce.tar.gz
glibc-a2887bdb2729e77786a56139d02a6d8cb1290bce.tar.xz
glibc-a2887bdb2729e77786a56139d02a6d8cb1290bce.zip
manual/llio.texi: Comment on write atomicity.
We add Linux-realted comments about the atomicity of
write with respect to file offsets. As of Linux 3.14
the file offset update is atomic. That means that
multiple threads calling the write syscall can not possibly
get the same file offset. Therefore the writes should
not overlap and data should not be lost as is required
by POSIX.
-rw-r--r--ChangeLog3
-rw-r--r--manual/llio.texi5
2 files changed, 8 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 3d7cf67c2f..6f3a85f123 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2014-11-06  Carlos O'Donell  <carlos@redhat.com>
 
+	* manual/llio.texi: Add comment that write safety has been
+	fixed in Linux.
+
 	* elf/Makefile (all-built-dso): Add $(common-objpfx)elf/ld.so.
 	(localplt-build-dso): Add elf/ld.so.
 	* sysdeps/unix/sysv/linux/i386/localplt.data: Add ___tls_get_addr
diff --git a/manual/llio.texi b/manual/llio.texi
index 393ddf30ab..4f3fada1e7 100644
--- a/manual/llio.texi
+++ b/manual/llio.texi
@@ -491,6 +491,11 @@ When the source file is compiled with @code{_FILE_OFFSET_BITS == 64} on a
 @c
 @c So we mark it thread safe, it doesn't blow up, but you might loose
 @c data, and we don't strictly meet the POSIX requirements.
+@c
+@c The fix for file offsets racing was merged in 3.14, the commits were:
+@c 9c225f2655e36a470c4f58dbbc99244c5fc7f2d4, and
+@c d7a15f8d0777955986a2ab00ab181795cab14b01.  Therefore after Linux 3.14 you
+@c should get mostly MT-safe writes.
 The @code{write} function writes up to @var{size} bytes from
 @var{buffer} to the file with descriptor @var{filedes}.  The data in
 @var{buffer} is not necessarily a character string and a null character is