Expand description
The processes of this host that use a directory or a file.
What:
The processes of this host that use a directory or a file:
a working directory or an open descriptor inside the directory,
or an open descriptor on the file.
Why:
Recovery may treat a directory or a lock as abandoned only when no process can still be using it.
A process that holds a path open is the one proof of use that survives a lost record,
so the scan reads it from /proc and says what it could not read instead of guessing.
Only processes of the scanning account are reported as unreadable:
another account’s process cannot have opened a private file this account created,
and every unprivileged scan meets some of them.
In TS you’d write (pseudocode):
const users = await processesUsing({ target: { inside: directory }, selfPid: process.pid });Structs§
- Process
User - One process found using the target.
- UseScan
- What:
The processes found using a target and the reasons the scan could not see everything.
Why:
A caller that cannot rely on a scan with no process table refuses when
unavailableis set;unreadablelists single processes the scan could not see into, which a caller may or may not tolerate.
Enums§
- UseTarget
- What: What a scan looks for. Why: A directory is matched by path because a record inside it may be opened under any name; a file is matched by device and inode because a lock has more than one name.
Constants§
- PROC_
ROOT - The root of the process table on Linux.
Functions§
- processes_
using - What:
Every other process that uses the target on this host.
Why:
The production scan of
processes_using_through. - processes_
using_ through - What:
Every process other than
self_pidthat uses the target, through a proc root. Why: Recovery runs this only after a record is missing or a lock is unproven, so the scan costs nothing on a commit that finds its state whole.