Module process

Source
Expand description

Process-associated operations.

Structs§

Gid
gid_t—A Unix group ID.
Pid
pid_t—A non-zero Unix process ID.
Rlimit
struct rlimit—Current and maximum values used in getrlimit, setrlimit, and [prlimit].
Uid
uid_t—A Unix user ID.
WaitOptions
Options for modifying the behavior of wait/waitpid.
WaitStatus
The status of a child process after calling wait/waitpid.
WaitidOptions
Options for modifying the behavior of waitid.
WaitidStatus
The status of a process after calling waitid.

Enums§

Resource
A resource value for use with getrlimit, setrlimit, and prlimit.
Signal
A signal number for use with kill_process, kill_process_group, and kill_current_process_group.
WaitId
The identifier to wait on in a call to waitid.

Constants§

EXIT_FAILURE
EXIT_FAILURE for use with exit.
EXIT_SIGNALED_SIGABRT
The exit status used by a process terminated with a Signal::Abort signal.
EXIT_SUCCESS
EXIT_SUCCESS for use with exit.

Functions§

chdir
chdir(path)—Change the current working directory.
chroot
chroot(path)—Change the process root directory.
fchdir
fchdir(fd)—Change the current working directory.
getcwd
getcwd—Return the current working directory.
getegid
getegid()—Returns the process’ effective group ID.
geteuid
geteuid()—Returns the process’ effective user ID.
getgid
getgid()—Returns the process’ real group ID.
getgroups
getgroups()—Return a list of the current user’s groups.
getpgid
getpgid(pid)—Returns the process group ID of the given process.
getpgrp
getpgrp()—Returns the process’ group ID.
getpid
getpid()—Returns the process’ ID.
getppid
getppid()—Returns the parent process’ ID.
getpriority_pgrp
getpriority(PRIO_PGRP, gid)—Get the scheduling priority of the given process group.
getpriority_process
getpriority(PRIO_PROCESS, pid)—Get the scheduling priority of the given process.
getpriority_user
getpriority(PRIO_USER, uid)—Get the scheduling priority of the given user.
getrlimit
getrlimit(resource)—Get a process resource limit value.
getsid
getsid(pid)—Get the session ID of the given process.
getuid
getuid()—Returns the process’ real user ID.
ioctl_tiocsctty
ioctl(fd, TIOCSCTTY, 0)—Sets the controlling terminal for the process.
kill_current_process_group
kill(0, sig)—Sends a signal to all processes in the current process group.
kill_process
kill(pid, sig)—Sends a signal to a process.
kill_process_group
kill(-pid, sig)—Sends a signal to all processes in a process group.
nice
nice(inc)—Adjust the scheduling priority of the current process.
sched_yield
sched_yield()—Hints to the OS that other processes should run.
setpgid
setpgid(pid, pgid)—Sets the process group ID of the given process.
setpriority_pgrp
setpriority(PRIO_PGRP, pgid)—Get the scheduling priority of the given process group.
setpriority_process
setpriority(PRIO_PROCESS, pid)—Get the scheduling priority of the given process.
setpriority_user
setpriority(PRIO_USER, uid)—Get the scheduling priority of the given user.
setrlimit
setrlimit(resource, new)—Set a process resource limit value.
setsid
setsid()—Create a new session.
test_kill_current_process_group
kill(0, 0)—Check validity of pid and permissions to send signals to the all processes in the current process group, without actually sending any signals.
test_kill_process
kill(pid, 0)—Check validity of pid and permissions to send signals to the process, without actually sending any signals.
test_kill_process_group
kill(-pid, 0)—Check validity of pid and permissions to send signals to all processes in the process group, without actually sending any signals.
umask
umask(mask)—Set the process file creation mask.
wait
wait(waitopts)—Wait for any of the children of calling process to change state.
waitid
waitid(_, _, _, opts)—Wait for the specified child process to change state.
waitpgid
waitpid(-pgid, waitopts)—Wait for a process in a specific process group to change state.
waitpid
waitpid(pid, waitopts)—Wait for a specific process to change state.

Type Aliases§

RawGid
A group identifier as a raw integer.
RawPid
A process identifier as a raw integer.
RawUid
A user identifier as a raw integer.