mirror of
https://github.com/cc65/cc65.git
synced 2024-12-21 20:29:24 +00:00
New file uname-test.c
git-svn-id: svn://svn.cc65.org/cc65/trunk@2287 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
4e76d0155d
commit
b410ca18c4
@ -16,3 +16,4 @@ posixio-test.c - test POSIX file i/o routines (open/read/write/close)
|
|||||||
seek.c - test lseek()/fseek()/ftell()
|
seek.c - test lseek()/fseek()/ftell()
|
||||||
signal-test.c - small test program for signal/raise
|
signal-test.c - small test program for signal/raise
|
||||||
time-test.c - test the time/mktime/gmtime/asctime functions
|
time-test.c - test the time/mktime/gmtime/asctime functions
|
||||||
|
uname-test.c - test the uname function
|
||||||
|
26
testcode/lib/uname-test.c
Normal file
26
testcode/lib/uname-test.c
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <sys/utsname.h>
|
||||||
|
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user