summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/posixtime.h
diff options
context:
space:
mode:
authorRalf Corsepius <ralf.corsepius@rtems.org>2011-05-19 15:32:44 +0000
committerRalf Corsepius <ralf.corsepius@rtems.org>2011-05-19 15:32:44 +0000
commit3af56998047dccb0654461f92224b10f19a7f6cc (patch)
tree0144e4b811f98a2b5973ec3ba77e0ac4d83faf91 /cpukit/posix/src/posixtime.h
parent2011-05-18 Till Straumann <strauman@slac.stanford.edu> (diff)
downloadrtems-3af56998047dccb0654461f92224b10f19a7f6cc.tar.bz2
2011-05-19 Ralf Corsépius <ralf.corsepius@rtems.org>
* posix/Makefile.am: Add posixtime.h. * posix/src/clockgetres.c, posix/src/clockgettime.c, posix/src/clocksettime.c: Use CLOCK_PROCESS_CPUTIME_ID, CLOCK_THREAD_CPUTIME_ID. Include posix/src/posixtime.h. * posix/src/posixtime.h: New.
Diffstat (limited to '')
-rw-r--r--cpukit/posix/src/posixtime.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/cpukit/posix/src/posixtime.h b/cpukit/posix/src/posixtime.h
new file mode 100644
index 0000000000..bc28d60684
--- /dev/null
+++ b/cpukit/posix/src/posixtime.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2011.
+ * Ralf Corsépius, Ulm/Germany.
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+/*
+ * Adapt RTEMS to newlibs with broken
+ * CLOCK_PROCESS_CPUTIME_ID/CLOCK_PROCESS_CPUTIME
+ * CLOCK_THREAD_CPUTIME_ID/CLOCK_THREAD_CPUTIME
+ */
+
+#ifndef _SRC_POSIX_POSIXTIME_H
+#define _SRC_POSIX_POSIXTIME_H
+
+#include <time.h>
+
+#ifdef RTEMS_NEWLIB
+/* Older newlibs bogusly used CLOCK_PROCESS_CPUTIME
+ instead of CLOCK_PROCESS_CPUTIME_ID */
+#ifndef CLOCK_PROCESS_CPUTIME_ID
+#define CLOCK_PROCESS_CPUTIME_ID CLOCK_PROCESS_CPUTIME
+#endif
+/* Older newlibs bogusly used CLOCK_THREAD_CPUTIME
+ instead of CLOCK_PROCESS_CPUTIME_ID */
+#ifndef CLOCK_THREAD_CPUTIME_ID
+#define CLOCK_THREAD_CPUTIME_ID CLOCK_THREAD_CPUTIME
+#endif
+#endif
+
+#endif