misc/181439: sys/wait.h is not enough to use waitid(), but kind of should be.

Dmitrijs Ledkovs xnox at debian.org
Tue Aug 20 22:00:00 UTC 2013


>Number:         181439
>Category:       misc
>Synopsis:       sys/wait.h is not enough to use waitid(), but kind of should be.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Aug 20 22:00:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Dmitrijs Ledkovs
>Release:        9.2-rc2
>Organization:
>Environment:
>Description:
"[CX] The <signal.h> header shall define the siginfo_t type as a structure."
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html

"
#include <sys/wait.h>
int waitid(idtype_t idtype, id_t id, siginfo_t *infop, int options);
"
http://pubs.opengroup.org/onlinepubs/9699919799/functions/waitid.html

To use waitid() one needs to pass "siginfo_t *" to it, thus it's reasonable to expect that "siginfo_t" would be defined if <sys/wait.h> is included.

When the below code sample is compiled:
* on linux - there is one error too few arguments to function call waitid
* on freebsd - there are two errors (a) unknown type name 'siginfo_t' (b) too few arguments to function call waitid

I'm not sure if it's a bug in the standard, linux implementation, or freebsd implementation. But it would be nice, if both linux & freebsd implementations interpreted the standard the same, i.e. "#include <sys/wait.h> is enough to call waitid()"
>How-To-Repeat:
#include <sys/wait.h>
siginfo_t info;
int main(){
        waitid();
        return 0;
}

>Fix:
<sys/wait.h> header should include <signal.h> header.

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list