diff options
author | peter <peter@FreeBSD.org> | 1997-05-13 10:58:14 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1997-05-13 10:58:14 +0000 |
commit | c67b6ed92cf41abef3d58c2ab95aa585e2ee91cf (patch) | |
tree | de3dbc2a4fa5fafa403221434a25d967eb3c7088 /sys | |
parent | b0fdd73677eea5df875efc2599d480f7d29fa246 (diff) | |
download | FreeBSD-src-c67b6ed92cf41abef3d58c2ab95aa585e2ee91cf.zip FreeBSD-src-c67b6ed92cf41abef3d58c2ab95aa585e2ee91cf.tar.gz |
struct timespec needs to be useable with just <time.h>, but needs to not
conflict with the kernel visible one. Make the new stuff not visible if
_ANSI_SOURCE or _POSIX_SOURCE is defined (!) because the new things are
not part of the base 1003.1-1990 standard or ansi (says Bruce).
Reviewed by: bde
Diffstat (limited to 'sys')
-rw-r--r-- | sys/sys/time.h | 8 | ||||
-rw-r--r-- | sys/sys/timetc.h | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/sys/sys/time.h b/sys/sys/time.h index f7c5260..27c2c19 100644 --- a/sys/sys/time.h +++ b/sys/sys/time.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)time.h 8.5 (Berkeley) 5/4/95 - * $Id: time.h,v 1.12 1997/03/22 06:53:24 bde Exp $ + * $Id: time.h,v 1.13 1997/05/08 13:48:47 peter Exp $ */ #ifndef _SYS_TIME_H_ @@ -48,13 +48,13 @@ struct timeval { long tv_usec; /* and microseconds */ }; -/* - * Structure defined by POSIX.4 to be like a timeval. - */ +#ifndef _TIMESPEC_DECLARED +#define _TIMESPEC_DECLARED struct timespec { time_t tv_sec; /* seconds */ long tv_nsec; /* and nanoseconds */ }; +#endif #define TIMEVAL_TO_TIMESPEC(tv, ts) { \ (ts)->tv_sec = (tv)->tv_sec; \ diff --git a/sys/sys/timetc.h b/sys/sys/timetc.h index f7c5260..27c2c19 100644 --- a/sys/sys/timetc.h +++ b/sys/sys/timetc.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)time.h 8.5 (Berkeley) 5/4/95 - * $Id: time.h,v 1.12 1997/03/22 06:53:24 bde Exp $ + * $Id: time.h,v 1.13 1997/05/08 13:48:47 peter Exp $ */ #ifndef _SYS_TIME_H_ @@ -48,13 +48,13 @@ struct timeval { long tv_usec; /* and microseconds */ }; -/* - * Structure defined by POSIX.4 to be like a timeval. - */ +#ifndef _TIMESPEC_DECLARED +#define _TIMESPEC_DECLARED struct timespec { time_t tv_sec; /* seconds */ long tv_nsec; /* and nanoseconds */ }; +#endif #define TIMEVAL_TO_TIMESPEC(tv, ts) { \ (ts)->tv_sec = (tv)->tv_sec; \ |