qemu-devel@nongnu.org
[Top] [All Lists]

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

Subject: Re: [Qemu-devel] [PATCH 16/21] linux-user: implement pipe2 [v3]
From: Stuart Brady
Date: Tue, 16 Jun 2009 22:44:29 +0100
On Fri, Jun 12, 2009 at 04:50:26PM +0300, riku.voipio@xxxxxx 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.

Cheers,
-- 
Stuart Brady


<Prev in Thread] Current Thread [Next in Thread>