tor  0.4.2.0-alpha-dev
Typedefs | Functions
waitpid.h File Reference

Go to the source code of this file.

Typedefs

typedef struct waitpid_callback_t waitpid_callback_t
 

Functions

waitpid_callback_tset_waitpid_callback (pid_t pid, void(*fn)(int, void *), void *arg)
 
void clear_waitpid_callback (waitpid_callback_t *ent)
 
void notify_pending_waitpid_callbacks (void)
 

Detailed Description

Headers for waitpid.c.

Definition in file waitpid.h.

Typedef Documentation

◆ waitpid_callback_t

A callback structure waiting for us to get a SIGCHLD informing us that a PID has been closed. Created by set_waitpid_callback. Cancelled or cleaned- up from clear_waitpid_callback(). Do not access outside of the main thread; do not access from inside a signal handler.

Definition at line 21 of file waitpid.h.

Function Documentation

◆ clear_waitpid_callback()

void clear_waitpid_callback ( waitpid_callback_t ent)

Cancel a waitpid_callback_t, or clean up after one has triggered. Releases all storage held by ent.

Definition at line 98 of file waitpid.c.

Referenced by process_unix_free_().

◆ notify_pending_waitpid_callbacks()

void notify_pending_waitpid_callbacks ( void  )

Use waitpid() to wait for all children that have exited, and invoke any callbacks registered for them.

Definition at line 141 of file waitpid.c.