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 10 int main(int ac, char **av) 11 { 12 int abbrev = ac > 1; 13 struct utsname *const uname = tail_alloc(sizeof(struct utsname)); 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 printf("\""); 33 } 34 printf("}) = %d\n", rc); 35 36 puts("+++ exited with 0 +++"); 37 return 0; 38 } 39 40 #else 41 42 SKIP_MAIN_UNDEFINED("__NR_uname") 43 44 #endif 45