jschwinger233 / pysignalfd

A pure Python wrapper of signalfd(2)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

A pure Python wrapper of signalfd(2)

License:GNU General Public License v3.0


Languages

Language:Python 100.0%