From 792c8bcff2d1f9102408f86edb057f158b2b5090 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Wed, 20 Jul 2011 19:41:15 +0000 Subject: [PATCH] * libc/include/time.h [_POSIX_CLOCK_SELECTION] (clock_nanosleep): Declare. * libc/include/sys/features.h [__CYGWIN__] (_POSIX_CLOCK_SELECTION): Define. --- newlib/ChangeLog | 7 +++++++ newlib/libc/include/sys/features.h | 2 +- newlib/libc/include/time.h | 16 ++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 31ea045d9..8febaee23 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,10 @@ +2011-07-20 Yaakov Selkowitz + + * libc/include/time.h [_POSIX_CLOCK_SELECTION] (clock_nanosleep): + Declare. + * libc/include/sys/features.h [__CYGWIN__] (_POSIX_CLOCK_SELECTION): + Define. + 2011-07-19 Yaakov Selkowitz * libc/include/sys/unistd.h (_CS_XBS5_WIDTH_RESTRICTED_ENVS): Define. diff --git a/newlib/libc/include/sys/features.h b/newlib/libc/include/sys/features.h index 5de4bbbe8..e7f9c65dd 100644 --- a/newlib/libc/include/sys/features.h +++ b/newlib/libc/include/sys/features.h @@ -102,7 +102,7 @@ extern "C" { /* #define _POSIX_ASYNCHRONOUS_IO -1 */ /* #define _POSIX_BARRIERS -1 */ #define _POSIX_CHOWN_RESTRICTED 1 -/* #define _POSIX_CLOCK_SELECTION -1 */ +#define _POSIX_CLOCK_SELECTION 200112L #define _POSIX_CPUTIME 200112L #define _POSIX_FSYNC 200112L #define _POSIX_IPV6 200112L diff --git a/newlib/libc/include/time.h b/newlib/libc/include/time.h index 7d3b2abd3..306bad619 100644 --- a/newlib/libc/include/time.h +++ b/newlib/libc/include/time.h @@ -175,6 +175,22 @@ int _EXFUN(nanosleep, (const struct timespec *rqtp, struct timespec *rmtp)); #endif #endif /* _POSIX_TIMERS */ +#if defined(_POSIX_CLOCK_SELECTION) + +#ifdef __cplusplus +extern "C" { +#endif + +int _EXFUN(clock_nanosleep, + (clockid_t clock_id, int flags, const struct timespec *rqtp, + struct timespec *rmtp)); + +#ifdef __cplusplus +} +#endif + +#endif /* _POSIX_CLOCK_SELECTION */ + #ifdef __cplusplus extern "C" { #endif