Sysop: | Amessyroom |
---|---|
Location: | Fayetteville, NC |
Users: | 35 |
Nodes: | 6 (1 / 5) |
Uptime: | 18:55:24 |
Calls: | 321 |
Calls today: | 1 |
Files: | 957 |
Messages: | 82,382 |
Hi
I've been playing around with signalfd() on linux and it seems to work but >there also seems to be zero information other than the signal number in the >signalfd_siginfo structure returned from a read().
Where I'd expect PID and UID to be set as in reception of a signal handler >set using sigaction with the siginfo_t passed to the handler, the below code >returns 0 for everything in the signalfd_siginfo structure.
Hi
I've been playing around with signalfd() on linux and it seems to work but there also seems to be zero information other than the signal number in the signalfd_siginfo structure returned from a read().
Where I'd expect PID and UID to be set as in reception of a signal handler set using sigaction with the siginfo_t passed to the handler, the below code returns 0 for everything in the signalfd_siginfo structure.
The relevant parts of the code are below. Have I done something wrong?
struct signalfd_siginfo siginfo;
:
:
sigemptyset(&sigset);
sigaddset(&sigset,SIGINT); /* Control-C */
sigaddset(&sigset,SIGTSTP); /* Control-Z */
Muttley@DastardlyHQ.org writes:
Hi
I've been playing around with signalfd() on linux and it seems to work but >>there also seems to be zero information other than the signal number in the >>signalfd_siginfo structure returned from a read().
Where I'd expect PID and UID to be set as in reception of a signal handler >>set using sigaction with the siginfo_t passed to the handler, the below code >>returns 0 for everything in the signalfd_siginfo structure.
I wonder if you still need to call sigaction with SA_SIGINFO before
using signalfd?
... the pid and uid are only zerop when it receives a
signal from the terminal but when another process sends it it works ok.