diff options
| author | Konstantin Belousov <kib@FreeBSD.org> | 2020-07-21 08:13:35 +0000 |
|---|---|---|
| committer | Konstantin Belousov <kib@FreeBSD.org> | 2020-07-21 08:13:35 +0000 |
| commit | 826c98ddd69b538a3f57d8ca9d462e775c780494 (patch) | |
| tree | c94f8b9c02e0af6e9f1a4bfbdbf0a3ace07b1591 | |
| parent | 18d0be9e109a87c64d2414db6c19f6694e0fa9b6 (diff) | |
MFC r363193:
Make CLOCK_REALTIME and TIMER_ABSTIME available for XOPEN_SOURCE >= 500.
PR: 247701
Notes
svn path=/stable/11/; revision=363386
| -rw-r--r-- | include/time.h | 14 | ||||
| -rw-r--r-- | sys/sys/time.h | 4 |
2 files changed, 12 insertions, 6 deletions
diff --git a/include/time.h b/include/time.h index cfd22df9f09e..dbfb89a60503 100644 --- a/include/time.h +++ b/include/time.h @@ -96,12 +96,14 @@ typedef __pid_t pid_t; #endif /* These macros are also in sys/time.h. */ -#if !defined(CLOCK_REALTIME) && __POSIX_VISIBLE >= 200112 +#if !defined(CLOCK_REALTIME) && __POSIX_VISIBLE >= 199506 #define CLOCK_REALTIME 0 -#ifdef __BSD_VISIBLE +#endif /* !defined(CLOCK_REALTIME) && __POSIX_VISIBLE >= 199506 */ +#if !defined(CLOCK_VIRTUAL) && __BSD_VISIBLE #define CLOCK_VIRTUAL 1 #define CLOCK_PROF 2 -#endif +#endif /* !defined(CLOCK_VIRTUAL) && __BSD_VISIBLE */ +#if !defined(CLOCK_MONOTONIC) && __POSIX_VISIBLE >= 200112 #define CLOCK_MONOTONIC 4 #define CLOCK_UPTIME 5 /* FreeBSD-specific. */ #define CLOCK_UPTIME_PRECISE 7 /* FreeBSD-specific. */ @@ -113,14 +115,14 @@ typedef __pid_t pid_t; #define CLOCK_SECOND 13 /* FreeBSD-specific. */ #define CLOCK_THREAD_CPUTIME_ID 14 #define CLOCK_PROCESS_CPUTIME_ID 15 -#endif /* !defined(CLOCK_REALTIME) && __POSIX_VISIBLE >= 200112 */ +#endif /* !defined(CLOCK_MONOTONIC) && __POSIX_VISIBLE >= 200112 */ -#if !defined(TIMER_ABSTIME) && __POSIX_VISIBLE >= 200112 #if __BSD_VISIBLE #define TIMER_RELTIME 0x0 /* relative timer */ #endif +#if !defined(TIMER_ABSTIME) && __POSIX_VISIBLE >= 199506 #define TIMER_ABSTIME 0x1 /* absolute timer */ -#endif /* !defined(TIMER_ABSTIME) && __POSIX_VISIBLE >= 200112 */ +#endif /* !defined(TIMER_ABSTIME) && __POSIX_VISIBLE >= 199506 */ struct tm { int tm_sec; /* seconds after the minute [0-60] */ diff --git a/sys/sys/time.h b/sys/sys/time.h index a5155cfd2293..0f3dd52f3595 100644 --- a/sys/sys/time.h +++ b/sys/sys/time.h @@ -382,8 +382,12 @@ struct clockinfo { /* These macros are also in time.h. */ #ifndef CLOCK_REALTIME #define CLOCK_REALTIME 0 +#endif +#ifndef CLOCK_VIRTUAL #define CLOCK_VIRTUAL 1 #define CLOCK_PROF 2 +#endif +#ifndef CLOCK_MONOTONIC #define CLOCK_MONOTONIC 4 #define CLOCK_UPTIME 5 /* FreeBSD-specific. */ #define CLOCK_UPTIME_PRECISE 7 /* FreeBSD-specific. */ |
