diff options
author | Alex Xu (Hello71) <alex_y_xu@yahoo.ca> | 2022-07-01 11:09:10 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2022-08-02 14:12:18 -0400 |
commit | 2404d9d643763e6eceafa9a1918925d80a84ad44 (patch) | |
tree | 9e0f6071d09800d83d78a8b27239b03279a258dc /src | |
parent | 46d1c7801bb509e1097e8fadbaf359367fa4ef0b (diff) | |
download | musl-2404d9d643763e6eceafa9a1918925d80a84ad44.tar.gz musl-2404d9d643763e6eceafa9a1918925d80a84ad44.tar.bz2 musl-2404d9d643763e6eceafa9a1918925d80a84ad44.tar.xz musl-2404d9d643763e6eceafa9a1918925d80a84ad44.zip |
use syscall_arg_t and __scc macro for arguments to __alt_socketcall
otherwise, pointer arguments are sign-extended on x32, resulting in
EFAULT.
Diffstat (limited to 'src')
-rw-r--r-- | src/internal/syscall.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/internal/syscall.h b/src/internal/syscall.h index 4f41e1dc..4a446157 100644 --- a/src/internal/syscall.h +++ b/src/internal/syscall.h @@ -58,7 +58,7 @@ hidden long __syscall_ret(unsigned long), #define __syscall_cp(...) __SYSCALL_DISP(__syscall_cp,__VA_ARGS__) #define syscall_cp(...) __syscall_ret(__syscall_cp(__VA_ARGS__)) -static inline long __alt_socketcall(int sys, int sock, int cp, long a, long b, long c, long d, long e, long f) +static inline long __alt_socketcall(int sys, int sock, int cp, syscall_arg_t a, syscall_arg_t b, syscall_arg_t c, syscall_arg_t d, syscall_arg_t e, syscall_arg_t f) { long r; if (cp) r = __syscall_cp(sys, a, b, c, d, e, f); @@ -71,9 +71,9 @@ static inline long __alt_socketcall(int sys, int sock, int cp, long a, long b, l return r; } #define __socketcall(nm, a, b, c, d, e, f) __alt_socketcall(SYS_##nm, __SC_##nm, 0, \ - (long)(a), (long)(b), (long)(c), (long)(d), (long)(e), (long)(f)) + __scc(a), __scc(b), __scc(c), __scc(d), __scc(e), __scc(f)) #define __socketcall_cp(nm, a, b, c, d, e, f) __alt_socketcall(SYS_##nm, __SC_##nm, 1, \ - (long)(a), (long)(b), (long)(c), (long)(d), (long)(e), (long)(f)) + __scc(a), __scc(b), __scc(c), __scc(d), __scc(e), __scc(f)) /* fixup legacy 16-bit junk */ |