summaryrefslogtreecommitdiff
path: root/doc/lispref/files.texi
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2017-08-25 12:44:52 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2017-08-25 13:19:45 -0700
commit2b7e009257a40ef1dcad9845fe61764fea08cdea (patch)
tree416594c77bd7b015763726f48ee160e25a47fa61 /doc/lispref/files.texi
parent9a223dab9036ff72b16e7a9878af090c041fd0c6 (diff)
downloademacs-2b7e009257a40ef1dcad9845fe61764fea08cdea.tar.gz
Fix file-attributes race on GNU hosts
* doc/lispref/files.texi (File Attributes): Document file-attributes atomicity. * etc/NEWS: Document the fix. * src/dired.c (file_attributes): New args DIRNAME and FILENAME, for diagnostics. All callers changed. On platforms like GNU/Linux that support O_PATH, fix a race condition in file-attributes and similar functions, so that these functions do not return nonsense if a directory entry is replaced while getting its attributes. On non-GNU platforms, do a better (though not perfect) job of detecting the race, and return nil if detected.
Diffstat (limited to 'doc/lispref/files.texi')
-rw-r--r--doc/lispref/files.texi7
1 files changed, 7 insertions, 0 deletions
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi
index 5a52765131c..36944e4713d 100644
--- a/doc/lispref/files.texi
+++ b/doc/lispref/files.texi
@@ -1249,6 +1249,13 @@ the default, but we plan to change that, so you should specify a
non-@code{nil} value for @var{id-format} if you use the returned
@acronym{UID} or @acronym{GID}.
+On GNU platforms when operating on a local file, this function is
+atomic: if the filesystem is simultaneously being changed by some
+other process, this function returns the file's attributes either
+before or after the change. Otherwise this function is not atomic,
+and might return @code{nil} it detects the race condition, or might
+return a hodgepodge of the previous and current file attributes.
+
Accessor functions are provided to access the elements in this list.
The accessors are mentioned along with the descriptions of the
elements below.