100 lines
2.3 KiB
Plaintext
100 lines
2.3 KiB
Plaintext
// Execute program
|
|
execve(pathname, argv, envp);
|
|
|
|
// Exit all threads in a process
|
|
exit_group(status);
|
|
|
|
// Get group identity
|
|
getegid();
|
|
|
|
// Get user identity
|
|
getuid();
|
|
geteuid();
|
|
|
|
// Set/get group identity
|
|
setgid(gid);
|
|
getgid();
|
|
|
|
// Set user identity
|
|
setuid(uid);
|
|
|
|
// Set real and/or effective user or group ID
|
|
setreuid(ruid, euid);
|
|
setregid(rgid, egid);
|
|
|
|
// Set real, effective, and saved user or group ID
|
|
setresuid(ruid, euid, suid);
|
|
setresgid(rgid, egid, sgid);
|
|
|
|
// Get real, effective, and saved user/group ID
|
|
getresuid(ruid, euid, suid);
|
|
getresgid(rgid, egid, sgid);
|
|
|
|
// Get process identification
|
|
getpid();
|
|
getppid();
|
|
|
|
// Set and get a thread's CPU affinity mask
|
|
sched_setaffinity(pid, cpusetsize, mask);
|
|
sched_getaffinity(pid, cpusetsize, mask);
|
|
|
|
limit_resources = RLIMIT_AS | RLIMIT_CORE | RLIMIT_CPU | RLIMIT_DATA | RLIMIT_FSIZE |
|
|
RLIMIT_LOCKS | RLIMIT_MEMLOCK | RLIMIT_MSGQUEUE | RLIMIT_NICE |
|
|
RLIMIT_NOFILE | RLIMIT_NPROC | RLIMIT_RSS | RLIMIT_RTPRIO |
|
|
RLIMIT_RTTIME | RLIMIT_SIGPENDING | RLIMIT_STACK;
|
|
|
|
// Get or set resource limits
|
|
prlimit64(pid, resource = <limit_resources>, new_limit, old_limit);
|
|
getrlimit(resource = <limit_resources>, rlim);
|
|
setrlimit(resource = <limit_resources>, rlim);
|
|
|
|
// Yield the processor
|
|
sched_yield();
|
|
|
|
// Create a child process
|
|
fork();
|
|
|
|
// Terminate the calling process
|
|
exit(status);
|
|
|
|
// Set/get process group
|
|
setpgid(pid, pgid);
|
|
getpgid(pid);
|
|
getpgrp();
|
|
|
|
// Create a session and set the process group ID
|
|
setsid();
|
|
|
|
// Get session ID
|
|
getsid(pid);
|
|
|
|
// Get thread ID
|
|
gettid();
|
|
|
|
// Set user identity used for filesystem checks
|
|
setfsuid(fsuid);
|
|
|
|
// Set group identity used for filesystem checks
|
|
setfsgid(fsgid);
|
|
|
|
// Determine CPU and NUMA node on which the calling thread is running
|
|
getcpu(cpu, node);
|
|
|
|
// Get/set program scheduling priority
|
|
getpriority(which = PRIO_PROCESS | PRIO_PGRP | PRIO_USER, who);
|
|
setpriority(which = PRIO_PROCESS | PRIO_PGRP | PRIO_USER, who, prio);
|
|
|
|
sched_policies = SCHED_FIFO | SCHED_RR | SCHED_OTHER | SCHED_BATCH |
|
|
SCHED_IDLE | SCHED_DEADLINE;
|
|
|
|
// Get static priority range
|
|
sched_get_priority_max(policy = <sched_policies>);
|
|
sched_get_priority_min(policy = <sched_policies>);
|
|
|
|
// Get/set scheduling parameters
|
|
sched_setparam(pid, param);
|
|
sched_getparam(pid, param);
|
|
|
|
// Get scheduling policy
|
|
sched_getscheduler(pid);
|