linux-user: Fix socketcall() syscall support
authorAleksandar Markovic <aleksandar.markovic@imgtec.com>
Thu, 22 Sep 2016 16:56:57 +0000 (18:56 +0200)
committerRiku Voipio <riku.voipio@linaro.org>
Fri, 21 Oct 2016 12:19:40 +0000 (15:19 +0300)
commitff71a4545c0d9b452e77a91ab1c46f79a10a9eca
tree1ef9e290fcfde01d191da39f12bfbd2f171b6195
parentda39db63e4468e39bb56d04d191866c5276aa7fa
linux-user: Fix socketcall() syscall support

Since not all Linux host platforms support socketcall() (most notably
Intel), do_socketcall() function in Qemu's syscalls.c is implemented to
mirror the corespondant implementation of socketcall() in Linux kernel,
and to utilise individual socket operations that are supported on all
Linux platforms. (see kernel source file net/socket.c, definition of
socketcall).

However, error codes produced by Qemu implementation are wrong for the
cases of invalid values of the first argument. Also, naming of constants
is not consistent with kernel one, and not consistant with Qemu convention
of prefixing such constants with "TARGET_". This patch in that light
brings do_socketcall() closer to its kernel counterpart, and in that way
fixes the errors and yields more consisrtent Qemu code.

There were also three missing cases (among 20) for strace support for
socketcall(). The array that contains pointers for appropriate printing
functions is updated with 3 elements, however pointers to functions are
left NULL, and its implementation is left for future.

Also, this patch fixes failure of LTP test socketcall02, if executed on some
Qemu emulated sywstems (uer mode).

Signed-off-by: Aleksandar Markovic <aleksandar.markovic@imgtec.com>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
linux-user/strace.c
linux-user/syscall.c
linux-user/syscall_defs.h