wrappers.h 845 B

1234567891011121314151617181920212223242526272829303132333435
  1. // SPDX-License-Identifier: GPL-2.0
  2. #include <linux/nsfs.h>
  3. #include <linux/types.h>
  4. #include <sys/syscall.h>
  5. #include <unistd.h>
  6. #ifndef __SELFTESTS_NAMESPACES_WRAPPERS_H__
  7. #define __SELFTESTS_NAMESPACES_WRAPPERS_H__
  8. #ifndef __NR_listns
  9. #if defined __alpha__
  10. #define __NR_listns 580
  11. #elif defined _MIPS_SIM
  12. #if _MIPS_SIM == _MIPS_SIM_ABI32 /* o32 */
  13. #define __NR_listns 4470
  14. #endif
  15. #if _MIPS_SIM == _MIPS_SIM_NABI32 /* n32 */
  16. #define __NR_listns 6470
  17. #endif
  18. #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */
  19. #define __NR_listns 5470
  20. #endif
  21. #else
  22. #define __NR_listns 470
  23. #endif
  24. #endif
  25. static inline int sys_listns(const struct ns_id_req *req, __u64 *ns_ids,
  26. size_t nr_ns_ids, unsigned int flags)
  27. {
  28. return syscall(__NR_listns, req, ns_ids, nr_ns_ids, flags);
  29. }
  30. #endif /* __SELFTESTS_NAMESPACES_WRAPPERS_H__ */