linux-user: Support the accept4 socketcall

Cc: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: André Hentschel <nerv@dawncrow.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Erik de Castro Lopo <erikd@mega-nerd.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
This commit is contained in:
André Hentschel 2014-01-06 20:18:52 +01:00 committed by Riku Voipio
parent 1d327fb4c7
commit b9d36eb2c7
2 changed files with 17 additions and 0 deletions

View File

@ -2245,6 +2245,22 @@ static abi_long do_socketcall(int num, abi_ulong vptr)
ret = do_accept4(sockfd, target_addr, target_addrlen, 0);
}
break;
case SOCKOP_accept4:
{
abi_ulong sockfd;
abi_ulong target_addr, target_addrlen;
abi_ulong flags;
if (get_user_ual(sockfd, vptr)
|| get_user_ual(target_addr, vptr + n)
|| get_user_ual(target_addrlen, vptr + 2 * n)
|| get_user_ual(flags, vptr + 3 * n)) {
return -TARGET_EFAULT;
}
ret = do_accept4(sockfd, target_addr, target_addrlen, flags);
}
break;
case SOCKOP_getsockname:
{
abi_ulong sockfd;

View File

@ -27,6 +27,7 @@
#define SOCKOP_getsockopt 15
#define SOCKOP_sendmsg 16
#define SOCKOP_recvmsg 17
#define SOCKOP_accept4 18
#define IPCOP_semop 1
#define IPCOP_semget 2