caps.h 549 B

12345678910111213141516171819202122232425262728
  1. #include <bits/types.h>
  2. #include <bits/caps.h>
  3. #include <syscall.h>
  4. #define LINUX_CAPABILITY_VERSION 0x20080522
  5. #define LINUX_CAPABILITY_U32S 2
  6. struct cap_header {
  7. uint32_t version;
  8. int pid;
  9. };
  10. struct cap_data {
  11. uint32_t effective;
  12. uint32_t permitted;
  13. uint32_t inheritable;
  14. };
  15. inline static long sys_capset(struct cap_header* ch, const struct cap_data* cd)
  16. {
  17. return syscall2(NR_capset, (long)ch, (long)cd);
  18. }
  19. inline static long sys_capget(struct cap_header* ch, struct cap_data* cd)
  20. {
  21. return syscall2(NR_capget, (long)ch, (long)cd);
  22. }