How do I send and receive real-time signals `sigqueue()` in Python?

人盡茶涼 提交于 2019-12-06 07:44:27

You could do it with ctypes

>>> from ctypes import *
>>> c = cdll.LoadLibrary("libc.so.6")
>>> c.sigqueue
<_FuncPtr object at 0xb7dbd77c>
>>> c.sigqueue(100, 10, 0)
-1
>>>

You'll have to look up how to make a union in ctypes which I've never done before but I think is possible.

One alternative, if no one has done it yet, would be to wrap the C library yourself - should be pretty quick and painless. Look here for more details.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!