This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] posix: Add p{read,write}v2 RWF_NOWAIT flag (BZ#21738)
- From: Zack Weinberg <zackw at panix dot com>
- To: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Mon, 10 Jul 2017 15:34:47 -0400
- Subject: Re: [PATCH] posix: Add p{read,write}v2 RWF_NOWAIT flag (BZ#21738)
- Authentication-results: sourceware.org; auth=none
- References: <1499714685-12770-1-git-send-email-adhemerval.zanella@linaro.org>
On Mon, Jul 10, 2017 at 3:24 PM, Adhemerval Zanella
<adhemerval.zanella@linaro.org> wrote:
> Linux 4.12 (b745fafaf70c0a98a2e1e7ac8cb14542889ceb0e) adds a new
> p{read,write}v2 flag RWF_NOWAIT. This patch adds it for linux
> uio-ext.h header along with RWF_SUPPORTED (a mask with all supported
> flags).
LGTM with a couple of notes on the documentation:
> +@item RWF_NOWAIT
> +Set @code{preadv2} to return -EAGAIN if operation would block.
This is awkward grammar. Also, this function sets errno, doesn't it?
"Return -EAGAIN" is an intra-kernel convention, not what user space
sees, which is what the manual should document.
Suggest instead "Use nonblocking mode for this operation; that is,
this call to @code{preadv2} will fail and set @code{errno} to
@code{EAGAIN} if the operation would block."
> +@item RWF_SUPPORTED
> +Mask with all supported flags.
It's important to be clear that this does not necessarily reflect the
running kernel: "Bitmask of all @samp{RWF_*} flags that have so far
been defined. This is a compile-time constant; the running kernel
does not necessarily support all of the flags defined in this header.
New flags were most recently added in Linux 4.12."
> +#define RWF_NOWAIT 0x00000008 /* per-IO, return -EAGAIN if operation
> + would block */
Same as above: "per-IO nonblocking mode" would be sufficient here, I think.
zw