sched.h 850 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* SPDX-License-Identifier: LGPL-2.1 OR MIT */
  2. /*
  3. * sched function definitions for NOLIBC
  4. * Copyright (C) 2025 Thomas Weißschuh <linux@weissschuh.net>
  5. */
  6. /* make sure to include all global symbols */
  7. #include "nolibc.h"
  8. #ifndef _NOLIBC_SCHED_H
  9. #define _NOLIBC_SCHED_H
  10. #include "sys.h"
  11. #include <linux/sched.h>
  12. /*
  13. * int setns(int fd, int nstype);
  14. */
  15. static __attribute__((unused))
  16. int sys_setns(int fd, int nstype)
  17. {
  18. return my_syscall2(__NR_setns, fd, nstype);
  19. }
  20. static __attribute__((unused))
  21. int setns(int fd, int nstype)
  22. {
  23. return __sysret(sys_setns(fd, nstype));
  24. }
  25. /*
  26. * int unshare(int flags);
  27. */
  28. static __attribute__((unused))
  29. int sys_unshare(int flags)
  30. {
  31. return my_syscall1(__NR_unshare, flags);
  32. }
  33. static __attribute__((unused))
  34. int unshare(int flags)
  35. {
  36. return __sysret(sys_unshare(flags));
  37. }
  38. #endif /* _NOLIBC_SCHED_H */