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:

  • FD table is lock-free atomics (fd_get / fd_alloc / fd_take)
  • Bottle root is a separate RwLock (path translate never takes process write)
  • Directory streams use a dedicated mutex (readdir never blocks open/stat)

Structs§

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

Functions§

bottle_root
Clone of the configured bottle root, if any.
close_dir_stream
Closes any directory stream associated with gfd (call before FD free).
fd_alloc
Allocates a guest FD for host_fd without the process lock.
fd_get
Resolve guest FD → host FD without taking the process lock (I/O hot path).
fd_take
Removes a guest FD mapping and returns the host FD (lock-free).
readdir_next_into
Next directory entry for gfd, writing the name into name_out (NUL-terminated).
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.