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:
Michael Kerrisk 2017-09-09 07:43:14 +02:00
parent 994e9b46f5
commit bf27fd0a15
1 changed files with 5 additions and 3 deletions

View File

@ -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);