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)



The following reply was made to PR standards/51024; it has been noted by GNATS.

From: christos%zoulas.com@localhost (Christos Zoulas)
To: Joerg Schilling <Joerg.Schilling%fokus.fraunhofer.de@localhost>, <wiz%netbsd.org@localhost>, 
	<standards-manager%netbsd.org@localhost>, <netbsd-bugs%netbsd.org@localhost>, 
	<gnats-bugs%netbsd.org@localhost>, <gnats-admin%netbsd.org@localhost>
Cc: 
Subject: Re: standards/51024 (NetBSD misses the mandatory waitid() syscall)
Date: Mon, 4 Apr 2016 10:08:07 -0400

 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.
 
 | 2)	kern_exit.c does not look correct (complete).
 | 	If you really like to keep the deprecated wait status in the kernel,
 | 	you should use a more complete conversion code to convert the
 | 	deprecated wait status into siginfo_t. A correct piece of code
 | 	is in the compatibility code of the recent Bourne Shell:
 | 
 | 		http://schilytools.sourceforge.net/bosh.html
 | 
 | 	Source code is in the schily tools:
 | 
 | 		https://sourceforge.net/projects/schilytools/files/
 | 
 | 	Use latest *schily-*' tar archive.
 | 
 | 	Check the bottom of the file sh/jobs.c
 
 I'll take a look.
 
 | 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?
 
 christos
 


Home | Main Index | Thread Index | Old Index