

pause() : wait for an event (per thread?)

struct sigaction act, oact;

typedef void Sigfunc(int);

Sigfunc func;
act.sa_handler = func;
sigemptyset( &act.sa_mask );
act.sa_flags = 0;
#ifdef SA_RESTART
 act.sa_flags |= SA_RESTART;  //ev. nicht ntig
#endif
if( sigaction( SIGCHLD, &act, &oact ) < 0 )
  return( SIG_ERR );

int status;
pid_t pid;
while( (pid = waitpid( -1, &status, WNOHANG)) > 0 );

static void
sig_child( int)
{
  return;
}