linux-user: Support the accept4 socketcall
PATCH v3 1/1 linux-user: Support the accept4 socketcall
From: André Hentschel <[email protected]>
Cc Riku Voipio <[email protected]>
Signed-off-by André Hentschel <[email protected]>
---
See https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/net.h for the value.
linux-user/syscall.c | 16 ++++++++++++++++ linux-user/syscall_defs.h | 1 + 2 files changed, 17 insertions(+)
linux-user/syscall.c +16 -0
@@ -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;
linux-user/syscall_defs.h +1 -0
@@ -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
Signature · 1 line
1.8.1.2
Quoted 3 lines · André Hentschel
From: André Hentschel <[email protected]>
Cc Riku Voipio <[email protected]>Signed-off-by André Hentschel <[email protected]>
Reviewed-by Peter Maydell <[email protected]>
thanks
-- PMM
Quoted 3 lines · André Hentschel
From: André Hentschel <[email protected]>
Cc Riku Voipio <[email protected]>Signed-off-by André Hentschel <[email protected]>
Reviewed-by Erik de Castro Lopo <[email protected]>
Signature · 3 lines
---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/
Quoted 4 lines · André Hentschel
From: André Hentschel <[email protected]>
Cc Riku Voipio <[email protected]>Signed-off-by André Hentschel <[email protected]>
Reviewed-by Laurent Vivier <[email protected]>