4 ms·
> If you need to do some cleanup before you die, then that's exactly what a signal handler is there for you to do. I challenge you to clean up a temporary dire
by jlokier 6y ago
> If you need to do some cleanup before you die, then that's exactly what a signal handler is there for you to do.
I challenge you to clean up a temporary directory, like doing "rm -fr $TMPDIR/tmp$SECRET/" except not by running another program, in an async-signal-safe manner inside a SIGPIPE handler which then exits.
Hint: You're not allowed to call system(), readdir(), malloc() or any of exec*().