Module rustix::process

Documentation

Process-associated operations.

Structs

CpuSet represents a bit-mask of CPUs.

Cpuid any(linux_raw, all(libc, any(target_os = "android", target_os = "linux")))

A Linux CPU ID.

gid_t—A Unix group ID.

A result from membarrier_query.

pid_t—A non-zero Unix process ID.

struct rlimit—Current and maximum values used in getrlimit, setrlimit, and [prlimit`].

uid_t—A Unix user ID.

struct utsname—Return type for uname.

Options for modifying the behavior of wait/waitpid

the status of the child processes the caller waited on

Enums

A command for use with membarrier and membarrier_cpu.

A resource value for use with getrlimit, setrlimit, and prlimit.

A signal number for use with kill_process and kill_process_group.

Functions

chdir(path)—Change the working directory.

fchdir not(target_os = "fuchsia")

fchdir(fd)—Change the working directory.

getcwd not(target_os = "wasi")

getcwd()

getegid()—Returns the process’ effective group ID.

geteuid()—Returns the process’ effective user ID.

getgid()—Returns the process’ real group ID.

getpid()—Returns the process’ ID.

getppid()—Returns the parent process’ ID.

getpriority_pgrp not(target_os = "redox")

getpriority(PRIO_PGRP, gid)—Get the scheduling priority of the given process group.

getpriority_process not(target_os = "redox")

getpriority(PRIO_PROCESS, pid)—Get the scheduling priority of the given process.

getpriority_user not(target_os = "redox")

getpriority(PRIO_USER, uid)—Get the scheduling priority of the given user.

getrlimit(resource)—Get a process resource limit value.

getuid()—Returns the process’ real user ID.

kill_current_process_group not(target_os = "wasi")

kill(0, sig)—Sends a signal to all processes in the current process group.

kill_process not(target_os = "wasi")

kill(pid, sig)—Sends a signal to a process.

kill_process_group not(target_os = "wasi")

kill(-pid, sig)—Sends a signal to all processes in a process group.

linux_execfn any(linux_raw, all(libc, any(all(target_os = "android", target_pointer_width = "64"), target_os = "linux")))

getauxval(AT_EXECFN)—Returns the Linux “execfn” string.

linux_hwcap any(linux_raw, all(libc, any(all(target_os = "android", target_pointer_width = "64"), target_os = "linux")))

(getauxval(AT_HWCAP), getauxval(AT_HWCAP2)—Returns the Linux “hwcap” data.

membarrier(cmd, 0, 0)—Perform a memory barrier.

membarrier(cmd, MEMBARRIER_CMD_FLAG_CPU, cpu)—Perform a memory barrier with a specific CPU.

membarrier(MEMBARRIER_CMD_QUERY, 0, 0)—Query the supported membarrier commands.

nice()—Adjust the scheduling priority of the current process.

getpagesize()—Returns the process’ page size.

prlimit any(target_os = "android", target_os = "linux")

prlimit(pid, resource, new)—Get and set a process resource limit value.

sched_getaffinity(pid)—Get a thread’s CPU affinity mask.

sched_setaffinity(pid, cpuset)—Set a thread’s CPU affinity mask.

sched_yield()—Hints to the OS that other processes should run.

setpriority_pgrp not(target_os = "redox")

setpriority(PRIO_PGRP, pgid)—Get the scheduling priority of the given process group.

setpriority_process not(target_os = "redox")

setpriority(PRIO_PROCESS, pid)—Get the scheduling priority of the given process.

setpriority_user not(target_os = "redox")

setpriority(PRIO_USER, uid)—Get the scheduling priority of the given user.

setrlimit(resource, new)—Set a process resource limit value.

setsid not(target_os = "wasi")

setsid()—Create a new session.

uname()—Returns high-level information about the runtime OS and hardware.

wait not(target_os = "wasi")

wait(waitopts)—Wait for any of the children of calling process to change state.

waitpid not(target_os = "wasi")

waitpid(pid, waitopts)—Wait for a specific process to change state.

Type Definitions

A group identifier as a raw integer.

A non-zero process identifier as a raw non-zero integer.

A process identifier as a raw integer.

A user identifier as a raw integer.

Constants

EXIT_FAILURE for use with exit.

EXIT_SIGNALED_SIGABRT not(target_os = "wasi")

The exit status used by a process terminated with SIGABRT signal.

EXIT_SUCCESS for use with exit.