On Sat, Oct 10, 2015 at 11:34:02PM -0700, Philip Guenther wrote:
> POSIX permits the Right Thing (resetting SIGCHLD, as we do), but doesn't
> require it. Document both that we do it and that it's not portable to
> require it.
>
>
> I'm moderately concerned that the first bit should be merged into the
> sentence at the start of the context. Which is clearer, what I have in
> the diff:
> Signals set to be ignored in the calling process are set to be ignored in
> the new process. Signals which are set to be caught in the calling
> process image are set to default action in the new process image. As an
> exception, if SIGCHLD is ignored then it is reset to the default action.
>
> or should the descriptions be merged:
> Signals other than SIGCHLD set to be ignored in the calling process are
> set to be ignored in the new process. SIGCHLD and signals which are set
> to be caught in the calling process image are set to the default action
> in the new process image.
>
> or maybe:
> Except for SIGCHLD, signals set to be ignored in the calling process are
> set to be ignored in the new process. SIGCHLD and signals which are set
> to be caught in the calling process image are set to the default action
> in the new process image.
>
> What phrasing is clearest?
>
> Jason, HELLLLLP!
>
>
if you can easily combine it, it probably makes sense to do so. i find
the last example you've given to be easiest to read. wording it that way
puts the emphasis on SIGCHLD though - not sure if that's your aim. if
not you could use example two, but maybe rework it a little:
Signals set to be ignored in the calling process, with the
exception of SIGCHLD, are set to be...
but really they all read fine.
jmc
>
> Philip Guenther
>
> Index: sys/execve.2
> ===================================================================
> RCS file: /cvs/src/lib/libc/sys/execve.2,v
> retrieving revision 1.46
> diff -u -p -U5 -r1.46 execve.2
> --- sys/execve.2 10 Sep 2015 17:55:21 -0000 1.46
> +++ sys/execve.2 11 Oct 2015 06:20:59 -0000
> @@ -124,10 +124,13 @@ many libraries make assumptions about th
> Signals set to be ignored in the calling process are set to be ignored in
> the
> new process.
> Signals which are set to be caught in the calling process image
> are set to default action in the new process image.
> +As an exception, if
> +.Dv SIGCHLD
> +is ignored then it is reset to the default action.
> Blocked signals remain blocked regardless of changes to the signal action.
> The signal stack is reset to be undefined (see
> .Xr sigaction 2
> for more information).
> .Pp
> @@ -321,5 +324,14 @@ If a program is
> to a non-superuser, but is executed when the real
> .Em uid
> is
> .Dq root ,
> then the process has some of the powers of a superuser as well.
> +.Pp
> +.St -p1003.1-2008
> +permits
> +.Nm
> +to leave
> +.Dv SIGCHLD
> +as ignored in the new process; portable programs cannot rely on
> +.Nm
> +resetting it to the default disposition.
>