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 
14 #ifdef __NR_prctl
15 #define __NR___syscall_prctl	__NR_prctl
16 static inline _syscall5(int, __syscall_prctl, int, option, long, arg2,
17 		long, arg3, long, arg4, long, arg5);
18 
prctl(int __option,...)19 int prctl(int __option, ...)
20 {
21 	long arg2;
22 	long arg3;
23 	long arg4;
24 	long arg5;
25 	va_list ap;
26 
27 	va_start(ap, __option);
28 	arg2 = va_arg(ap, long);
29 	arg3 = va_arg(ap, long);
30 	arg4 = va_arg(ap, long);
31 	arg5 = va_arg(ap, long);
32 	va_end(ap);
33 
34 	return INLINE_SYSCALL(prctl, 5, __option, arg2, arg3, arg4, arg5);
35 }
36 #endif
37