2

Python provides a signals module and os.kill; does it have a facility for sigqueue() (real-time signals with attached data)? What are the alternatives?

alk
  • 69,737
  • 10
  • 105
  • 255
joeforker
  • 40,459
  • 37
  • 151
  • 246

2 Answers2

3

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.

Nick Craig-Wood
  • 52,955
  • 12
  • 126
  • 132
2

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.

Shane C. Mason
  • 7,518
  • 3
  • 26
  • 33