序号 | 函数原型 | 头文件 | 说明 |
---|---|---|---|
1 | pid_t getpid(void); | unistd.h | 获取调用进程的进程ID。 |
2 | pid_t getppid(void); | unistd.h | 获取调用进程的父进程ID。 |
3 | uid_t getuid(void); | unistd.h | 获取调用进程的用户ID。 |
4 | uid_t geteuid(void); | unistd.h | 获取调用进程的有效用户ID。 |
5 | gid_t getgid(void); | unistd.h | 获取调用进程的组ID。 |
6 | gid_t getegid(void); | unistd.h | 获取调用进程的有效组ID。 |
7 | pid_t fork(void); | unistd.h | 创建一个新进程。 |
8 | pid_t vfork(void); | unistd.h | 创建一个新进程。 |
9 | void exit(int status); | stdlib.h | / |
10 | pid_t wait(int *status); | sys/wait.h | 获取子进程的终止状态。 |
11 | pid_t waitpid(pid_t pid, int *status, int options); | sys/wait.h | 获取子进程的终止状态。 |
12 | int waitid(idtype_t idtype, id_t id, siginfo_t *infop, int options); | sys/wait.h | / |
13 | pid_t wait3(int *status, int options, struct rusage *rusage); | sys/types.h sys/wait.> sys/time.h sys/resource.h |
/ |
14 | pid_t wait4(pid_t pid, int *status, int options, struct rusage *rusage); | sys/types.h sys/wait.> sys/time.h sys/resource.h |
/ |
15 | int execl(const char *pathname, const char *arg0, ... /* (char*)0 */); | unistd.h | / |
16 | int execv(const char *pathname, char *const argv[]); | unistd.h | / |
17 | int execle(const char *pathname, const char *arg, ... /* (char *)0, char *const envp[] */); | unistd.h | / |
18 | int execve(const char *pathname, char *const argv[], char *const envp[]); | unistd.h | / |
19 | int execlp(const char *filename, const char *arg0, ... /* (char*)0 */); | unistd.h | / |
20 | int execvp(const char *filename, char *const argv[]); | unistd.h | / |
21 | int fexecve(int fd, char *const argv[], char *const envp[]); | unistd.h | / |
22 | int setuid(uid_t uid); | unistd.h | 更改ruid euid resuid |
23 | int setgid(git_t gid); | unistd.h | 更改rgid egid resgid |
24 | int setreuid(uid_t ruid, uid_t euid); | unistd.h | 交换用户ID和有效用户ID |
25 | int setregid(gid_t rgid, gid_t egid); | unistd.h | 交换组ID和有效组ID |
26 | int seteuid(uid_t uid); | unistd.h | 更改有效用户ID |
27 | int setegid(gid_t gid); | unistd.h | 更改有效组ID |
28 | int system(const char *cmdstring); | stdlib.h | 在程序中执行一个命令字符串。 |
29 | char *getlogin(void); | unistd.h | 说获取登录名。 |
30 | int nice(int incr); | unistd.h | 设置进程的nice值。 |
31 | int getpriority(int which, id_t who); | sys/resource.h | 获取进程的nice值。 |
32 | int setpriority(int which, id_t who, int value); | sys/resource.h | 设置进程的nice值。 |
序号 | 函数原型 | 头文件 | 说明 |
This repository was archived by the owner on Feb 1, 2022. It is now read-only.