wait.h 428 B

123456789101112131415161718192021
  1. #pragma once
  2. #include "types.h"
  3. /**
  4. * @brief 等待所有子进程退出
  5. *
  6. * @param stat_loc 返回的子进程结束状态
  7. * @return pid_t
  8. */
  9. pid_t wait(int *stat_loc);
  10. /**
  11. * @brief 等待指定pid的子进程退出
  12. *
  13. * @param pid 子进程的pid
  14. * @param stat_loc 返回的子进程结束状态
  15. * @param options 额外的控制选项
  16. * @return pid_t
  17. */
  18. pid_t waitpid(pid_t pid, int *stat_loc, int options);