forked from cloudfoundry/gosigar
-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: limited ProcFDUsage support on darwin
This adds support for ProcFDUsage on darwin when the requested PID matches that of the current process. On MacOS, while you can get the open file descriptors for other processes (via `proc_pidinfo`), I don't know of a clean way to get the current rlimit data for another process. However, for the current process, we can retrieve the rlimits via the `getrlimit` system call. I've used /dev/fd to count open files rather than `proc_pidinfo` because I think the code is a bit more straight forward than the under-documented `proc_pidinfo` call.
- Loading branch information
1 parent
9d6c926
commit 1fcb209
Showing
2 changed files
with
104 additions
and
2 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