Re: [Qemu-devel] [PATCH 01/16] linux-user: translate the result of getsockopt SO_TYPE

2014-06-21 Thread Riku Voipio
On Sun, Jun 15, 2014 at 05:18:18PM +0100, Paul Burton wrote: QEMU previously passed the result of the host syscall directly to the target program. This is a problem if the host target have different representations of socket types, as is the case when running a MIPS target program on an x86

Re: [Qemu-devel] [PATCH 01/16] linux-user: translate the result of getsockopt SO_TYPE

2014-06-21 Thread Paul Burton
On Sat, Jun 21, 2014 at 12:39:12PM +0300, Riku Voipio wrote: @@ -1526,6 +1555,7 @@ static abi_long do_getsockopt(int sockfd, int level, int optname, abi_long ret; int len, val; socklen_t lv; +int (*translate_result)(int val) = NULL; switch(level) {

[Qemu-devel] [PATCH 01/16] linux-user: translate the result of getsockopt SO_TYPE

2014-06-15 Thread Paul Burton
QEMU previously passed the result of the host syscall directly to the target program. This is a problem if the host target have different representations of socket types, as is the case when running a MIPS target program on an x86 host. Introduce a host_to_target_sock_type helper function