standards/170346: Changes to support waitid() and related stuff
Sergey Kandaurov
pluknet at gmail.com
Fri Aug 3 09:00:26 UTC 2012
The following reply was made to PR standards/170346; it has been noted by GNATS.
From: Sergey Kandaurov <pluknet at gmail.com>
To: bug-followup at FreeBSD.org, jau at iki.fi
Cc:
Subject: Re: standards/170346: Changes to support waitid() and related stuff
Date: Fri, 3 Aug 2012 12:52:39 +0400
Hi.
Shouldn't the idtype_t definition be cut from sys/types.h and instead moved
into sys/wait.h itself? POSIX specifies for waitid() that you only need to
include sys/wait.h and doesn't mention sys/types.h.
It's also probably makes sense to wrap new syscall with __POSIX_VISIBLE
Something like this:
Index: sys/sys/wait.h
===================================================================
--- sys/sys/wait.h (revision 237379)
+++ sys/sys/wait.h (working copy)
@@ -93,8 +93,18 @@
#define WAIT_MYPGRP 0 /* any process in my process group */
#endif /* __BSD_VISIBLE */
+#if __POSIX_VISIBLE >= 200809
+/* needs for waitid() */
+typedef enum {
+ P_ALL,
+ P_PGID,
+ P_PID
+/* other stuff goes here */
+} idtype_t;
+#endif
+
#ifndef _KERNEL
#include <sys/types.h>
+#include <sys/signal.h>
__BEGIN_DECLS
pid_t wait(int *);
@@ -104,6 +114,9 @@
pid_t wait3(int *, int, struct rusage *);
pid_t wait4(pid_t, int *, int, struct rusage *);
#endif
+#if __POSIX_VISIBLE >= 200809
+int waitid(idtype_t, id_t, siginfo_t *, int);
+#endif
__END_DECLS
#endif /* !_KERNEL */
The remain part of sys/wait.h patch intentionally omitted for clarity.
--
wbr,
pluknet
More information about the freebsd-standards
mailing list