prctl.pyx 360 B

1234567891011121314
  1. cdef extern from "<sys/prctl.h>":
  2. int prctl(int option, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5);
  3. PR_SET_PDEATHSIG = 1
  4. PR_SET_CHILD_SUBREAPER = 36
  5. def set_pdeathsig(signum):
  6. return prctl(PR_SET_PDEATHSIG, signum, 0, 0, 0)
  7. def set_child_subreaper(val):
  8. return prctl(PR_SET_CHILD_SUBREAPER, val, 0, 0, 0)