1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
.TH TICKIT_WATCH_PROCESS 3
.SH NAME
tickit_watch_process \- invoke a callback when a child process terminates
.SH SYNOPSIS
.EX
.B #include <tickit.h>
.sp
.B typedef struct {
.BI " pid_t " pid ;
.BI " int " wstatus ;
.BI "} " TickitProcessWatchInfo ;
.sp
.BI "typedef int " TickitCallbackFn "(Tickit *" t ", TickitEventflags " flags ,
.BI " void *" info ", void *" user );
.sp
.BI "void *tickit_watch_process(Tickit *" t ", pid_t " pid ", TickitBindFlags " flags ,
.BI " TickitCallbackFn *" fn ", void *" user );
.EE
.sp
Link with \fI\-ltickit\fP.
.SH DESCRIPTION
\fBtickit_watch_process\fP() registers a callback function to be invoked by the toplevel event loop when a child process terminates. A registered callback will be invoked by a running call to \fBtickit_run\fP(3). The \fIinfo\fP pointer will point to a structure containing the process PID and exit status.
.PP
If registered with the \fBTICKIT_BIND_FIRST\fP flag, the callback will be inserted at the start of the queue, coming before others. If not, it is appended at the end.
.PP
If cancelled by \fBtickit_watch_cancel\fP(3) the callback function is invoked with just the \fBTICKIT_EV_UNBIND\fP flag if it had been registered with \fBTICKIT_BIND_UNBIND\fP.
.SH "RETURN VALUE"
\fBtickit_watch_process\fP() returns an opaque identifier pointer.
.SH "SEE ALSO"
.BR tickit_new_stdio (3),
.BR tickit_watch_io (3),
.BR tickit_watch_timer_after_msec (3),
.BR tickit_watch_timer_at_epoch (3),
.BR tickit_watch_later (3),
.BR tickit_watch_signal (3),
.BR tickit_watch_cancel (3),
.BR tickit (7)
|