NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: standards/51024 (NetBSD misses the mandatory waitid() syscall)



Christos Zoulas <christos%zoulas.com@localhost> wrote:

> On Apr 4,  2:48pm, Joerg.Schilling%fokus.fraunhofer.de@localhost (Joerg Schilling) wrote:
> -- Subject: Re: standards/51024 (NetBSD misses the mandatory waitid() syscall
>
> | Thank you for your work!
> | 
> | I do not have netbsd installed, so I checked the sources.
> | 
> | 1)	I do not see any changes in the signal handling.
> | 	Is siginfo_t filled correctly in for the signalhandler
> | 	that handles SIGCHLD? It should deliver the same 
> | 	information as waitid() delivers, including the full 32 bits
> | 	from the exit() call in the child.
>
> Do you have the reference where it says it needs to preserve all 32 bits
> of exit code? I have not found one.

The description is in the current POSIX standard wich is called: 
	"ISSUE 7 tc2".

The text applies to (_Exit() and _exit()) starting at page 585
line 19365 and on page 827 starting at line 26976 (this is the exit() 
description):

    The value of status may be 0, EXIT_SUCCESS, EXIT_FAILURE, or any other 
    value, though only the least significant 8 bits (that is, status & 0377)
    shall be available from wait() and waitpid(); the full value shall
    be available from waitid() and in the siginfo_t passed to a
    signal handler for SIGCHLD.

See also http://austingroupbugs.net/view.php?id=594 that was mentioned in the 
original bug report. The original text from SUSV1 was correct, but a bug has 
been introduced in the POSIX text in the late 1990s. This bug was fixed on 
August 8, 2012. Given that POSIX standardized the AT&T waitid() interface from
1989, waitid() always required to return all 32 bits from exit().

> | 3)	From what I can tell, the new netbsd waitid() code only delivers
> | 	the low 8 bits from the exit() parameter. This is incorrect.
> | 
> | 	waitid() was introduced in 1989 by AT&T for SVr4 and defines to
> | 	deliver all 32 bits from the exit() call of the child.
> | 
> | 	Given that POSIX does not introcude own definitions but just
> | 	standardizes existing implementations, it should be obvious that
> | 	the SVID3 interface definitions apply to the POSIX waitid() call.
> | 
> | 	As a hint, here is the currenty valid relevant POSIX text:
> | 
> | 	**********
> | 	    the least significant 8 bits (that is, status & 0377) shall be 
> | 	    available from wait() and waitpid(); the full value shall 
> | 	    be available from waitid() and in the siginfo_t passed to a 
> | 	    signal handler for SIGCHLD. 
> | 	**********
> | 
> | I hope that you are interested in full POSIX compliance with waitid() as
> | waitid() is part of the basic set of interfaces. 
>
> Yes, and I know how to do that; the question is, where is it spelled in
> the docs that the full 32 bits of exit code need to be preserved?

See above, I mentioned the current text already in the original report and in 
my last mail.

For people who are not actively involved in the standardization, the current 
text will be available as a whole aprox. in mid-summer 2016. This is because 
of the official procedure requires a review by IEEE after the OpenGroup 
presented a new standard.

Jörg

-- 
 EMail:joerg%schily.net@localhost                    (home) Jörg Schilling D-13353 Berlin
       joerg.schilling%fokus.fraunhofer.de@localhost (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.org/private/ http://sourceforge.net/projects/schilytools/files/'



Home | Main Index | Thread Index | Old Index