Module perf_monitor::fd [−][src]
Get file descriptor(say handle for windows) numbers for current process.
use perf_monitor::fd::fd_count_cur; let count = fd_count_cur().unwrap();
Bottom Layer Interface
- Windows: GetProcessHandleCount
- Linux & android: /proc/{pid}/fd
- MacOS: /dev/fd
- iOS Unfortunately there is no api to retrieve the fd count of the process for iOS. Following links contains a available method, but it’s complicated and inefficient. https://stackoverflow.com/questions/4083608/on-ios-iphone-too-many-open-files-need-to-list-open-files-like-lsof
Other Process
For windows, linux and android(maybe), it is possible to get fd number of other process. However we didn’t re-export these function because macos and ios is not supported.
Functions
fd_count_cur | return the fd count of current process |