uname.c 555 B

12345678910111213141516171819
  1. #include <stdio.h>
  2. #include <sys/utsname.h>
  3. #include "test_helpers.h"
  4. int main(void) {
  5. struct utsname system_info;
  6. int result = uname(&system_info);
  7. ERROR_IF(uname, result, == -1);
  8. UNEXP_IF(uname, result, < 0);
  9. printf("sysname: '%s'\n", system_info.sysname);
  10. printf("nodename: '%s'\n", system_info.nodename);
  11. printf("release: '%s'\n", system_info.release);
  12. printf("version: '%s'\n", system_info.version);
  13. printf("machine: '%s'\n", system_info.machine);
  14. //printf("domainname: '%s'\n", system_info.domainname);
  15. }