4 #include <stdio.h> /* printf() */
5 #include <unistd.h> /* syscall() */
6 #include <sys/syscall.h> /* __NR_capget */
7 #include <sys/types.h> /* uid_t */
8 #include <linux/capability.h> /* _LINUX_CAPABILITY_VERSION */
13 struct __user_cap_header_struct h;
14 struct __user_cap_data_struct d;
18 fprintf(stderr, "Running as root\n");
19 h.version = _LINUX_CAPABILITY_VERSION;
21 syscall_result = syscall(__NR_capget, &h, &d);
22 if (syscall_result >= 0)
48 fprintf(stderr, "This program is Linux-specific\n");