tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: snprintf(3) and friends async-signal safety?

On Wed, 22 Dec 2010 16:33:16 +0000, Sad Clouds <> wrote:
Well you could hangle Unix signals synchronously by using a thread
which waits for signals with sigwait(). Usually you block certain
signals in main thread, then one (signal catching) thread calls
sigwait() waiting for a signal. When the signal arrives, signal
catching thread stops/restarts other threads, depending on what the
signal was meant to do.

I could also play with a volatile sig_atomic_t, set it to 1 in handler and clear it in the dd(1) write loop.

I am not sure that turning dd(1) in a MT binary is the right approach :)

Jean-Yves Migeon

Home | Main Index | Thread Index | Old Index