This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Add CLOCK_MONOTONIC for RTEMS
- From: Joel Sherrill <joel dot sherrill at oarcorp dot com>
- To: "newlib at sources dot redhat dot com" <newlib at sources dot redhat dot com>
- Date: Thu, 16 Oct 2008 15:40:14 -0500
- Subject: Add CLOCK_MONOTONIC for RTEMS
Hi,
The attached patch adds CLOCK_MONOTONIC support
for RTEMS.
2008-10-16 Joel Sherrill <joel.sherrill@oarcorp.com>
* libc/include/time.h: Add CLOCK_MONOTONIC.
* libc/include/sys/features.h: Define
_POSIX_MONOTONIC_CLOCK for RTEMS.
Patch attached.
Thanks.
--
Joel Sherrill, Ph.D. Director of Research & Development
joel.sherrill@OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985
Index: libc/include/time.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/time.h,v
retrieving revision 1.18
diff -u -r1.18 time.h
--- libc/include/time.h 18 Nov 2005 15:57:24 -0000 1.18
+++ libc/include/time.h 16 Oct 2008 20:31:53 -0000
@@ -226,6 +226,16 @@
#endif
+#if defined(_POSIX_MONOTONIC_CLOCK)
+
+/* The identifier for the system-wide monotonic clock, which is defined
+ * as a clock whose value cannot be set via clock_settime() and which
+ * cannot have backward clock jumps. */
+
+#define CLOCK_MONOTONIC (clockid_t)4
+
+#endif
+
#if defined(_POSIX_CPUTIME)
/* Accessing a Process CPU-time CLock, P1003.4b/D8, p. 55 */
Index: libc/include/sys/features.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/sys/features.h,v
retrieving revision 1.13
diff -u -r1.13 features.h
--- libc/include/sys/features.h 19 Dec 2007 18:51:19 -0000 1.13
+++ libc/include/sys/features.h 16 Oct 2008 20:31:53 -0000
@@ -38,6 +38,7 @@
#define _POSIX_MEMLOCK_RANGE 1
#define _POSIX_MEMORY_PROTECTION 1
#define _POSIX_MESSAGE_PASSING 1
+#define _POSIX_MONOTONIC_CLOCK 1
#define _POSIX_PRIORITIZED_IO 1
#define _POSIX_PRIORITY_SCHEDULING 1
#define _POSIX_REALTIME_SIGNALS 1