Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use /proc/self/fd to efficiently close all FDs on Linux
Issue #1506.
- Loading branch information
Showing
3 changed files
with
19 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 comments
on commit af765a8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does ls /dev/fd
work for this on Linux too? That works on Darwin, so it might be possible to make it a bit more portable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, but it does on FreeBSD. The closefrom implementation in libbsd uses both in the same way.
Maybe include a
readlink("/proc/self/fd/%d")
in debug to find the root cause of the leak?