home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Trees / V6 / usr / man / man2 / wait.2 < prev    next >
Encoding:
Text File  |  1975-06-26  |  1.6 KB  |  70 lines

  1. .th WAIT II 2/9/75
  2. .sh NAME
  3. wait \*- wait for process to terminate
  4. .sh SYNOPSIS
  5. (wait = 7.)
  6. .br
  7. .ft B
  8. sys  wait
  9. .ft R
  10. .br
  11. (process ID in r0)
  12. .br
  13. (status in r1)
  14. .s3
  15. .ft B
  16. wait(status)
  17. .br
  18. int *status;
  19. .ft R
  20. .sh DESCRIPTION
  21. .it Wait
  22. causes its caller to delay until one of its child
  23. processes terminates.
  24. If any child has died since the last
  25. .it wait,
  26. return is immediate;
  27. if there are no children, return is immediate with
  28. the error bit set
  29. (resp. with a value of \*-1 returned).
  30. The normal return yields the process ID of the terminated child
  31. (in r0).
  32. In the case of several children several
  33. .it wait
  34. calls are needed
  35. to learn of all the deaths.
  36. .s3
  37. If no error is indicated on return,
  38. the r1 high byte (resp. the high byte stored into
  39. .it status
  40. ) contains the low byte of the
  41. child process r0 (resp. the argument of
  42. .it exit
  43. ) when it terminated.
  44. The r1 (resp.
  45. .it status
  46. ) low byte contains the termination status
  47. of the process.
  48. See signal (II) for
  49. a list of termination statuses (signals);
  50. 0 status indicates normal termination.
  51. A special status (0177) is returned for a stopped process
  52. which has not terminated and can be restarted.
  53. See ptrace (II).
  54. If the 0200 bit of the termination status
  55. is set,
  56. a core image of the process was produced
  57. by the system.
  58. .s3
  59. If the parent process terminates without
  60. waiting on its children,
  61. the initialization process
  62. (process ID = 1)
  63. inherits the children.
  64. .sh "SEE ALSO"
  65. exit (II), fork (II), signal (II)
  66. .sh DIAGNOSTICS
  67. The error bit
  68. (c-bit) is set if there are no children not previously waited for.
  69. From C, a returned value of \*-1 indicates an error.
  70.