[lkml]   [1996]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: On SIGCHLD signal semantics
On Tue, 18 Jun 1996, Theodore Y. Ts'o wrote:

> >First, applications that set their SIGCHLD handler to SIG_IGN are not
> >inherently broken. They are simply expecting System V semantics.

> But Linux is not System V. Linux is Linux. Ergo: these
> applications are broken. Full stop.

> Well, to the extent that Linux is trying to provide System V
> compatibility, Linux can also be said to be broken. Yes, applications
> which assume System V behavior are not POSIX-complaint, and it would
> probably be better to make them POSIX complaint.

No, don't contradict yourself. System V SIGCHLD signal semantics *are*
POSIX compliant, simply because POSIX did not bother making a decision
about SIG_IGN.

> As far as improving Linux so that it can handle System V-style
> compatibility, yes we can do that but it would be rather tricky to do.
> I'll start looking at ways to accomplish this.

My proposal is quite simple to implement. I'll be finalizing the change

> >One open question remains, and that is the advisability of causing child
> >processes to inherit SIG_IGN as their SIGCHLD signal handler (i.e. to do
> >an exec* syscall while ignoring child processes).

> Perhaps the SIGCHLD handler can be reset to SIG_DFL across an
> exec, unless of course POSIX exlicitly forbids this.

> POSIX explicitly specifies how signals should be inherited across an
> exec(), and your sugestion violates the POSIX requirements.

I think the applicability of this requirement to SIGCHLD was an oversight
on POSIX' part, because always setting SIGCHLD to SIG_DFL on exec would
certainly solve a lot of portability problems.

> As for Marc's suggestion for treating inherited versus explicitly set
> SIG_IGN differently, other people have listed the many reasons why
> that's a bad idea. It violates the principal of least surprise; there
> might by System V applications that assume that you can inherit SIG_IGN;
> and if you save and restore a signal handler, it will look like a
> explicitly set signal handler, not an inherited signal handle.

.. which oddly enough would give them System V semantics, just what they
expect. BSD applications have no need to save/restore inherited SIGCHLD
handlers (because SIG_IGN == SIG_DFL).


| Marc Aurele La France | work: 1-403-492-9310 |
| Computing and Network Services | fax: 1-403-492-1729 |
| 352 General Services Building | email: |
| University of Alberta +-----------------------------------+
| Edmonton, Alberta | |
| T6G 2H1 | Standard disclaimers apply |
| CANADA | |

 \ /
  Last update: 2005-03-22 13:37    [W:0.061 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site