Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

[C] SIGINT + SIGTERM to parent and children

Name: Anonymous 2009-11-19 6:00

'sup guys?

I have a parent process that at some point forks into at least one child process.
I want to kill everything (parent+children) if the parent or any of its child processes get a SIGINT or SIGTERM.

How can I do this?

I know I have to use stuff from signal.h and probably a mutex(not sure on this?) to flag when it's time to die.

I would appreciate if you guys could help me.

Thank you.

Anon.

Name: Anonymous 2009-11-19 7:27

>>2
Do I have to set the handler in the begging of the parents' main and then in the begging of the child (right after the fork made in the parent)?

Much thankful for the assistance!

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List