diff options
| author | Paul Eggert | 2017-08-25 12:44:52 -0700 |
|---|---|---|
| committer | Paul Eggert | 2017-08-25 13:19:45 -0700 |
| commit | 2b7e009257a40ef1dcad9845fe61764fea08cdea (patch) | |
| tree | 416594c77bd7b015763726f48ee160e25a47fa61 /doc/lispref | |
| parent | 9a223dab9036ff72b16e7a9878af090c041fd0c6 (diff) | |
| download | emacs-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.texi | 7 |
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 | |||
| 1249 | non-@code{nil} value for @var{id-format} if you use the returned | 1249 | non-@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 | ||
| 1252 | On GNU platforms when operating on a local file, this function is | ||
| 1253 | atomic: if the filesystem is simultaneously being changed by some | ||
| 1254 | other process, this function returns the file's attributes either | ||
| 1255 | before or after the change. Otherwise this function is not atomic, | ||
| 1256 | and might return @code{nil} it detects the race condition, or might | ||
| 1257 | return a hodgepodge of the previous and current file attributes. | ||
| 1258 | |||
| 1252 | Accessor functions are provided to access the elements in this list. | 1259 | Accessor functions are provided to access the elements in this list. |
| 1253 | The accessors are mentioned along with the descriptions of the | 1260 | The accessors are mentioned along with the descriptions of the |
| 1254 | elements below. | 1261 | elements below. |