Re: signalfd()

Liste des GroupesRevenir à cu programmer 
Sujet : Re: signalfd()
De : rweikusat (at) *nospam* talktalk.net (Rainer Weikusat)
Groupes : comp.unix.programmer
Date : 24. Feb 2025, 16:19:19
Autres entêtes
Message-ID : <87r03ngyko.fsf@doppelsaurus.mobileactivedefense.com>
References : 1
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
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.
>
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 */

[...]

sigaction(2) documents the details regarding which fields in a siginfo
structure will be set under which conditions and if were using C-c and
C-z to generate signals, the pid and uid values shouldn't be set. They
should be set when using kill(2) or sigqueue(2) to send signals.

Date Sujet#  Auteur
24 Feb 25 * signalfd()4Muttley
24 Feb 25 +- Re: signalfd()1Rainer Weikusat
24 Feb 25 `* Re: signalfd()2Muttley
24 Feb 25  `- Re: signalfd()1Lawrence D'Oliveiro

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal