Skip to main content

Module process

Module process 

Source
Expand description

Process lifecycle, credentials, signals, resource limits, and wait syscalls.

Structs§

KernelSigAction
AArch64 kernel struct sigaction layout (32 bytes: sa_handler, sa_flags, sa_restorer, sa_mask).
KernelSigSet
64-bit kernel signal set (sigset_t) for rt_sigaction and rt_sigprocmask.
Rlimit
Resource soft and hard limits (struct rlimit).
Rusage
Process resource usage statistics (struct rusage).

Constants§

KERNEL_SIGSET_BYTES
Size in bytes of the kernel signal mask (sigset_t = 64 bits = 8 bytes).
RLIMIT_CPU
CPU time limit in seconds.
RLIMIT_NOFILE
Value one greater than the maximum file descriptor number that can be opened.
RLIMIT_STACK
Maximum size of the process stack in bytes.
RLIM_INFINITY
Unlimited resource limit value.
RUSAGE_CHILDREN
Return resource usage for terminated and waited-for children.
RUSAGE_SELF
Return resource usage for the calling process.
SA_NOCLDSTOP
Do not receive notification when child processes stop.
SA_NOCLDWAIT
Do not transform children into zombies when they terminate.
SA_NODEFER
Do not prevent the signal from being received from within its own handler.
SA_ONSTACK
Call the signal handler on an alternate signal stack.
SA_RESETHAND
Restore the signal action to the default upon entry to the signal handler.
SA_RESTART
Restart syscalls if interrupted by this signal handler.
SA_RESTORER
Signal trampoline restorer flag.
SA_SIGINFO
Invoke signal-catching function with three arguments instead of one.
SIGABRT
Abort signal.
SIGALRM
Timer signal from alarm.
SIGBUS
Bus error (bad memory access).
SIGCHLD
Child stopped or terminated.
SIGFPE
Floating-point exception.
SIGHUP
Hangup detected on controlling terminal or death of controlling process.
SIGILL
Illegal instruction.
SIGINT
Interrupt from keyboard (Ctrl-C).
SIGKILL
Kill signal (cannot be caught or ignored).
SIGPIPE
Broken pipe: write to pipe with no readers.
SIGQUIT
Quit from keyboard.
SIGSEGV
Invalid memory reference (segmentation fault).
SIGTERM
Termination signal.
SIG_DFL
Default signal disposition.
SIG_IGN
Ignore signal disposition.
WNOHANG
Return immediately if no child has exited.
WUNTRACED
Also return if a child has stopped.

Functions§

abort
Immediately traps/aborts execution without unwinding.
execve_bytes
Replaces the current process image with path, passing args (argv) and envs (envp).
execve_raw⚠
Executes the program pointed to by prog with argument and environment pointer arrays.
exit_group
Terminates all threads in the calling process with exit status code.
exit_thread
Terminates the calling thread with exit status code.
fork
Creates a child process via clone(SIGCHLD, 0, 0, 0, 0).
getegid
Returns the effective group ID of the calling process.
geteuid
Returns the effective user ID of the calling process.
getgid
Returns the real group ID of the calling process.
getpid
Returns the process ID (PID) of the calling process.
getrlimit
Gets resource limits for resource.
getrusage
Gets resource usage measures for who (RUSAGE_SELF or RUSAGE_CHILDREN).
gettid
Returns the caller’s thread ID (TID).
getuid
Returns the real user ID of the calling process.
kill
Sends signal sig to pid.
rt_sigaction_raw⚠
Examines and changes a signal action using raw pointers.
sched_yield
Yields the processor to the scheduler.
setpgid
Sets the process group ID (pgid) of the process specified by pid.
setrlimit
Sets resource limits for resource to rlim.
setsid
Creates a session and sets the process group ID.
sigaction⚠
Examines and changes a signal action using typed KernelSigAction structures.
umask
Sets the calling process’s file mode creation mask (umask) and returns the previous mask.
waitpid
Waits for state changes in a child process via wait4(pid, status, options, null).
waitpid_opt
Waits for state changes in a child process via wait4(pid, status, options, null) with an optional status out-pointer.
wexitstatus
Extracts the low 8 bits of the exit code from a wait status s.
wifexited
Returns true if wait status s indicates normal termination (exit).
wtermsig
Extracts the terminating signal number from a wait status s.