diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2018-10-30 16:28:43 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2018-10-30 16:28:43 +0000 |
commit | 1cf268a2ea3ddde5672c28ea4325f04d7f8594d4 (patch) | |
tree | d6c233ed4e557d09379ade91dc90884e7ad86857 /include | |
parent | 109dc65ae659f99838c64a6aea35a88efd11e3c4 (diff) |
Add C11's timespec_get(3); minor bump for libc.
Tweaked diff from brad@
manpage tweaks florian@ and jmc@
ok deraadt@ millert@
Diffstat (limited to 'include')
-rw-r--r-- | include/time.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/time.h b/include/time.h index fc9121e631d..51bee8fe771 100644 --- a/include/time.h +++ b/include/time.h @@ -1,4 +1,4 @@ -/* $OpenBSD: time.h,v 1.30 2017/09/05 03:16:13 schwarze Exp $ */ +/* $OpenBSD: time.h,v 1.31 2018/10/30 16:28:42 guenther Exp $ */ /* $NetBSD: time.h,v 1.9 1994/10/26 00:56:35 cgd Exp $ */ /* @@ -70,7 +70,7 @@ typedef __size_t size_t; #define CLOCKS_PER_SEC 100 /* frequency of ticks reported by clock(). */ -#if __POSIX_VISIBLE >= 199309 +#if __POSIX_VISIBLE >= 199309 || __ISO_C_VISIBLE >= 2011 #ifndef _TIMESPEC_DECLARED #define _TIMESPEC_DECLARED struct timespec { @@ -78,7 +78,9 @@ struct timespec { long tv_nsec; /* and nanoseconds */ }; #endif +#endif +#if __POSIX_VISIBLE >= 199309 #include <sys/_time.h> #ifndef _CLOCKID_T_DEFINED_ @@ -173,6 +175,11 @@ size_t strftime_l(char *__restrict, size_t, const char *__restrict, __attribute__ ((__bounded__(__string__,1,2))); #endif +#if __ISO_C_VISIBLE >= 2011 +#define TIME_UTC 1 /* time elapsed since epoch */ +int timespec_get(struct timespec *_ts, int _base); +#endif + #if __BSD_VISIBLE void tzsetwall(void); time_t timelocal(struct tm *); |