diff options
author | Ulrich Hecht <uli@suse.de> | 2009-07-03 17:09:28 +0200 |
---|---|---|
committer | Riku Voipio <riku.voipio@iki.fi> | 2009-07-08 17:02:27 +0300 |
commit | 98818189ea9a8e7abd4d8699289da6b14d8190ee (patch) | |
tree | ada6af22bd4a16533dfcdc06441b5eb2bff6b151 /linux-user | |
parent | 784ccfdb3675e6524ba277f41889577e4530282b (diff) |
64-bit clean socketcall syscall
makes socketcall 64-bit clean so it works on 64-bit big-endian systems
Signed-off-by: Ulrich Hecht <uli@suse.de>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
Diffstat (limited to 'linux-user')
-rw-r--r-- | linux-user/syscall.c | 130 |
1 files changed, 65 insertions, 65 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 23a42adff5..40ccb10acc 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -1777,11 +1777,11 @@ static abi_long do_socketcall(int num, abi_ulong vptr) switch(num) { case SOCKOP_socket: { - int domain, type, protocol; + abi_ulong domain, type, protocol; - if (get_user_s32(domain, vptr) - || get_user_s32(type, vptr + n) - || get_user_s32(protocol, vptr + 2 * n)) + if (get_user_ual(domain, vptr) + || get_user_ual(type, vptr + n) + || get_user_ual(protocol, vptr + 2 * n)) return -TARGET_EFAULT; ret = do_socket(domain, type, protocol); @@ -1789,13 +1789,13 @@ static abi_long do_socketcall(int num, abi_ulong vptr) break; case SOCKOP_bind: { - int sockfd; + abi_ulong sockfd; abi_ulong target_addr; socklen_t addrlen; - if (get_user_s32(sockfd, vptr) + if (get_user_ual(sockfd, vptr) || get_user_ual(target_addr, vptr + n) - || get_user_u32(addrlen, vptr + 2 * n)) + || get_user_ual(addrlen, vptr + 2 * n)) return -TARGET_EFAULT; ret = do_bind(sockfd, target_addr, addrlen); @@ -1803,13 +1803,13 @@ static abi_long do_socketcall(int num, abi_ulong vptr) break; case SOCKOP_connect: { - int sockfd; + abi_ulong sockfd; abi_ulong target_addr; socklen_t addrlen; - if (get_user_s32(sockfd, vptr) + if (get_user_ual(sockfd, vptr) || get_user_ual(target_addr, vptr + n) - || get_user_u32(addrlen, vptr + 2 * n)) + || get_user_ual(addrlen, vptr + 2 * n)) return -TARGET_EFAULT; ret = do_connect(sockfd, target_addr, addrlen); @@ -1817,10 +1817,10 @@ static abi_long do_socketcall(int num, abi_ulong vptr) break; case SOCKOP_listen: { - int sockfd, backlog; + abi_ulong sockfd, backlog; - if (get_user_s32(sockfd, vptr) - || get_user_s32(backlog, vptr + n)) + if (get_user_ual(sockfd, vptr) + || get_user_ual(backlog, vptr + n)) return -TARGET_EFAULT; ret = get_errno(listen(sockfd, backlog)); @@ -1828,12 +1828,12 @@ static abi_long do_socketcall(int num, abi_ulong vptr) break; case SOCKOP_accept: { - int sockfd; + abi_ulong sockfd; abi_ulong target_addr, target_addrlen; - if (get_user_s32(sockfd, vptr) + if (get_user_ual(sockfd, vptr) || get_user_ual(target_addr, vptr + n) - || get_user_u32(target_addrlen, vptr + 2 * n)) + || get_user_ual(target_addrlen, vptr + 2 * n)) return -TARGET_EFAULT; ret = do_accept(sockfd, target_addr, target_addrlen); @@ -1841,12 +1841,12 @@ static abi_long do_socketcall(int num, abi_ulong vptr) break; case SOCKOP_getsockname: { - int sockfd; + abi_ulong sockfd; abi_ulong target_addr, target_addrlen; - if (get_user_s32(sockfd, vptr) + if (get_user_ual(sockfd, vptr) || get_user_ual(target_addr, vptr + n) - || get_user_u32(target_addrlen, vptr + 2 * n)) + || get_user_ual(target_addrlen, vptr + 2 * n)) return -TARGET_EFAULT; ret = do_getsockname(sockfd, target_addr, target_addrlen); @@ -1854,12 +1854,12 @@ static abi_long do_socketcall(int num, abi_ulong vptr) break; case SOCKOP_getpeername: { - int sockfd; + abi_ulong sockfd; abi_ulong target_addr, target_addrlen; - if (get_user_s32(sockfd, vptr) + if (get_user_ual(sockfd, vptr) || get_user_ual(target_addr, vptr + n) - || get_user_u32(target_addrlen, vptr + 2 * n)) + || get_user_ual(target_addrlen, vptr + 2 * n)) return -TARGET_EFAULT; ret = do_getpeername(sockfd, target_addr, target_addrlen); @@ -1867,12 +1867,12 @@ static abi_long do_socketcall(int num, abi_ulong vptr) break; case SOCKOP_socketpair: { - int domain, type, protocol; + abi_ulong domain, type, protocol; abi_ulong tab; - if (get_user_s32(domain, vptr) - || get_user_s32(type, vptr + n) - || get_user_s32(protocol, vptr + 2 * n) + if (get_user_ual(domain, vptr) + || get_user_ual(type, vptr + n) + || get_user_ual(protocol, vptr + 2 * n) || get_user_ual(tab, vptr + 3 * n)) return -TARGET_EFAULT; @@ -1881,15 +1881,15 @@ static abi_long do_socketcall(int num, abi_ulong vptr) break; case SOCKOP_send: { - int sockfd; + abi_ulong sockfd; abi_ulong msg; size_t len; - int flags; + abi_ulong flags; - if (get_user_s32(sockfd, vptr) + if (get_user_ual(sockfd, vptr) || get_user_ual(msg, vptr + n) || get_user_ual(len, vptr + 2 * n) - || get_user_s32(flags, vptr + 3 * n)) + || get_user_ual(flags, vptr + 3 * n)) return -TARGET_EFAULT; ret = do_sendto(sockfd, msg, len, flags, 0, 0); @@ -1897,15 +1897,15 @@ static abi_long do_socketcall(int num, abi_ulong vptr) break; case SOCKOP_recv: { - int sockfd; + abi_ulong sockfd; abi_ulong msg; size_t len; - int flags; + abi_ulong flags; - if (get_user_s32(sockfd, vptr) + if (get_user_ual(sockfd, vptr) || get_user_ual(msg, vptr + n) || get_user_ual(len, vptr + 2 * n) - || get_user_s32(flags, vptr + 3 * n)) + || get_user_ual(flags, vptr + 3 * n)) return -TARGET_EFAULT; ret = do_recvfrom(sockfd, msg, len, flags, 0, 0); @@ -1913,19 +1913,19 @@ static abi_long do_socketcall(int num, abi_ulong vptr) break; case SOCKOP_sendto: { - int sockfd; + abi_ulong sockfd; abi_ulong msg; size_t len; - int flags; + abi_ulong flags; abi_ulong addr; socklen_t addrlen; - if (get_user_s32(sockfd, vptr) + if (get_user_ual(sockfd, vptr) || get_user_ual(msg, vptr + n) || get_user_ual(len, vptr + 2 * n) - || get_user_s32(flags, vptr + 3 * n) + || get_user_ual(flags, vptr + 3 * n) || get_user_ual(addr, vptr + 4 * n) - || get_user_u32(addrlen, vptr + 5 * n)) + || get_user_ual(addrlen, vptr + 5 * n)) return -TARGET_EFAULT; ret = do_sendto(sockfd, msg, len, flags, addr, addrlen); @@ -1933,19 +1933,19 @@ static abi_long do_socketcall(int num, abi_ulong vptr) break; case SOCKOP_recvfrom: { - int sockfd; + abi_ulong sockfd; abi_ulong msg; size_t len; - int flags; + abi_ulong flags; abi_ulong addr; socklen_t addrlen; - if (get_user_s32(sockfd, vptr) + if (get_user_ual(sockfd, vptr) || get_user_ual(msg, vptr + n) || get_user_ual(len, vptr + 2 * n) - || get_user_s32(flags, vptr + 3 * n) + || get_user_ual(flags, vptr + 3 * n) || get_user_ual(addr, vptr + 4 * n) - || get_user_u32(addrlen, vptr + 5 * n)) + || get_user_ual(addrlen, vptr + 5 * n)) return -TARGET_EFAULT; ret = do_recvfrom(sockfd, msg, len, flags, addr, addrlen); @@ -1953,10 +1953,10 @@ static abi_long do_socketcall(int num, abi_ulong vptr) break; case SOCKOP_shutdown: { - int sockfd, how; + abi_ulong sockfd, how; - if (get_user_s32(sockfd, vptr) - || get_user_s32(how, vptr + n)) + if (get_user_ual(sockfd, vptr) + || get_user_ual(how, vptr + n)) return -TARGET_EFAULT; ret = get_errno(shutdown(sockfd, how)); @@ -1965,13 +1965,13 @@ static abi_long do_socketcall(int num, abi_ulong vptr) case SOCKOP_sendmsg: case SOCKOP_recvmsg: { - int fd; + abi_ulong fd; abi_ulong target_msg; - int flags; + abi_ulong flags; - if (get_user_s32(fd, vptr) + if (get_user_ual(fd, vptr) || get_user_ual(target_msg, vptr + n) - || get_user_s32(flags, vptr + 2 * n)) + || get_user_ual(flags, vptr + 2 * n)) return -TARGET_EFAULT; ret = do_sendrecvmsg(fd, target_msg, flags, @@ -1980,17 +1980,17 @@ static abi_long do_socketcall(int num, abi_ulong vptr) break; case SOCKOP_setsockopt: { - int sockfd; - int level; - int optname; + abi_ulong sockfd; + abi_ulong level; + abi_ulong optname; abi_ulong optval; socklen_t optlen; - if (get_user_s32(sockfd, vptr) - || get_user_s32(level, vptr + n) - || get_user_s32(optname, vptr + 2 * n) + if (get_user_ual(sockfd, vptr) + || get_user_ual(level, vptr + n) + || get_user_ual(optname, vptr + 2 * n) || get_user_ual(optval, vptr + 3 * n) - || get_user_u32(optlen, vptr + 4 * n)) + || get_user_ual(optlen, vptr + 4 * n)) return -TARGET_EFAULT; ret = do_setsockopt(sockfd, level, optname, optval, optlen); @@ -1998,17 +1998,17 @@ static abi_long do_socketcall(int num, abi_ulong vptr) break; case SOCKOP_getsockopt: { - int sockfd; - int level; - int optname; + abi_ulong sockfd; + abi_ulong level; + abi_ulong optname; abi_ulong optval; socklen_t optlen; - if (get_user_s32(sockfd, vptr) - || get_user_s32(level, vptr + n) - || get_user_s32(optname, vptr + 2 * n) + if (get_user_ual(sockfd, vptr) + || get_user_ual(level, vptr + n) + || get_user_ual(optname, vptr + 2 * n) || get_user_ual(optval, vptr + 3 * n) - || get_user_u32(optlen, vptr + 4 * n)) + || get_user_ual(optlen, vptr + 4 * n)) return -TARGET_EFAULT; ret = do_getsockopt(sockfd, level, optname, optval, optlen); |