change log for rtems (2010-08-24)

rtems-vc at rtems.org rtems-vc at rtems.org
Tue Aug 24 06:10:32 UTC 2010


 *ralf*:
2010-09-24	Ralf Corsépius <ralf.corsepius at rtems.org>

	* libcsupport/include/sys/utsname.h: Remove times().
	Remove unnecessary includes.
	Introduce SYS_NMLN (From freebsd).
	* libcsupport/src/utsname.c: Rework uname().

M 1.2586  cpukit/ChangeLog
M    1.6  cpukit/libcsupport/include/sys/utsname.h
M   1.18  cpukit/libcsupport/src/utsname.c

diff -u rtems/cpukit/ChangeLog:1.2585 rtems/cpukit/ChangeLog:1.2586
--- rtems/cpukit/ChangeLog:1.2585	Mon Aug 23 18:19:30 2010
+++ rtems/cpukit/ChangeLog	Tue Aug 24 00:51:51 2010
@@ -1,3 +1,10 @@
+2010-09-24	Ralf Corsépius <ralf.corsepius at rtems.org>
+
+	* libcsupport/include/sys/utsname.h: Remove times().
+	Remove unnecessary includes.
+	Introduce SYS_NMLN (From freebsd).
+	* libcsupport/src/utsname.c: Rework uname().
+
 2010-08-23	Joel Sherrill <joel.sherrill at oarcorp.com>
 
 	* libcsupport/src/read.c, libcsupport/src/write.c: Remove redundant

diff -u rtems/cpukit/libcsupport/include/sys/utsname.h:1.5 rtems/cpukit/libcsupport/include/sys/utsname.h:1.6
--- rtems/cpukit/libcsupport/include/sys/utsname.h:1.5	Sun Apr 18 01:05:34 2004
+++ rtems/cpukit/libcsupport/include/sys/utsname.h	Tue Aug 24 00:51:51 2010
@@ -10,9 +10,6 @@
 extern "C" {
 #endif
 
-#include <sys/times.h>
-#include <sys/types.h>
-
 /*
  *  4.4.1 Get System Name (Table 4-1), P1003.1b-1993, p. 90
  *
@@ -22,14 +19,22 @@
  *         Internet hostnames.
  */
 
+#ifdef _KERNEL
+#define SYS_NMLN        32              /* uname(2) for the FreeBSD 1.1 ABI. */
+#endif
+
+#ifndef SYS_NMLN
+#define SYS_NMLN        32		/* User can override. */
+#endif
+
 struct utsname {
-  char sysname[ 32 ];  /* Name of this implementation of the operating system */
-  char nodename[ 32 ]; /* Name of this node within an implementation */
-                       /*   specified communication network */
-  char release[ 32 ];  /* Current release level of this implementation */
-  char version[ 32 ];  /* Current version level of this release */
-  char machine[ 32 ];  /* Name of the hardware type on which the system */
-                       /*   is running */
+  char sysname[SYS_NMLN];  /* Name of this implementation of the operating system */
+  char nodename[SYS_NMLN]; /* Name of this node within an implementation */
+                           /*   specified communication network */
+  char release[SYS_NMLN];  /* Current release level of this implementation */
+  char version[SYS_NMLN];  /* Current version level of this release */
+  char machine[SYS_NMLN];  /* Name of the hardware type on which the system */
+                           /*   is running */
 };
 
 /*
@@ -40,14 +45,6 @@
   struct utsname *name
 );
 
-/*
- *  4.5.2 Get Process Times, P1003.1b-1993, p. 92
- */
-
-clock_t times(
-  struct tms   *buffer
-);
-
 #ifdef __cplusplus
 }
 #endif

diff -u rtems/cpukit/libcsupport/src/utsname.c:1.17 rtems/cpukit/libcsupport/src/utsname.c:1.18
--- rtems/cpukit/libcsupport/src/utsname.c:1.17	Wed Aug 30 08:18:38 2006
+++ rtems/cpukit/libcsupport/src/utsname.c	Tue Aug 24 00:51:51 2010
@@ -8,15 +8,11 @@
 
 #include <stdio.h>
 #include <string.h>
-
-#include <errno.h>
 #include <sys/utsname.h>
-
+#include <inttypes.h>
 
 #include <rtems/system.h>
 #include <rtems/score/object.h>
-#include <inttypes.h>
-
 #include <rtems/seterr.h>
 
 /*PAGE
@@ -39,15 +35,15 @@
   if ( !name )
     rtems_set_errno_and_return_minus_one( EFAULT );
 
-  strcpy( name->sysname, "RTEMS" );
+  strncpy( name->sysname, "RTEMS", sizeof(name->sysname) );
 
-  sprintf( name->nodename, "Node %" PRId16, _Objects_Local_node );
+  snprintf( name->nodename, sizeof(name->nodename), "Node %" PRId16, _Objects_Local_node );
 
-  strcpy( name->release, RTEMS_VERSION );
+  strncpy( name->release, RTEMS_VERSION, sizeof(name->release) );
 
-  strcpy( name->version, "" );
+  strncpy( name->version, "", sizeof(name->version) );
 
-  sprintf( name->machine, "%s/%s", CPU_NAME, CPU_MODEL_NAME );
+  snprintf( name->machine, sizeof(name->machine), "%s/%s", CPU_NAME, CPU_MODEL_NAME );
 
   return 0;
 }



--

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/20100824/2a9db2c8/attachment.html>


More information about the vc mailing list