* signal(7) should mention sig_atomic_t
@ 2013-11-06 10:32 Basile Starynkevitch
0 siblings, 0 replies; only message in thread
From: Basile Starynkevitch @ 2013-11-06 10:32 UTC (permalink / raw)
To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA
Hello,
Thanks for your man pages project!
I believe that the following paragraphs could be added to signal(7),
perhaps at the end of the Async-signal-safe functions subsection:
####
A common way to code a signal handler respecting the
async-signal-safe requirements is to declare some global or static
volatile variable of sig_atomic_t type, e.g:
volatile sig_atomic_t got_signal;
The sig_atomic_t type (defined in <signal.h>) is some integral type
which can be atomically tested and set w.r.t. signals. Then the handler
is just setting that variable, and the program can test (outside of the
handler), at suitable places in the code, if that variable is set.
####
I am not a native English speaker, so feel free to improve or shorten
the above. But I believe that volatile sig_atomic_t should be mentioned
somewhere in signal(7)
Regards.
--
Basile STARYNKEVITCH http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mine, sont seulement les miennes} ***
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2013-11-06 10:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-06 10:32 signal(7) should mention sig_atomic_t Basile Starynkevitch
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox