If I setup sighandler and then do a fork. Will the child process also inherit the sighandlers?
Share
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.
Quoting the Linux
fork(2)man page:So, while the pending signals do not make it through the
fork()operation, the signal handlers themselves do. This makes sense since the signals belong to the (parent) process.Although not directly related, the
exec()-type call that often follows afork()will destroy all signal handlers since a brand new executable is being loaded into the process (overwriting the functions currently servicing signals).