News for hackers. Stuff that matters.
Re:How Not to Write a Signal Handler by userbinator on Friday November 28, 2014 @12:40AM (#8669814)
I've always found it interesting that the list of safe functions includes read(), write(), and most of the filesystem operations; so while printf is not safe, you could use write() if you really wanted to output.
Re:How Not to Write a Signal Handler by gryph0n on Friday November 28, 2014 @06:05AM (#8670510)
write() is an OS system call, while printf() is a C function call.

C libraries can (and do) choose to buffer printf, while read/write are usually unbuffered.

Of course, both are mechanisms are modifying some global state (your terminal's state), and cannot be relied to be free of race-conditions.