qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jamie Lokier <jamie@shareable.org>
To: Stuart Brady <sdbrady@ntlworld.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 16/21] linux-user: implement pipe2 [v3]
Date: Wed, 17 Jun 2009 03:31:49 +0100	[thread overview]
Message-ID: <20090617023149.GU11893@shareable.org> (raw)
In-Reply-To: <20090616214429.GA17638@miranda.arrow>

Stuart Brady wrote:
> On Fri, Jun 12, 2009 at 04:50:26PM +0300, riku.voipio@iki.fi wrote:
> > +static abi_long do_pipe2(int host_pipe[], int flags)
> > +{
> > +#ifdef CONFIG_PIPE2
> > +    return pipe2(host_pipe, flags);
> > +#else
> > +    return -ENOSYS;
> > +#endif
> > +}
> > +
> > +static abi_long do_pipe(void *cpu_env, int pipedes, int flags)
> > +{
> > +    int host_pipe[2];
> > +    abi_long ret;
> > +    ret = flags ? do_pipe2(host_pipe, flags) : pipe(host_pipe);
> 
> This worries me slightly -- surely syscalls should be consistently
> supported / not supported (where feasible), regardless of the precise
> arguments that are supplied?  (Otherwise, any run-time check for pipe2
> would get tricked if that check specifies 0 for flags.)
> 
> OTOH, I'm not sure what behaviour the library would provide for the
> pipe2() function, if the pipe2 syscall is not available.  One could
> that the pipe2() function is another matter entirely, and that QEMU
> shouldn't be too concerned with its implementation, though.

As I've explained elsewhere, it is possible to emulate pipe2() and all
the other tricksy *CLOEXEC syscalls, but it must be done carefully to
provide the expected guarantees.

-- Jamie

  reply	other threads:[~2009-06-17  2:31 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-12 13:50 [Qemu-devel] [PATCH 00/21] Pending linux-user patches riku.voipio
2009-06-12 13:50 ` [Qemu-devel] [PATCH 01/21] export mmap_find_vma for shmat riku.voipio
2009-06-12 13:50 ` [Qemu-devel] [PATCH 02/21] Implement shm* syscalls and fix 64/32bit errors riku.voipio
2009-06-12 13:50 ` [Qemu-devel] [PATCH 03/21] linux-user: implemented ELF coredump support for ARM target riku.voipio
2009-06-14 15:16   ` Blue Swirl
2009-06-12 13:50 ` [Qemu-devel] [PATCH 04/21] linux-user: added x86 and x86_64 support for ELF coredump riku.voipio
2009-06-14 15:21   ` Blue Swirl
2009-06-12 13:50 ` [Qemu-devel] [PATCH 05/21] linux-user: strace now handles guest strings correctly [v2] riku.voipio
2009-06-14 15:17   ` Blue Swirl
2009-06-12 13:50 ` [Qemu-devel] [PATCH 06/21] Revived GUEST_BASE support for usermode emulation targets [v5] riku.voipio
2009-06-14 15:28   ` Blue Swirl
2009-06-12 13:50 ` [Qemu-devel] [PATCH 07/21] linux-user: fix utimensat riku.voipio
2009-06-12 13:50 ` [Qemu-devel] [PATCH 08/21] Fix struct termios host - target translation riku.voipio
2009-06-14 15:22   ` Blue Swirl
2009-06-15 15:36     ` Riku Voipio
2009-06-16  8:28       ` Arnaud Patard
2009-06-16  9:34         ` Riku Voipio
2009-06-16 10:01           ` Arnaud Patard
2009-06-12 13:50 ` [Qemu-devel] [PATCH 09/21] Return EOPNOTSUPP instead of ENOSYS for *xattr* syscalls riku.voipio
2009-06-12 13:50 ` [Qemu-devel] [PATCH 10/21] linux-user: Added IP_ADD_MEMBERSHIP/IP_DROP_MEMBERSHIP flags to setsockopt riku.voipio
2009-06-12 13:50 ` [Qemu-devel] [PATCH 11/21] linux-user: Added IP_(UN)BLOCK_SOURCE/IP_(ADD|DROP)_SOURCE_MEMBERSHIP " riku.voipio
2009-06-12 13:50 ` [Qemu-devel] [PATCH 12/21] linux-user: include linux/fs.h riku.voipio
2009-06-12 13:50 ` [Qemu-devel] [PATCH 13/21] linux-user: support private futexes riku.voipio
2009-06-12 13:50 ` [Qemu-devel] [PATCH 14/21] add futex wake op riku.voipio
2009-06-12 13:50 ` [Qemu-devel] [PATCH 15/21] linux-user: update syscall list riku.voipio
2009-06-12 13:50 ` [Qemu-devel] [PATCH 16/21] linux-user: implement pipe2 [v3] riku.voipio
2009-06-16 21:44   ` Stuart Brady
2009-06-17  2:31     ` Jamie Lokier [this message]
2009-06-12 13:50 ` [Qemu-devel] [PATCH 17/21] linux-user: add tee, splice and vmsplice riku.voipio
2009-06-14 15:25   ` Blue Swirl
2009-06-12 13:50 ` [Qemu-devel] [PATCH 18/21] RFC: fix fcntl support in linux-user - new try riku.voipio
2009-06-14 15:15   ` Blue Swirl
2009-06-12 13:50 ` [Qemu-devel] [PATCH 19/21] linux-user: initialize mmap_mutex properly riku.voipio
2009-06-12 13:50 ` [Qemu-devel] [PATCH 20/21] linux-user/syscall.c: define _ATFILE_SOURCE riku.voipio
2009-06-12 13:50 ` [Qemu-devel] [PATCH 21/21] linux-user: remove duplicate tswap32() from do_getsockopt() riku.voipio
2009-06-14 15:12 ` [Qemu-devel] [PATCH 00/21] Pending linux-user patches Blue Swirl
2009-06-15 15:10   ` Riku Voipio
2009-06-16 16:30     ` Martin Mohring
2009-06-16 16:45       ` Blue Swirl
2009-06-16 17:03         ` Riku Voipio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090617023149.GU11893@shareable.org \
    --to=jamie@shareable.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sdbrady@ntlworld.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).