Signals, and forking

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
Post Reply
User avatar
piranha
Member
Member
Posts: 1391
Joined: Thu Dec 21, 2006 7:42 pm
Location: Unknown. Momentum is pretty certain, however.
Contact:

Signals, and forking

Post by piranha »

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
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Post by bewing »

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().
nick8325
Member
Member
Posts: 200
Joined: Wed Oct 18, 2006 5:49 am

Post by nick8325 »

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.
User avatar
piranha
Member
Member
Posts: 1391
Joined: Thu Dec 21, 2006 7:42 pm
Location: Unknown. Momentum is pretty certain, however.
Contact:

Post by piranha »

Thanks, implemented. File descriptors too, eh? Hmm....I guess i'll do that too.

-JL
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
Post Reply