Define CLOCK_* and TIMER_* in time.h, where they are supposed to be.

This commit is contained in:
David Schultz 2005-04-02 12:33:27 +00:00
parent 674b8a5cb4
commit 6d2f64c103
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=144529
2 changed files with 23 additions and 5 deletions

View File

@ -92,6 +92,23 @@ typedef __timer_t timer_t;
#include <sys/timespec.h>
#endif /* __POSIX_VISIBLE >= 199309 */
/* These macros are also in sys/time.h. */
#if !defined(CLOCK_REALTIME) && __POSIX_VISIBLE >= 200112
#define CLOCK_REALTIME 0
#ifdef __BSD_VISIBLE
#define CLOCK_VIRTUAL 1
#define CLOCK_PROF 2
#endif
#define CLOCK_MONOTONIC 4
#endif /* !defined(CLOCK_REALTIME) && __POSIX_VISIBLE >= 200112 */
#if !defined(TIMER_ABSTIME) && __POSIX_VISIBLE >= 200112
#if __BSD_VISIBLE
#define TIMER_RELTIME 0x0 /* relative timer */
#endif
#define TIMER_ABSTIME 0x1 /* absolute timer */
#endif /* !defined(TIMER_ABSTIME) && __POSIX_VISIBLE >= 200112 */
struct tm {
int tm_sec; /* seconds after the minute [0-60] */
int tm_min; /* minutes after the hour [0-59] */
@ -115,6 +132,7 @@ char *asctime(const struct tm *);
clock_t clock(void);
char *ctime(const time_t *);
double difftime(time_t, time_t);
/* XXX missing: getdate() */
struct tm *gmtime(const time_t *);
struct tm *localtime(const time_t *);
time_t mktime(struct tm *);
@ -130,6 +148,7 @@ void tzset(void);
int clock_getres(clockid_t, struct timespec *);
int clock_gettime(clockid_t, struct timespec *);
int clock_settime(clockid_t, const struct timespec *);
/* XXX missing: clock_nanosleep() */
int nanosleep(const struct timespec *, struct timespec *);
#endif /* __POSIX_VISIBLE >= 199309 */
@ -146,7 +165,7 @@ char *strptime(const char * __restrict, const char * __restrict,
#endif
#if __BSD_VISIBLE
char *timezone(int, int);
char *timezone(int, int); /* XXX XSI conflict */
void tzsetwall(void);
time_t timelocal(struct tm * const);
time_t timegm(struct tm * const);

View File

@ -232,17 +232,16 @@ struct clockinfo {
int profhz; /* profiling clock frequency */
};
/* CLOCK_REALTIME and TIMER_ABSTIME are supposed to be in time.h */
/* These macros are also in time.h. */
#ifndef CLOCK_REALTIME
#define CLOCK_REALTIME 0
#endif
#define CLOCK_VIRTUAL 1
#define CLOCK_PROF 2
#define CLOCK_MONOTONIC 4
#endif
#define TIMER_RELTIME 0x0 /* relative timer */
#ifndef TIMER_ABSTIME
#define TIMER_RELTIME 0x0 /* relative timer */
#define TIMER_ABSTIME 0x1 /* absolute timer */
#endif