prctl.h 904 B

123456789101112131415161718192021222324252627282930313233343536
  1. /* SPDX-License-Identifier: LGPL-2.1 OR MIT */
  2. /*
  3. * Prctl definitions for NOLIBC
  4. * Copyright (C) 2017-2021 Willy Tarreau <w@1wt.eu>
  5. */
  6. /* make sure to include all global symbols */
  7. #include "../nolibc.h"
  8. #ifndef _NOLIBC_SYS_PRCTL_H
  9. #define _NOLIBC_SYS_PRCTL_H
  10. #include "../sys.h"
  11. #include <linux/prctl.h>
  12. /*
  13. * int prctl(int option, unsigned long arg2, unsigned long arg3,
  14. * unsigned long arg4, unsigned long arg5);
  15. */
  16. static __attribute__((unused))
  17. int sys_prctl(int option, unsigned long arg2, unsigned long arg3,
  18. unsigned long arg4, unsigned long arg5)
  19. {
  20. return my_syscall5(__NR_prctl, option, arg2, arg3, arg4, arg5);
  21. }
  22. static __attribute__((unused))
  23. int prctl(int option, unsigned long arg2, unsigned long arg3,
  24. unsigned long arg4, unsigned long arg5)
  25. {
  26. return __sysret(sys_prctl(option, arg2, arg3, arg4, arg5));
  27. }
  28. #endif /* _NOLIBC_SYS_PRCTL_H */