1 #include <syscall/syscall_num.h> 2 #include <syscall/syscall.h> 3 4 /** 5 * @brief 等待指定pid的子进程退出 6 * 7 * @param pid 子进程的pid 8 * @param stat_loc 返回的子进程结束状态 9 * @param options 额外的控制选项 10 * @return pid_t 11 */ waitpid(pid_t pid,int * stat_loc,int options)12pid_t waitpid(pid_t pid, int *stat_loc, int options) 13 { 14 return (pid_t)enter_syscall_int(SYS_WAIT4, (uint64_t)pid, (uint64_t)stat_loc, options, 0, 0, 0, 0, 0); 15 }