Patchwork prctl: fix system call wrapper

login
register
mail settings
Submitter Baruch Siach
Date Oct. 18, 2013, 5:51 a.m.
Message ID <d298ab734af132385b1c9939f1051a9c3481b496.1382075479.git.baruch@tkos.co.il>
Download mbox | patch
Permalink /patch/284441/
State Accepted, archived
Headers show

Comments

Baruch Siach - Oct. 18, 2013, 5:51 a.m.
The argument names used in the prctl wrapper collide with the internal
variable names in syscall wrapper macros on some architecture. This
currently breaks xtensa. grep for '\b_a[0-9]' indicates that metag and
microblaze might also be affected.

Prefix argument names with '_prctl' to avoid collision.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
 libc/sysdeps/linux/common/prctl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
aldot - Nov. 6, 2013, 9:30 p.m.
On Fri, Oct 18, 2013 at 08:51:56AM +0300, Baruch Siach wrote:
>The argument names used in the prctl wrapper collide with the internal
>variable names in syscall wrapper macros on some architecture. This
>currently breaks xtensa. grep for '\b_a[0-9]' indicates that metag and
>microblaze might also be affected.
>
>Prefix argument names with '_prctl' to avoid collision.

not pretty but good enough as stop gap.

Applied, thanks!

Patch

diff --git a/libc/sysdeps/linux/common/prctl.c b/libc/sysdeps/linux/common/prctl.c
index 67732bb..5f29cdb 100644
--- a/libc/sysdeps/linux/common/prctl.c
+++ b/libc/sysdeps/linux/common/prctl.c
@@ -12,5 +12,6 @@ 
 
 #ifdef __NR_prctl
 int prctl (int, long, long, long, long);
-_syscall5(int, prctl, int, option, long, _a2, long, _a3, long, _a4, long, _a5)
+_syscall5(int, prctl, int, option, long, _prctl_a2, long, _prctl_a3,
+		long, _prctl_a4, long, _prctl_a5)
 #endif