diff options
author | Rich Felker <dalias@aerifal.cx> | 2014-03-18 17:08:15 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2014-03-18 17:08:15 -0400 |
commit | 5f95f965e933c5b155db75520ac27c92ddbcf400 (patch) | |
tree | 140ae575d4a3ed1ff3767c44368f71331aeb9f08 | |
parent | f162c064ab71dc3631abd8db9e53099a1c80b9cf (diff) | |
download | musl-5f95f965e933c5b155db75520ac27c92ddbcf400.tar.gz musl-5f95f965e933c5b155db75520ac27c92ddbcf400.tar.xz musl-5f95f965e933c5b155db75520ac27c92ddbcf400.zip |
use syscall_arg_t for arguments in public syscall() function
on x32, this change allows programs which use syscall() with pointers or 64-bit values as arguments to work correctly, i.e. without truncation or incorrect sign extension. on all other supported archs, syscall_arg_t is defined as long, so this change is a no-op.
-rw-r--r-- | src/misc/syscall.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/misc/syscall.c b/src/misc/syscall.c index 15355609..9d435a97 100644 --- a/src/misc/syscall.c +++ b/src/misc/syscall.c @@ -6,14 +6,14 @@ long syscall(long n, ...) { va_list ap; - long a,b,c,d,e,f; + syscall_arg_t a,b,c,d,e,f; va_start(ap, n); - a=va_arg(ap, long); - b=va_arg(ap, long); - c=va_arg(ap, long); - d=va_arg(ap, long); - e=va_arg(ap, long); - f=va_arg(ap, long); + a=va_arg(ap, syscall_arg_t); + b=va_arg(ap, syscall_arg_t); + c=va_arg(ap, syscall_arg_t); + d=va_arg(ap, syscall_arg_t); + e=va_arg(ap, syscall_arg_t); + f=va_arg(ap, syscall_arg_t); va_end(ap); return __syscall_ret(__syscall(n,a,b,c,d,e,f)); } |