tst-syscall1.c 300 B

123456789101112131415161718
  1. #include <stdio.h>
  2. #include <unistd.h>
  3. #include <sys/syscall.h>
  4. #include <sys/utsname.h>
  5. int main() {
  6. int ret;
  7. struct utsname name;
  8. ret = syscall(SYS_uname, &name);
  9. if (ret == 0) {
  10. printf("syscall(SYS_uname) says %s-%s\n", name.sysname,
  11. name.release);
  12. return 0;
  13. }
  14. return 1;
  15. }