change log for rtems (2011-05-16)

rtems-vc at rtems.org rtems-vc at rtems.org
Mon May 16 14:11:18 UTC 2011


 *ralf*:
2011-05-16	Ralf Corsépius <ralf.corsepius at 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.

M   1.88  cpukit/posix/Makefile.am
M   1.12  cpukit/posix/src/clockgetres.c
M   1.15  cpukit/posix/src/clockgettime.c
M   1.11  cpukit/posix/src/clocksettime.c
A    1.1  cpukit/posix/src/posixtime.h

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
@@ -16,6 +16,7 @@
 # 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
+libposix_a_SOURCES += src/posixtime.h
 
 include_rtems_posixdir = $(includedir)/rtems/posix
 

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
@@ -28,6 +28,8 @@
 
 #include <rtems/seterr.h>
 
+#include "posixtime.h"
+
 /*PAGE
  *
  *  14.2.1 Clocks, P1003.1b-1993, p. 263
@@ -48,8 +50,8 @@
      */
 
     case CLOCK_REALTIME:
-    case CLOCK_PROCESS_CPUTIME:
-    case CLOCK_THREAD_CPUTIME:
+    case CLOCK_PROCESS_CPUTIME_ID:
+    case CLOCK_THREAD_CPUTIME_ID:
       if ( res ) {
         res->tv_sec = rtems_configuration_get_microseconds_per_tick() /
             TOD_MICROSECONDS_PER_SECOND;

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
@@ -23,6 +23,8 @@
 
 #include <rtems/seterr.h>
 
+#include "posixtime.h"
+
 /*PAGE
  *
  *  14.2.1 Clocks, P1003.1b-1993, p. 263
@@ -48,14 +50,14 @@
 #endif
 
 #ifdef _POSIX_CPUTIME
-  if ( clock_id == CLOCK_PROCESS_CPUTIME ) {
+  if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) {
     _TOD_Get_uptime_as_timespec( tp );
     return 0;
   }
 #endif
 
 #ifdef _POSIX_THREAD_CPUTIME
-  if ( clock_id == CLOCK_THREAD_CPUTIME )
+  if ( clock_id == CLOCK_THREAD_CPUTIME_ID )
     rtems_set_errno_and_return_minus_one( ENOSYS );
 #endif
 

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
@@ -23,6 +23,8 @@
 
 #include <rtems/seterr.h>
 
+#include "posixtime.h"
+
 /*PAGE
  *
  *  14.2.1 Clocks, P1003.1b-1993, p. 263
@@ -45,11 +47,11 @@
     _Thread_Enable_dispatch();
   }
 #ifdef _POSIX_CPUTIME
-  else if ( clock_id == CLOCK_PROCESS_CPUTIME )
+  else if ( clock_id == CLOCK_PROCESS_CPUTIME_ID )
     rtems_set_errno_and_return_minus_one( ENOSYS );
 #endif
 #ifdef _POSIX_THREAD_CPUTIME
-  else if ( clock_id == CLOCK_THREAD_CPUTIME )
+  else if ( clock_id == CLOCK_THREAD_CPUTIME_ID )
     rtems_set_errno_and_return_minus_one( ENOSYS );
 #endif
   else

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
@@ -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



--

Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20110516/eb15f98e/attachment-0001.html>


More information about the vc mailing list