1

I am reading book "Advanced Programming in the Unix Environment".

Here is the sentence that I can't understand:

Specifically, the exec() functions change the disposition of any signals being caught to their default action and leave the status of all other signals alone.

I understand the action of signals are changed to default action. But, what is the status of signal?

3

In

Specifically, the exec() functions change the disposition of any signals being caught to their default action and leave the status of all other signals alone.

the "status of all other signals" refers to the signals which are not being caught, e.g, they are being ignored (SIG_IGN).

If your program has added a handler for a signal, the program could catch that signal (except of course for SIGKILL and SIGSTOP which cannot be caught). When you call an exec() function, none of those signal handlers apply to the program after calling the exec() function.

If your program did not add a signal handler for a given signal, then calling an exec() function does not change the way that signal affects your program.

Signal handlers can be established with signal or sigaction.

  • Then what means leave alone?? And catch means that we define the signal handler using signal()? Càn you explain more? – A.Cho Mar 6 '16 at 16:15
  • 1
    catching a signal means setting up a signal handler using signal()/sigaction(). "leave alone" means unchanged -> action for these is not changed. – jai_s Mar 6 '16 at 16:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.