/*++ /* NAME /* timed_wait 3 /* SUMMARY /* wait operations with timeout /* SYNOPSIS /* #include <timed_wait.h> /* /* int timed_waitpid(pid, statusp, options, time_limit) /* pid_t pid; /* WAIT_STATUS_T *statusp; /* int options; /* int time_limit; /* DESCRIPTION /* \fItimed_waitpid\fR() waits at most \fItime_limit\fR seconds /* for process termination. /* /* Arguments: /* .IP "pid, statusp, options" /* The process ID, status pointer and options passed to waitpid(3). /* .IP time_limit /* The time in seconds that timed_waitpid() will wait. /* This must be a number > 0. /* DIAGNOSTICS /* Panic: interface violation. /* /* When the time limit is exceeded, the result is -1 and errno /* is set to ETIMEDOUT. Otherwise, the result value is the result /* from the underlying waitpid() routine. /* BUGS /* If there were a \fIportable\fR way to select() on process status /* information, these routines would not have to use a steenkeeng /* alarm() timer and signal() handler. /* LICENSE /* .ad /* .fi /* The Secure Mailer license must be distributed with this software. /* AUTHOR(S) /* Wietse Venema /* IBM T.J. Watson Research /* P.O. Box 704 /* Yorktown Heights, NY 10598, USA
/*--*/
int timed_waitpid(pid_t pid, WAIT_STATUS_T *statusp, int options, int time_limit)
{ constchar *myname = "timed_waitpid"; struct sigaction action; struct sigaction old_action; int time_left; int wpid;
/* *Sanitychecks.
*/ if (time_limit <= 0)
msg_panic("%s: bad time limit: %d", myname, time_limit);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.