prctl.c 821 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * prctl syscall for AVR32 Linux.
  3. *
  4. * Copyright (C) 2010 Atmel Corporation
  5. *
  6. * This file is subject to the terms and conditions of the GNU Lesser General
  7. * Public License. See the file "COPYING.LIB" in the main directory of this
  8. * archive for more details.
  9. */
  10. #include <sys/syscall.h>
  11. #include <sys/prctl.h>
  12. #include <stdarg.h>
  13. #ifdef __NR_prctl
  14. #define __NR___syscall_prctl __NR_prctl
  15. static inline _syscall5(int, __syscall_prctl, int, option, long, arg2,
  16. long, arg3, long, arg4, long, arg5);
  17. int prctl(int __option, ...)
  18. {
  19. long arg2;
  20. long arg3;
  21. long arg4;
  22. long arg5;
  23. va_list ap;
  24. va_start(ap, __option);
  25. arg2 = va_arg(ap, long);
  26. arg3 = va_arg(ap, long);
  27. arg4 = va_arg(ap, long);
  28. arg5 = va_arg(ap, long);
  29. va_end(ap);
  30. return INLINE_SYSCALL(prctl, 5, __option, arg2, arg3, arg4, arg5);
  31. }
  32. #endif