mirror of https://github.com/mkerrisk/man-pages
timer_create.2: Strengthen the warning about use of printf() in the example program
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
994e9b46f5
commit
bf27fd0a15
|
@ -381,9 +381,11 @@ print_siginfo(siginfo_t *si)
|
|||
static void
|
||||
handler(int sig, siginfo_t *si, void *uc)
|
||||
{
|
||||
/* Note: calling printf() from a signal handler is not
|
||||
strictly correct, since printf() is not async\-signal\-safe;
|
||||
see signal-safety(7) */
|
||||
/* Note: calling printf() from a signal handler is not safe
|
||||
(and should not be done in production programs), since
|
||||
printf() is not async\-signal\-safe; see signal-safety(7).
|
||||
Nevertheless, we use printf() here as a simple way of
|
||||
showing that the handler was called. */
|
||||
|
||||
printf("Caught signal %d\\n", sig);
|
||||
print_siginfo(si);
|
||||
|
|
Loading…
Reference in New Issue