diff options
author | Colin Watson <[email protected]> | 2017-09-16 03:16:45 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2017-10-04 15:26:39 +0000 |
commit | b5b996b1a142abb90296f5feadf0b5b19c59f738 (patch) | |
tree | bae96d5b1fea3c7f799bd36dd4d7a4c850a0abdd /src/engine.h | |
parent | Register DCO for Colin Watson. (diff) | |
download | gpgme-b5b996b1a142abb90296f5feadf0b5b19c59f738.tar.gz gpgme-b5b996b1a142abb90296f5feadf0b5b19c59f738.zip |
core: Restore get_max_fds optimization on Linux
* src/posix-io.c (get_max_fds): Restore Linux optimization, this time
using open/getdents/close rather than opendir/readdir/closedir.
--
opendir/readdir/closedir may allocate/free memory, and aren't required
to do so in an async-signal-safe way. On the other hand, opening
/proc/self/fd directly and iterating over it using getdents is safe.
(getdents is not strictly speaking documented to be async-signal-safe
because it's not in POSIX. However, the Linux implementation is
essentially just a souped-up read. Python >= 3.2.3 makes the same
assumption.)
Signed-off-by: Colin Watson <[email protected]>
Diffstat (limited to 'src/engine.h')
0 files changed, 0 insertions, 0 deletions