• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include "tests.h"
2 #include <asm/unistd.h>
3 
4 #ifdef __NR_uname
5 
6 # include <stdio.h>
7 # include <sys/utsname.h>
8 # include <unistd.h>
9 
main(int ac,char ** av)10 int main(int ac, char **av)
11 {
12 	int abbrev = ac > 1;
13 	TAIL_ALLOC_OBJECT_CONST_PTR(struct utsname, uname);
14 	int rc = syscall(__NR_uname, uname);
15 	printf("uname({sysname=");
16 	print_quoted_string(uname->sysname);
17 	printf(", nodename=");
18 	print_quoted_string(uname->nodename);
19 	if (abbrev) {
20 		printf(", ...");
21 	} else {
22 		printf(", release=");
23 		print_quoted_string(uname->release);
24 		printf(", version=");
25 		print_quoted_string(uname->version);
26 		printf(", machine=");
27 		print_quoted_string(uname->machine);
28 # ifdef HAVE_STRUCT_UTSNAME_DOMAINNAME
29 		printf(", domainname=");
30 		print_quoted_string(uname->domainname);
31 # endif
32 	}
33 	printf("}) = %d\n", rc);
34 
35 	puts("+++ exited with 0 +++");
36 	return 0;
37 }
38 
39 #else
40 
41 SKIP_MAIN_UNDEFINED("__NR_uname")
42 
43 #endif
44