pysignalfd

A pure Python wrapper of signalfd(2)


License
BSD-3-Clause
Install
pip install pysignalfd==0.0.1

Documentation

pysignalfd

A pure Python wrapper of signalfd(2).

Installation

pip install pysigalfd

Usage

import signal
import pysignalfd


sigs = [signal.SIGTERM, signal.SIGHUP]
signal.pthread_sigmask(signal.SIG_BLOCK, sigs)
fd = pysignalfd.signalfd(sigs, CLOEXEC=True, NONBLOCK=False)
for signum in pysignalfd.parse_siginfo(fd):
    print(signum)

Similar Tools

  1. python-signalfd
  2. signalfd

Both module relies on "Python.h" to extend, by which there is a concern that installation might fail on the disparate Linux environments.