summaryrefslogtreecommitdiffstats
path: root/c/src/exec
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1999-11-16 16:03:21 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1999-11-16 16:03:21 +0000
commit31473b7107617f08cea7d7efdf5e0cfc1dfa8e83 (patch)
treed474c80cdb50279d40f4ee8a9f25d21d259e4a3d /c/src/exec
parent165fe39ff2a08d0212da586a3e3802cdc69b0b1d (diff)
downloadrtems-31473b7107617f08cea7d7efdf5e0cfc1dfa8e83.tar.bz2
Works now.
Removed times() since the version in the C Library support code is fine.
Diffstat (limited to 'c/src/exec')
-rw-r--r--c/src/exec/libcsupport/src/utsname.c31
-rw-r--r--c/src/exec/posix/src/utsname.c31
2 files changed, 24 insertions, 38 deletions
diff --git a/c/src/exec/libcsupport/src/utsname.c b/c/src/exec/libcsupport/src/utsname.c
index 7cd9fae002..7da5f9380d 100644
--- a/c/src/exec/libcsupport/src/utsname.c
+++ b/c/src/exec/libcsupport/src/utsname.c
@@ -5,10 +5,15 @@
#include <stdio.h>
#include <string.h>
+#include <errno.h>
#include <sys/utsname.h>
+
#include <rtems/system.h>
#include <rtems/score/object.h>
+#include <rtems/sptables.h>
+
+#include <rtems/posix/seterr.h>
/*PAGE
*
@@ -27,30 +32,18 @@ int uname(
machine = sun4m
*/
+ if ( !name )
+ set_errno_and_return_minus_one( EFAULT );
+
strcpy( name->sysname, "RTEMS" );
- sprintf( name->nodename, "Node %d\n", _Objects_Local_node );
+ sprintf( name->nodename, "Node %d", _Objects_Local_node );
- /* XXX release string is in BAD format for this routine!!! */
- strcpy( name->release, "4.0.0+" );
-
- /* XXX does this have any meaning for RTEMS */
-
- strcpy( name->release, "" );
+ strcpy( name->release, RTEMS_VERSION );
+ strcpy( name->version, "" );
+
sprintf( name->machine, "%s/%s", CPU_NAME, CPU_MODEL_NAME );
return 0;
}
-
-/*PAGE
- *
- * 4.5.2 Get Process Times, P1003.1b-1993, p. 92
- */
-
-clock_t times(
- struct tms *buffer
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}
diff --git a/c/src/exec/posix/src/utsname.c b/c/src/exec/posix/src/utsname.c
index 7cd9fae002..7da5f9380d 100644
--- a/c/src/exec/posix/src/utsname.c
+++ b/c/src/exec/posix/src/utsname.c
@@ -5,10 +5,15 @@
#include <stdio.h>
#include <string.h>
+#include <errno.h>
#include <sys/utsname.h>
+
#include <rtems/system.h>
#include <rtems/score/object.h>
+#include <rtems/sptables.h>
+
+#include <rtems/posix/seterr.h>
/*PAGE
*
@@ -27,30 +32,18 @@ int uname(
machine = sun4m
*/
+ if ( !name )
+ set_errno_and_return_minus_one( EFAULT );
+
strcpy( name->sysname, "RTEMS" );
- sprintf( name->nodename, "Node %d\n", _Objects_Local_node );
+ sprintf( name->nodename, "Node %d", _Objects_Local_node );
- /* XXX release string is in BAD format for this routine!!! */
- strcpy( name->release, "4.0.0+" );
-
- /* XXX does this have any meaning for RTEMS */
-
- strcpy( name->release, "" );
+ strcpy( name->release, RTEMS_VERSION );
+ strcpy( name->version, "" );
+
sprintf( name->machine, "%s/%s", CPU_NAME, CPU_MODEL_NAME );
return 0;
}
-
-/*PAGE
- *
- * 4.5.2 Get Process Times, P1003.1b-1993, p. 92
- */
-
-clock_t times(
- struct tms *buffer
-)
-{
- return POSIX_NOT_IMPLEMENTED();
-}