* [Qemu-devel] [PATCH v2] linux-user: pass correct host flags to accept4()
@ 2014-03-31 15:41 Petar Jovanovic
2014-03-31 15:45 ` Peter Maydell
0 siblings, 1 reply; 3+ messages in thread
From: Petar Jovanovic @ 2014-03-31 15:41 UTC (permalink / raw)
To: qemu-devel; +Cc: peter.maydell, riku.voipio, petar.jovanovic
From: Petar Jovanovic <petar.jovanovic@imgtec.com>
Flags NONBLOCK and CLOEXEC can have different values on the host and the
guest, so set correct host values before calling accept4().
This fixes several issues with accept4 system call and user-mode of QEMU.
Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>
---
v2:
- use target_to_host_bitmask() (per comment from Peter Maydell)
linux-user/syscall.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 2eac6d5..9864813 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -2062,9 +2062,12 @@ static abi_long do_accept4(int fd, abi_ulong target_addr,
socklen_t addrlen;
void *addr;
abi_long ret;
+ int host_flags;
+
+ host_flags = target_to_host_bitmask(flags, fcntl_flags_tbl);
if (target_addr == 0) {
- return get_errno(accept4(fd, NULL, NULL, flags));
+ return get_errno(accept4(fd, NULL, NULL, host_flags));
}
/* linux returns EINVAL if addrlen pointer is invalid */
@@ -2080,7 +2083,7 @@ static abi_long do_accept4(int fd, abi_ulong target_addr,
addr = alloca(addrlen);
- ret = get_errno(accept4(fd, addr, &addrlen, flags));
+ ret = get_errno(accept4(fd, addr, &addrlen, host_flags));
if (!is_error(ret)) {
host_to_target_sockaddr(target_addr, addr, addrlen);
if (put_user_u32(addrlen, target_addrlen_addr))
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH v2] linux-user: pass correct host flags to accept4()
2014-03-31 15:41 [Qemu-devel] [PATCH v2] linux-user: pass correct host flags to accept4() Petar Jovanovic
@ 2014-03-31 15:45 ` Peter Maydell
2014-04-01 7:31 ` Riku Voipio
0 siblings, 1 reply; 3+ messages in thread
From: Peter Maydell @ 2014-03-31 15:45 UTC (permalink / raw)
To: Petar Jovanovic; +Cc: Riku Voipio, QEMU Developers, Petar Jovanovic
On 31 March 2014 16:41, Petar Jovanovic <petar.jovanovic@rt-rk.com> wrote:
> From: Petar Jovanovic <petar.jovanovic@imgtec.com>
>
> Flags NONBLOCK and CLOEXEC can have different values on the host and the
> guest, so set correct host values before calling accept4().
>
> This fixes several issues with accept4 system call and user-mode of QEMU.
>
> Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
thanks
-- PMM
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH v2] linux-user: pass correct host flags to accept4()
2014-03-31 15:45 ` Peter Maydell
@ 2014-04-01 7:31 ` Riku Voipio
0 siblings, 0 replies; 3+ messages in thread
From: Riku Voipio @ 2014-04-01 7:31 UTC (permalink / raw)
To: Peter Maydell; +Cc: Petar Jovanovic, Petar Jovanovic, QEMU Developers
[-- Attachment #1: Type: text/plain, Size: 626 bytes --]
Hi,
Applied to my for-2.0 branch,
Thanks
On 31 March 2014 18:45, Peter Maydell <peter.maydell@linaro.org> wrote:
> On 31 March 2014 16:41, Petar Jovanovic <petar.jovanovic@rt-rk.com> wrote:
> > From: Petar Jovanovic <petar.jovanovic@imgtec.com>
> >
> > Flags NONBLOCK and CLOEXEC can have different values on the host and the
> > guest, so set correct host values before calling accept4().
> >
> > This fixes several issues with accept4 system call and user-mode of QEMU.
> >
> > Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>
>
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
>
> thanks
> -- PMM
>
[-- Attachment #2: Type: text/html, Size: 1293 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-04-01 7:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-31 15:41 [Qemu-devel] [PATCH v2] linux-user: pass correct host flags to accept4() Petar Jovanovic
2014-03-31 15:45 ` Peter Maydell
2014-04-01 7:31 ` Riku Voipio
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).