进程篇:
//功能:创建子线程获取进程编号
pid_t fork(void);
pid_t getpid(void);
pid_t getppid(void);
//功能:完全替换当前线程的内容
extern char **environ;
int execl(const char *path, const char *arg, …/* (char *) NULL */);
int execlp(const char *file, const char *arg, …/* (char *) NULL */);
int execle(const char *path, const char *arg, …/*, (char *) NULL, char * const envp[] */);
int execv(const char *path, char *const argv[]);
int execvp(const char *file, char *const argv[]);
int execvpe(const char *file, char *const argv[],char *const envp[]);
//功能:等待子线程结束
pid_t wait(int *status);
pid_t waitpid(pid_t pid, int *status, int options);
int waitid(idtype_t idtype, id_t id, siginfo_t *infop, int options); /* This is the glibc and POSIX interface; see NOTES for information on the raw system call. */
信号篇:
//功能:信号集函数
int sigemptyset(sigset_t *set);
int sigfillset(sigset_t *set);
int sigaddset(sigset_t *set, int signum);
int sigdelset(sigset_t *set, int signum);
int sigismember(const sigset_t *set, int signum);
//功能:原子化信号等待操作(替换pause())
int sigsuspend(const sigset_t *mask);(mask 为 sigprocmask备份的oldset)
//功能:信号屏蔽字
int sigprocmask(int how, const sigset_t *set, sigset_t *oldset);
//功能:信号处理函数(替换signal())
int sigaction(int signum, const struct sigaction *act,struct sigaction *oldact);
//功能:定时时间函数(替换alarm())
int getitimer(int which, struct itimerval *curr_value);
int setitimer(int which, const struct itimerval *new_value, struct itimerval *old_value);
//功能:向指定进程或进程组发送指定信号
int kill(pid_t pid, int sig);
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/275808.html