Mike
Mike

Reputation: 60839

Python, sigaction(2) available?

Is there an equivalent to the POSIX sigaction available through Python? I realize python has traditional support for signals, but I need sigaction.

I'm trying to identify the pid of a process that is the source of a signal being issued. From what I can see from the documentation, there isn't a way to do this.

I'm only concerned with functionality on Linux.

Upvotes: 5

Views: 2702

Answers (1)

cdarke
cdarke

Reputation: 44434

There is a standard module called, unsurprisingly, signal. This seems to carry out the functionality of sigaction(2). However I'm guessing that what you really need is the siginfo_t struct, which gives the PID of the source of the signal, which is not part of the module at the moment (possibly because it is not implemented on all UNIXs).

The only alternative I can suggest is to use ctypes.

Upvotes: 7

Related Questions