]> git.proxmox.com Git - qemu.git/commit - linux-user/syscall.c
linux-user: Translate getsockopt level option
authorJamie Lentin <jm@lentin.co.uk>
Fri, 26 Nov 2010 13:04:08 +0000 (15:04 +0200)
committerRiku Voipio <riku.voipio@nokia.com>
Fri, 3 Dec 2010 13:09:39 +0000 (15:09 +0200)
commitf3b974cd3bb624cc7a3004db902b59d599ff016a
treea22dbe7945ce6d4aa5c6ad22c3d921c78610634b
parentbee70008074570ef2c368aec80918c2494065247
linux-user: Translate getsockopt level option

n setsockopt, the socket level options are translated to the hosts'
architecture before the real syscall is called, e.g.
TARGET_SO_TYPE -> SO_TYPE. This patch does the same with getsockopt.

Tested on a x86 host emulating MIPS.  Without it:-

$ grep getsockopt host.strace
31311 getsockopt(3, SOL_SOCKET, 0x1007 /* SO_??? */, 0xbff17208,
0xbff17204) = -1 ENOPROTOOPT (Protocol not available)

With:-

$ grep getsockopt host.strace
25706 getsockopt(3, SOL_SOCKET, SO_ERROR, [0], [4]) = 0

Whitespace cleanup: Riku Voipio

Signed-off-by: Jamie Lentin <jm@lentin.co.uk>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
linux-user/syscall.c