What are the Python equivalents of the sighold and sigrelse functions found in C?

It looks like the Python signal module has nothing like the sighold and sigrelse functions found in C using signal.h. Are there any Python equivalents?

Many thanks!

+3
source share
2 answers

There are no direct bindings for this in Python. Access to them through ctypes is quite simple; here is an example.

import ctypes, signal
libc = ctypes.cdll.LoadLibrary("libc.so.6")
libc.sighold(signal.SIGKILL)
libc.sigrelse(signal.SIGKILL)

, , Python , C. Python , C , ( ..). Python .

, , , Python , C.

+2

Source: https://habr.com/ru/post/1697312/


All Articles