tech-userlevel archive

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

The <signal.h> header shall define the timespec structure as described in <time.h>



http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html says:
'The <signal.h> header shall define the timespec structure as described
in <time.h>.'

For the following code:
#include <signal.h>
struct timespec ts;
int main(){}

I get:
error: storage size of ‘ts’ isn’t known
 struct timespec ts;

I added <sys/time.h> to <sys/siginfo.h>  to follow
http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/sys/siginfo.h.diff?r1=1.5&r2=1.6&f=h

Is this change ok?

Index: sys/sys/siginfo.h
===================================================================
RCS file: /cvsroot/src/sys/sys/siginfo.h,v
retrieving revision 1.25
diff -u -r1.25 siginfo.h
--- sys/sys/siginfo.h	22 Nov 2013 21:04:11 -0000	1.25
+++ sys/sys/siginfo.h	22 Jun 2015 07:25:46 -0000
@@ -34,6 +34,7 @@

 #include <machine/signal.h>
 #include <sys/featuretest.h>
+#include <sys/time.h>
 #ifdef _KERNEL
 #include <sys/queue.h>
 #endif
Index: include/signal.h
===================================================================
RCS file: /cvsroot/src/include/signal.h,v
retrieving revision 1.54
diff -u -r1.54 signal.h
--- include/signal.h	27 Aug 2010 08:40:38 -0000	1.54
+++ include/signal.h	22 Jun 2015 07:25:46 -0000
@@ -183,7 +183,6 @@
 void	psiginfo(const siginfo_t *, const char *);

 #ifndef __LIBC12_SOURCE__
-struct timespec;
 int	sigtimedwait(const sigset_t * __restrict,
     siginfo_t * __restrict, const struct timespec * __restrict)
     __RENAME(__sigtimedwait50);



Home | Main Index | Thread Index | Old Index