Skip to main content

Module process

Module process 

Source
Expand description

Process-wide translator state for the single guest-process model.

Hot paths avoid the process RwLock:

Soft signals and directory streams still use with_mut / with_ref.

Structs§

ProcessState
Owned process state for one guest (or unit-test isolation via reset).

Functions§

bottle_dirfd
Process-wide bottle root directory fd for openat/fstatat (B1).
bottle_root
Clone of the configured bottle root, if any.
child_born
Parent observed a successful fork (child pid > 0).
child_reaped
Parent reaped at least one child via waitpid/wait4.
fd_alloc
Allocates a guest FD slot for host_fd (lock-free CAS scan).
fd_get
Resolve guest FD → host FD without taking the process lock (I/O hot path).
fd_install
Installs host_fd into a specific guest FD slot (for dup2).
fd_take
Removes a guest FD mapping and returns the host fd (lock-free).
live_children
Number of unreaped host children (approximate; for pipe blocking heuristics).
reset_run
Resets FD/signals/counters for a new guest run (keeps bottle root).
set_bottle_root
Configures the bottle root used by path-taking syscalls.
tick_syscall
Bumps the process-wide syscall counter without taking the process lock.
with_bottle_root
Borrow the bottle root without cloning (hot path for path translation).
with_mut
Exclusive access to the active process state.
with_ref
Shared access to the active process state (concurrent FD lookups, etc.).