Reputation: 10068
if i call sigaction at the beginning of my code,
sigaction(SIGPIPE, &pipe_act, NULL);
if i receive sigpipe, after the execution of pipe_act the handler installed remains pipe_Act, or the default handler is automatically set for sigpipe?
Upvotes: 2
Views: 660
Reputation: 477464
It depends on whether or not your flags (pipe_act->sa_flags
) include SA_RESETHAND
. If yes, then the signal handler is a "one-shot" and gets removed after having been called (i.e. the handler is reset to the default handler), but if not, then the handler remains in place until you change it manually.
Upvotes: 3