=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/include/time.h,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- src/include/time.h 2003/08/01 17:38:33 1.16 +++ src/include/time.h 2005/12/13 00:35:22 1.17 @@ -1,4 +1,4 @@ -/* $OpenBSD: time.h,v 1.16 2003/08/01 17:38:33 avsm Exp $ */ +/* $OpenBSD: time.h,v 1.17 2005/12/13 00:35:22 millert Exp $ */ /* $NetBSD: time.h,v 1.9 1994/10/26 00:56:35 cgd Exp $ */ /* @@ -41,6 +41,7 @@ #ifndef _TIME_H_ #define _TIME_H_ +#include #include #ifndef NULL @@ -66,8 +67,24 @@ #undef _BSD_SIZE_T_ #endif -#define CLOCKS_PER_SEC 100 +#if __POSIX_VISIBLE > 0 && __POSIX_VISIBLE < 200112 || __BSD_VISIBLE +/* + * Frequency of the clock ticks reported by times(). Deprecated - use + * sysconf(_SC_CLK_TCK) instead. (Removed in 1003.1-2001.) + */ +#define CLK_TCK 100 +#endif +#define CLOCKS_PER_SEC 100 /* frequency of ticks reported by clock(). */ + +#ifndef _TIMESPEC_DECLARED +#define _TIMESPEC_DECLARED +struct timespec { + time_t tv_sec; /* seconds */ + long tv_nsec; /* and nanoseconds */ +}; +#endif + struct tm { int tm_sec; /* seconds after the minute [0-60] */ int tm_min; /* minutes after the hour [0-59] */ @@ -82,8 +99,6 @@ char *tm_zone; /* timezone abbreviation */ }; -#include - __BEGIN_DECLS struct timespec; char *asctime(const struct tm *); @@ -105,19 +120,18 @@ struct tm *localtime_r(const time_t *, struct tm *); int nanosleep(const struct timespec *, struct timespec *); -#if !defined(_ANSI_SOURCE) -#define CLK_TCK 100 +#if __POSIX_VISIBLE extern char *tzname[2]; void tzset(void); -#endif /* not ANSI */ +#endif -#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) +#if __BSD_VISIBLE char *timezone(int, int); void tzsetwall(void); time_t timelocal(struct tm *); time_t timegm(struct tm *); time_t timeoff(struct tm *, const long); -#endif /* neither ANSI nor POSIX */ +#endif __END_DECLS #endif /* !_TIME_H_ */