Путеводитель по Руководству Linux

  User  |  Syst  |  Libr  |  Device  |  Files  |  Other  |  Admin  |  Head  |



   wait.3p    ( 3 )

подождите, пока дочерний процесс остановится или завершится (wait for a child process to stop or terminate)

  Prolog  |  Name  |  Synopsis  |  Description  |  Return value  |  Error  |  Examples  |    Application usage    |  Rationale  |  Future directions  |  See also  |

Использование в приложениях (Application usage)

Calls to wait() will collect information about any child process. This may result in interactions with other interfaces that may be waiting for their own children (such as by use of system()). For this and other reasons it is recommended that portable applications not use wait(), but instead use waitpid(). For these same reasons, the use of waitpid() with a pid argument of -1, and the use of waitid() with the idtype argument set to P_ALL, are also not recommended for portable applications.

As specified in Consequences of Process Termination, if the calling process has SA_NOCLDWAIT set or has SIGCHLD set to SIG_IGN, then the termination of a child process will not cause status information to become available to a thread blocked in wait(), waitid(), or waitpid(). Thus, a thread blocked in one of the wait functions will remain blocked unless some other condition causes the thread to resume execution (such as an [ECHILD] failure due to no remaining children in the set of waited-for children).