Document the constraints on path_open's returned file descriptor.

Whether the downsides in POSIX and existing application compatibility
outweigh the benefits of thread safety remains an open question.
Right now, this note is just documenting the current behavior.
This commit is contained in:
Dan Gohman
2019-03-28 10:42:48 -07:00
parent c37f245fc8
commit 4fd7c4b931

View File

@@ -744,6 +744,12 @@ Inputs:
Open a file or directory.
The returned file descriptor is not guaranteed to be the lowest-numbered
file descriptor not currently open; it is randomized to prevent
applications from depending on making assumptions about indexes, since
this is error-prone in multi-threaded contexts. The returned file
descriptor is guaranteed to be less than 2<sup>31</sup>.
Note: This is similar to `openat` in POSIX.
Inputs: