Skip to main content

Module index_lock_holders

Module index_lock_holders 

Source
Expand description

Processes holding a lock file open, found by device and inode. What: Processes holding a lock file open, found by device and inode: /proc/<pid>/fd on Linux, lsof on macOS, the Restart Manager on Windows. Why: An open descriptor proves a live owner. Matching by device and inode, never by path text, means bind mounts and renamed paths cannot fake or hide a holder. Processes the scan cannot read are partial evidence (src/index-lock/index-lock-holders-linux.ts, -darwin.ts, -win32.ts).

In TS you’d write (pseudocode):

const evidence = await scanPlatformHolders({ lockPath, lock });

Re-exports§

pub use super::index_lock_holder_parsers::LsofProcess;
pub use super::index_lock_holder_parsers::matching_holders;
pub use super::index_lock_holder_parsers::parse_lsof_fields;
pub use super::index_lock_holder_parsers::parse_lsof_number;
pub use super::index_lock_holder_parsers::parse_restart_manager_output;

Structs§

Holder
What: One process holding the lock open. Why: LockHolderProcess.
HolderEvidence
What: The scan mechanism, its holders, and what it could not see. Why: LockHolderEvidence.

Constants§

RESTART_MANAGER_SCRIPT
The incumbent’s Restart Manager script, byte for byte.
SILENT_DENIAL_NOTE
Partial-evidence note every unprivileged macOS scan carries.

Functions§

scan_platform_holders
What: Scan for open holders with the host’s mechanism. Why: scanPlatformHolders.
scan_proc_fd_holders
What: Every process other than this one holding a file open, by device and inode, through a proc root. Why: scanProcFdHolders; processes are scanned one after another (the incumbent runs 16 at once; the result is the same set).