def installHandler(fd):
 if (fd == (-1)):
  signal.signal(signal.SIGCHLD, signal.SIG_DFL)
 else:
  def noopSignalHandler(*args):
   pass
  signal.signal(signal.SIGCHLD, noopSignalHandler)
  signal.siginterrupt(signal.SIGCHLD, False)
 return signal.set_wakeup_fd(fd)

def installHandler ( fd ) : if ( fd == ( - 1 ) ) : signal . signal ( signal . SIGCHLD , signal . SIG_DFL ) else : def noopSignalHandler ( * args ) : pass signal . signal ( signal . SIGCHLD , noopSignalHandler ) signal . siginterrupt ( signal . SIGCHLD , False ) return signal . set_wakeup_fd ( fd )
install a signal handler which will write a byte to c{fd} when i{sigchld} is received .