aboutsummaryrefslogtreecommitdiffstats
path: root/doc/lispref
diff options
context:
space:
mode:
authorPaul Eggert2017-08-25 12:44:52 -0700
committerPaul Eggert2017-08-25 13:19:45 -0700
commit2b7e009257a40ef1dcad9845fe61764fea08cdea (patch)
tree416594c77bd7b015763726f48ee160e25a47fa61 /doc/lispref
parent9a223dab9036ff72b16e7a9878af090c041fd0c6 (diff)
downloademacs-2b7e009257a40ef1dcad9845fe61764fea08cdea.tar.gz
emacs-2b7e009257a40ef1dcad9845fe61764fea08cdea.zip
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')
-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
1249non-@code{nil} value for @var{id-format} if you use the returned 1249non-@code{nil} value for @var{id-format} if you use the returned
1250@acronym{UID} or @acronym{GID}. 1250@acronym{UID} or @acronym{GID}.
1251 1251
1252On GNU platforms when operating on a local file, this function is
1253atomic: if the filesystem is simultaneously being changed by some
1254other process, this function returns the file's attributes either
1255before or after the change. Otherwise this function is not atomic,
1256and might return @code{nil} it detects the race condition, or might
1257return a hodgepodge of the previous and current file attributes.
1258
1252Accessor functions are provided to access the elements in this list. 1259Accessor functions are provided to access the elements in this list.
1253The accessors are mentioned along with the descriptions of the 1260The accessors are mentioned along with the descriptions of the
1254elements below. 1261elements below.