summaryrefslogtreecommitdiff
path: root/main.c
AgeCommit message (Collapse)Author
2023-06-09Reorganize codeAaron Ball
This moves file descriptor stating code into the new fdstats files, and the config code into the new config files. Relevant updates made to reference structs by pointer.
2023-06-09Update copywrite from 2021 to 2023Aaron Ball
2023-06-09Switch config struct to use pid_t for pidAaron Ball
Technically a pid is a signed int, so the previous code was fine. But using pid_t follows better practice.
2023-06-09Simplify initialization of config structAaron Ball
Just memset the whole range to 0 rather than initializing each member.
2023-06-09Add file descriptor size metricsAaron Ball
This allows printing of total space taken by all open file descriptors with `-sfd,--sizefd`, or all dead file descriptors with `-sd,--sizedead`, or all live file descriptors with `-sl,--sizelive`. Output is in kilobytes. This also introduces a new function, `fgetsize`, which returns the byte count of a file path.
2022-08-18Support truncating dead file descriptorsAaron Ball
It is a common needed functionality for leaky services to be able to easily zero out their dead file descriptors to prolong service lifetime before a reboot is needed. This adds the switch `--truncate-dead` which will cause fd-enum to truncate all dead file descriptors to zero length. This saves effort and runtime where previously the list of dead descriptors would need to be parsed and piped to another program for zeroing. This is much faster.
2021-07-22Initial commitAaron Ball
This includes support to display statistics on a given pid's open file descriptors. It also can print open file descriptor paths and resolved paths by type. The current version of this tool has been tested on over 550,000 open file descriptors and performs well (runtime was about 6 seconds).

Generated by cgit