This source file includes following definitions.
- main
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 #include <config.h>
20
21 #include <sys/utsname.h>
22
23 #include "signature.h"
24 SIGNATURE_CHECK (uname, int, (struct utsname *));
25
26 #include <stdio.h>
27 #include <string.h>
28
29 #include "macros.h"
30
31
32
33
34
35
36 int
37 main (int argc, char *argv[])
38 {
39 struct utsname buf;
40
41 memset (&buf, '?', sizeof (buf));
42
43 ASSERT (uname (&buf) >= 0);
44
45
46 ASSERT (strlen (buf.sysname) < sizeof (buf.sysname));
47 ASSERT (strlen (buf.nodename) < sizeof (buf.nodename));
48 ASSERT (strlen (buf.release) < sizeof (buf.release));
49 ASSERT (strlen (buf.version) < sizeof (buf.version));
50 ASSERT (strlen (buf.machine) < sizeof (buf.machine));
51
52 if (argc > 1)
53 {
54
55
56 printf ("uname -n = nodename = %s\n", buf.nodename);
57 printf ("uname -s = sysname = %s\n", buf.sysname);
58 printf ("uname -r = release = %s\n", buf.release);
59 printf ("uname -v = version = %s\n", buf.version);
60 printf ("uname -m = machine or cpu = %s\n", buf.machine);
61 }
62
63 return 0;
64 }