aboutsummaryrefslogtreecommitdiffstats
path: root/toolchain/uClibc/uClibc-0.9.30.1-fix-varargs-in-prctl-syscall.patch.avr32
blob: 8b27a84f76b13a56af219e4fbf17539e403065a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
--- a/libc/sysdeps/linux/common/prctl.c
+++ b/libc/sysdeps/linux/common/prctl.c
@@ -12,6 +12,24 @@
 /* psm: including sys/prctl.h would depend on kernel headers */
 
 #ifdef __NR_prctl
-extern int prctl (int, long, long, long, long);
-_syscall5(int, prctl, int, option, long, arg2, long, arg3, long, arg4, long, arg5)
+#define __NR___syscall_prctl	__NR_prctl
+static inline _syscall5(int, __syscall_prctl, int, option, long, arg2, long, arg3, long,
+		arg4, long, arg5);
+
+int prctl(int option, ...) {
+	long arg2 = 0;
+	long arg3 = 0;
+	long arg4 = 0;
+	long arg5 = 0;
+	va_list ap;
+
+	va_start(ap, option);
+	arg2 = va_arg(ap, long);
+	arg3 = va_arg(ap, long);
+	arg4 = va_arg(ap, long);
+	arg5 = va_arg(ap, long);
+	va_end(ap);
+
+	return __syscall_prctl(option, arg2, arg3, arg4, arg5);
+}
 #endif