diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1999-11-16 16:15:05 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1999-11-16 16:15:05 +0000 |
commit | a20190a40848e6322fe9a0a4eee9a5cdf6ae871e (patch) | |
tree | a60cd9e7b9ff3fd3a20524fa0ed641e70f484dad /testsuites/psxtests/psx01/init.c | |
parent | Web server uses the POSIX API. Therefor, it must be disabled when the (diff) | |
download | rtems-a20190a40848e6322fe9a0a4eee9a5cdf6ae871e.tar.bz2 |
Added test cases for uname().
Diffstat (limited to 'testsuites/psxtests/psx01/init.c')
-rw-r--r-- | testsuites/psxtests/psx01/init.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/testsuites/psxtests/psx01/init.c b/testsuites/psxtests/psx01/init.c index a2101a5f16..2d82fb472e 100644 --- a/testsuites/psxtests/psx01/init.c +++ b/testsuites/psxtests/psx01/init.c @@ -13,6 +13,7 @@ #define CONFIGURE_INIT #include "system.h" #include <sched.h> +#include <sys/utsname.h> void *POSIX_Init( void *argument @@ -27,11 +28,28 @@ void *POSIX_Init( time_t seconds1; time_t remaining; struct tm tm; + struct utsname uts; puts( "\n\n*** POSIX TEST 1 ***" ); build_time( &tm, TM_FRIDAY, TM_MAY, 24, 96, 11, 5, 0 ); + /* print some system information */ + + puts( "Init: uname - EFAULT (invalid uts pointer argument)" ); + status = uname( NULL ); + assert( status == -1 ); + assert( errno == EFAULT ); + + status = uname( &uts ); + assert( !status ); + printf( "Init: uts.sysname: %s\n", uts.sysname ); + printf( "Init: uts.nodename: %s\n", uts.nodename ); + printf( "Init: uts.release: %s\n", uts.release ); + printf( "Init: uts.version: %s\n", uts.version ); + printf( "Init: uts.machine: %s\n", uts.machine ); + puts(""); + /* error cases in clock_gettime and clock_settime */ puts( "Init: clock_gettime - EINVAL (invalid clockid)" ); |