qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 16/21] linux-user: implement pipe2 [v3]


From: Jamie Lokier
Subject: Re: [Qemu-devel] [PATCH 16/21] linux-user: implement pipe2 [v3]
Date: Wed, 17 Jun 2009 03:31:49 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

Stuart Brady wrote:
> On Fri, Jun 12, 2009 at 04:50:26PM +0300, address@hidden 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 via email to

[Prev in Thread] Current Thread [Next in Thread]