From b410ca18c469660486f11c036c93a052aee59624 Mon Sep 17 00:00:00 2001 From: cuz Date: Tue, 12 Aug 2003 17:32:16 +0000 Subject: [PATCH] New file uname-test.c git-svn-id: svn://svn.cc65.org/cc65/trunk@2287 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- testcode/lib/files.txt | 1 + testcode/lib/uname-test.c | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 testcode/lib/uname-test.c diff --git a/testcode/lib/files.txt b/testcode/lib/files.txt index 232fbb2ad..f7623eaf4 100644 --- a/testcode/lib/files.txt +++ b/testcode/lib/files.txt @@ -16,3 +16,4 @@ posixio-test.c - test POSIX file i/o routines (open/read/write/close) seek.c - test lseek()/fseek()/ftell() signal-test.c - small test program for signal/raise time-test.c - test the time/mktime/gmtime/asctime functions +uname-test.c - test the uname function diff --git a/testcode/lib/uname-test.c b/testcode/lib/uname-test.c new file mode 100644 index 000000000..b0733d0bd --- /dev/null +++ b/testcode/lib/uname-test.c @@ -0,0 +1,26 @@ +#include +#include +#include + + +int main (void) +{ + /* Get the uname data */ + struct utsname buf; + if (uname (&buf) != 0) { + perror ("uname"); + return EXIT_FAILURE; + } + + /* Print it */ + printf ("sysname: \"%s\"\n", buf.sysname); + printf ("nodename: \"%s\"\n", buf.nodename); + printf ("release: \"%s\"\n", buf.release); + printf ("version: \"%s\"\n", buf.version); + printf ("machine: \"%s\"\n", buf.machine); + + /* Done */ + return EXIT_SUCCESS; +} + + -- 2.39.5