O nás     Inzerce     KontaktSpolehlivé informace o IT již od roku 2011
Hledat
Nepřehlédněte: Usnadní vám práci: Pozoruhodné IT produkty pro rok 2024
Správa dokumentů
Digitální transformace
Informační systémy
Hlavní rubriky: Informační systémy, Mobilní technologie, Datová centra, Sítě, IT bezpečnost, Software, Hardware, Zkušenosti a názory, Speciály

Pozoruhodné IT produkty 2024
E-knihy o IT zdarma
Manuál Linux
[Linux manuál]

waitid: počkejte, až podřízený proces změní stav

Originální popis anglicky: waitid - wait for a child process to change state

Návod, kniha: POSIX Programmer's Manual

STRUČNĚ

#include <sys/wait.h>
 
 
int waitid(idtype_t idtype, id_t id, siginfo_t *infop, int options);
 

POPIS / INSTRUKCE

The waitid() function shall suspend the calling thread until one child of the process containing the calling thread changes state. It records the current state of a child in the structure pointed to by infop. If a child process changed state prior to the call to waitid(), waitid() shall return immediately. If more than one thread is suspended in wait() or waitpid() waiting for termination of the same process, exactly one thread shall return the process status at the time of the target process termination.
The idtype and id arguments are used to specify which children waitid() waits for.
If idtype is P_PID, waitid() shall wait for the child with a process ID equal to ( pid_t)id.
If idtype is P_PGID, waitid() shall wait for any child with a process group ID equal to ( pid_t)id.
If idtype is P_ALL, waitid() shall wait for any children and id is ignored.
The options argument is used to specify which state changes waitid() shall wait for. It is formed by OR'ing together one or more of the following flags:
WEXITED
Wait for processes that have exited.
WSTOPPED
Status shall be returned for any child that has stopped upon receipt of a signal.
WCONTINUED
Status shall be returned for any child that was stopped and has been continued.
WNOHANG
Return immediately if there are no children to wait for.
WNOWAIT
Keep the process whose status is returned in infop in a waitable state. This shall not affect the state of the process; the process may be waited for again after this call completes.
 
The application shall ensure that the infop argument points to a siginfo_t structure. If waitid() returns because a child process was found that satisfied the conditions indicated by the arguments idtype and options, then the structure pointed to by infop shall be filled in by the system with the status of the process. The si_signo member shall always be equal to SIGCHLD.

NÁVRATOVÁ HODNOTA

If WNOHANG was specified and there are no children to wait for, 0 shall be returned. If waitid() returns due to the change of state of one of its children, 0 shall be returned. Otherwise, -1 shall be returned and errno set to indicate the error.

CHYBY / ERRORY

The waitid() function shall fail if:
ECHILD
The calling process has no existing unwaited-for child processes.
EINTR
The waitid() function was interrupted by a signal.
EINVAL
An invalid value was specified for options, or idtype and id specify an invalid set of processes.
 
The following sections are informative.

PŘÍKLADY POUŽITÍ

None.

APPLICATION USAGE

None.

RATIONALE

None.

FUTURE DIRECTIONS

None.

SOUVISEJÍCÍ

exec() , exit() , wait() , the Base Definitions volume of IEEE Std 1003.1-2001, <sys/wait.h> Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .
2003 IEEE/The Open Group
©2011-2024 BusinessIT.cz, ISSN 1805-0522 | Názvy použité v textech mohou být ochrannými známkami příslušných vlastníků.
Provozovatel: Bispiral, s.r.o., kontakt: BusinessIT(at)Bispiral.com | Inzerce: Best Online Media, s.r.o., zuzana@online-media.cz
O vydavateli | Pravidla webu BusinessIT.cz a ochrana soukromí | Používáme účetní program Money S3 | pg(8581)