<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>change log for rtems (2011-05-16)</title>
</head>
<body text='#000000' bgcolor='#ffffff'>
<a name='cs1'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
<font color='#bb2222'><strong>ralf</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2011-05-16 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.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/Makefile.am.diff?r1=text&tr1=1.87&r2=text&tr2=1.88&diff_format=h">M</a></td><td width='1%'>1.88</td><td width='100%'>cpukit/posix/Makefile.am</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/src/clockgetres.c.diff?r1=text&tr1=1.11&r2=text&tr2=1.12&diff_format=h">M</a></td><td width='1%'>1.12</td><td width='100%'>cpukit/posix/src/clockgetres.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/src/clockgettime.c.diff?r1=text&tr1=1.14&r2=text&tr2=1.15&diff_format=h">M</a></td><td width='1%'>1.15</td><td width='100%'>cpukit/posix/src/clockgettime.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/src/clocksettime.c.diff?r1=text&tr1=1.10&r2=text&tr2=1.11&diff_format=h">M</a></td><td width='1%'>1.11</td><td width='100%'>cpukit/posix/src/clocksettime.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/src/posixtime.h?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">cpukit/posix/src/posixtime.h</font></td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/cpukit/posix/Makefile.am:1.87 rtems/cpukit/posix/Makefile.am:1.88
--- rtems/cpukit/posix/Makefile.am:1.87 Fri Feb 25 04:20:02 2011
+++ rtems/cpukit/posix/Makefile.am Mon May 16 08:55:17 2011
</font><font color='#997700'>@@ -16,6 +16,7 @@
</font> # Some POSIX functions that are nice to always have
libposix_a_SOURCES += src/nanosleep.c src/clockgettime.c src/clocksettime.c \
src/clockgetres.c src/sysconf.c
<font color='#000088'>+libposix_a_SOURCES += src/posixtime.h
</font>
include_rtems_posixdir = $(includedir)/rtems/posix
<font color='#006600'>diff -u rtems/cpukit/posix/src/clockgetres.c:1.11 rtems/cpukit/posix/src/clockgetres.c:1.12
--- rtems/cpukit/posix/src/clockgetres.c:1.11 Mon Nov 30 09:44:20 2009
+++ rtems/cpukit/posix/src/clockgetres.c Mon May 16 08:55:17 2011
</font><font color='#997700'>@@ -28,6 +28,8 @@
</font>
#include <rtems/seterr.h>
<font color='#000088'>+#include "posixtime.h"
+
</font> /*PAGE
*
* 14.2.1 Clocks, P1003.1b-1993, p. 263
<font color='#997700'>@@ -48,8 +50,8 @@
</font> */
case CLOCK_REALTIME:
<font color='#880000'>- case CLOCK_PROCESS_CPUTIME:
- case CLOCK_THREAD_CPUTIME:
</font><font color='#000088'>+ case CLOCK_PROCESS_CPUTIME_ID:
+ case CLOCK_THREAD_CPUTIME_ID:
</font> if ( res ) {
res->tv_sec = rtems_configuration_get_microseconds_per_tick() /
TOD_MICROSECONDS_PER_SECOND;
<font color='#006600'>diff -u rtems/cpukit/posix/src/clockgettime.c:1.14 rtems/cpukit/posix/src/clockgettime.c:1.15
--- rtems/cpukit/posix/src/clockgettime.c:1.14 Mon Nov 30 09:44:20 2009
+++ rtems/cpukit/posix/src/clockgettime.c Mon May 16 08:55:17 2011
</font><font color='#997700'>@@ -23,6 +23,8 @@
</font>
#include <rtems/seterr.h>
<font color='#000088'>+#include "posixtime.h"
+
</font> /*PAGE
*
* 14.2.1 Clocks, P1003.1b-1993, p. 263
<font color='#997700'>@@ -48,14 +50,14 @@
</font> #endif
#ifdef _POSIX_CPUTIME
<font color='#880000'>- if ( clock_id == CLOCK_PROCESS_CPUTIME ) {
</font><font color='#000088'>+ if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) {
</font> _TOD_Get_uptime_as_timespec( tp );
return 0;
}
#endif
#ifdef _POSIX_THREAD_CPUTIME
<font color='#880000'>- if ( clock_id == CLOCK_THREAD_CPUTIME )
</font><font color='#000088'>+ if ( clock_id == CLOCK_THREAD_CPUTIME_ID )
</font> rtems_set_errno_and_return_minus_one( ENOSYS );
#endif
<font color='#006600'>diff -u rtems/cpukit/posix/src/clocksettime.c:1.10 rtems/cpukit/posix/src/clocksettime.c:1.11
--- rtems/cpukit/posix/src/clocksettime.c:1.10 Thu Jan 31 18:44:15 2008
+++ rtems/cpukit/posix/src/clocksettime.c Mon May 16 09:09:37 2011
</font><font color='#997700'>@@ -23,6 +23,8 @@
</font>
#include <rtems/seterr.h>
<font color='#000088'>+#include "posixtime.h"
+
</font> /*PAGE
*
* 14.2.1 Clocks, P1003.1b-1993, p. 263
<font color='#997700'>@@ -45,11 +47,11 @@
</font> _Thread_Enable_dispatch();
}
#ifdef _POSIX_CPUTIME
<font color='#880000'>- else if ( clock_id == CLOCK_PROCESS_CPUTIME )
</font><font color='#000088'>+ else if ( clock_id == CLOCK_PROCESS_CPUTIME_ID )
</font> rtems_set_errno_and_return_minus_one( ENOSYS );
#endif
#ifdef _POSIX_THREAD_CPUTIME
<font color='#880000'>- else if ( clock_id == CLOCK_THREAD_CPUTIME )
</font><font color='#000088'>+ else if ( clock_id == CLOCK_THREAD_CPUTIME_ID )
</font> rtems_set_errno_and_return_minus_one( ENOSYS );
#endif
else
<font color='#006600'>diff -u /dev/null rtems/cpukit/posix/src/posixtime.h:1.1
--- /dev/null Mon May 16 09:11:18 2011
+++ rtems/cpukit/posix/src/posixtime.h Mon May 16 08:55:17 2011
</font><font color='#997700'>@@ -0,0 +1,36 @@
</font><font color='#000088'>+/*
+ * 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$
+ */
+
+/*<span style="background-color: #FF0000"> </span>
+ * 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<span style="background-color: #FF0000"> </span>
+ 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
</font></pre>
<p> </p>
<p>--<br />
<small>Generated by <a href="http://www.codewiz.org/projects/index.html#loginfo">Deluxe Loginfo</a> 2.122 by Bernardo Innocenti <bernie@develer.com></small></p>
</body>
</html>