linux-user: Implement sendmmsg syscall
commitf19e00d776b781bfb0067b9b20a592440fd2990e
authorAlexander Graf <agraf@suse.de>
Sun, 2 Mar 2014 19:36:42 +0000 (2 19:36 +0000)
committerRiku Voipio <riku.voipio@linaro.org>
Mon, 3 Mar 2014 21:08:09 +0000 (3 23:08 +0200)
tree5fdc95d88771c397087907a1bcf0016c53b25494
parent76ca310a19463e9883e2e55a88ac8be1fc171eea
linux-user: Implement sendmmsg syscall

Glibc when built for newer kernels assumes that the sendmmsg syscall is
available. Without it, dns resolution simply fails to work.

Wrap the syscall with existing infrastructure so that we don't have a host
dependency on sendmmsg.

To avoid locking the same area of guest memory twice (which will break if
DEBUG_REMAP is defined) we pull the lock/unlock part of do_sendrecvmsg()
out into its own function so the actual implementation can be shared.

Signed-off-by: Alexander Graf <agraf@suse.de>
[PMM: add recvmmsg support;
 handle errors (which also implies support for non-blocking operations);
 cap the vector length as the kernel implementation does;
 don't lock guest memory twice;
 support MSG_WAITFORONE flag]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
linux-user/syscall.c
linux-user/syscall_defs.h