Browse Source

Handle definition of struct timespec.

Manuel Novoa III 24 years ago
parent
commit
3e0fe4b1cc
2 changed files with 11 additions and 2 deletions
  1. 11 0
      include/sys/time.h
  2. 0 2
      include/time.h

+ 11 - 0
include/sys/time.h

@@ -22,6 +22,17 @@
 #include <features.h>
 
 #include <time.h>
+
+#if defined __USE_MISC || defined __USE_GNU
+/* POSIX.4 structure for a time value.  This is like a `struct timeval' but
+   has nanoseconds instead of microseconds.  */
+struct timespec
+  {
+    long int tv_sec;		/* Seconds.  */
+    long int tv_nsec;		/* Nanoseconds.  */
+  };
+#endif
+
 #include <sys/select.h>
 
 #define __need_timeval

+ 0 - 2
include/time.h

@@ -113,8 +113,6 @@ extern char	* ctime_r	__P((__const time_t *, char *));
 extern struct tm* gmtime_r	__P((__const time_t *, struct tm *));
 extern struct tm* localtime_r	__P((__const time_t *, struct tm *));
 
-struct timespec;
-
 /* IEEE Std 1003.1b-1993. */
 extern int nanosleep __P((__const struct timespec *__rqtp,
 		struct timespec *__rmtp));