Expand description
Process lifecycle, credentials, signals, resource limits, and wait syscalls.
Structs§
- Kernel
SigAction - AArch64 kernel
struct sigactionlayout (32 bytes:sa_handler,sa_flags,sa_restorer,sa_mask). - Kernel
SigSet - 64-bit kernel signal set (
sigset_t) forrt_sigactionandrt_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, passingargs(argv) andenvs(envp). - execve_
raw ⚠ - Executes the program pointed to by
progwith 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_SELForRUSAGE_CHILDREN). - gettid
- Returns the caller’s thread ID (
TID). - getuid
- Returns the real user ID of the calling process.
- kill
- Sends signal
sigtopid. - 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 bypid. - setrlimit
- Sets resource limits for
resourcetorlim. - setsid
- Creates a session and sets the process group ID.
- sigaction⚠
- Examines and changes a signal action using typed
KernelSigActionstructures. - 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
trueif wait statussindicates normal termination (exit). - wtermsig
- Extracts the terminating signal number from a wait status
s.