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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It depends on whether or not your flags (
pipe_act->sa_flags) includeSA_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.