Skip to main content

Module process

Module process 

Source
Expand description

Process-wide guest state: run flags, stack bootstrap, dyld image table.

Modules§

dyld_table
Runtime table of mapped guest dylibs for freestanding dlopen / dlsym.
stack
Minimal Darwin-ish process stack bootstrap (argc / argv / env / terminator).

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_guest_nonblock
Guest-visible O_NONBLOCK for gfd (stdio or allocated slot).
fd_guest_path
Guest path for gfd, if recorded at open.
fd_install
Installs host_fd into a specific guest FD slot (for dup2).
fd_is_tls
True when gfd is a TLS-wrapped guest FD (hot path; no mutex).
fd_set_guest_nonblock
Sets guest-visible O_NONBLOCK for gfd.
fd_set_guest_path
Record the guest path used to open gfd (absolute Darwin path).
fd_set_tls
Mark / clear TLS session association for gfd (paired with crate::tls_fd).
fd_take
Removes a guest FD mapping and returns the host fd (lock-free).
guest_executable_path
Guest absolute executable path, if set for this run.
live_children
Number of unreaped host children (approximate; for pipe blocking heuristics).
normalize_stdio_pipes_blocking
Clear host O_NONBLOCK on stdio when the fd is a pipe/FIFO.
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.
set_guest_executable_path
Records the guest-visible main executable path for _NSGetExecutablePath.
stdio_mark_open
Clear the closed bit for a stdio slot (after successful dup2 onto 0/1/2).
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.).