Quick question:
I have signals. When a task forks, should the parent task's signals be copied to the child task's signal list?
-JL
Signals, and forking
- piranha
- Member
- Posts: 1391
- Joined: Thu Dec 21, 2006 7:42 pm
- Location: Unknown. Momentum is pretty certain, however.
- Contact:
Signals, and forking
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
I'll assume that you have another mechanism for multithreading, so you are only referring to independent child processes.
I would say that a traditionally defined fork() function should copy the signal table, and then exec() should obviously reset the table to defaults. The thing is, UNIX/POSIX was pretty adamant that fork() should produce an absolutely 100% exact perfect copy. No way whatsoever to tell the difference between the two, except for the return value from fork().
I would say that a traditionally defined fork() function should copy the signal table, and then exec() should obviously reset the table to defaults. The thing is, UNIX/POSIX was pretty adamant that fork() should produce an absolutely 100% exact perfect copy. No way whatsoever to tell the difference between the two, except for the return value from fork().
According to http://www.opengroup.org/onlinepubs/000 ... /fork.html, the child task should keep the parent's signal handlers but not its pending signals.
- piranha
- Member
- Posts: 1391
- Joined: Thu Dec 21, 2006 7:42 pm
- Location: Unknown. Momentum is pretty certain, however.
- Contact:
Thanks, implemented. File descriptors too, eh? Hmm....I guess i'll do that too.
-JL
-JL
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io