CS FundamentalsVery hardGATE CS

A process ignores SIGINT and then calls exec() to run a new program. Which statement is correct?

  1. A. All signals are reset to default, including ignored ones
  2. B. The handler functions remain installed in the new program
  3. C. SIGINT remains ignored in the new program, but any signal for which a handler function was installed is reset to its default action
  4. D. exec() fails when any signal is ignored

Correct answer: C. SIGINT remains ignored in the new program, but any signal for which a handler function was installed is reset to its default action

A caught signal's handler address would be meaningless in the new image, so it is reset to default. Ignored dispositions (SIG_IGN) and the signal mask are inherited across exec; this is how nohup works.

More Operating Systems questions

Exams that ask this topic