public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "Dmitry V. Levin" <ldv@altlinux.org>
To: libc-alpha@sourceware.org
Subject: Re: Add Linux 4.13 constants to bits/fcntl-linux.h
Date: Fri, 08 Sep 2017 11:45:00 -0000	[thread overview]
Message-ID: <20170908114547.GA12992@altlinux.org> (raw)
In-Reply-To: <alpine.DEB.2.20.1709072105390.32296@digraph.polyomino.org.uk>

[-- Attachment #1: Type: text/plain, Size: 2401 bytes --]

On Thu, Sep 07, 2017 at 09:06:18PM +0000, Joseph Myers wrote:
> This patch, relative to a tree with
> <https://sourceware.org/ml/libc-alpha/2017-09/msg00266.html> (pending
> review) applied (but with only trivial dependence on that patch by
> virtue of changing adjacent code), adds new interfaces (F_GET_RW_HINT
> etc., and associated RW[FH]_WRITE_LIFE_*) from Linux 4.13 to
> bits/fcntl-linux.h (conditional on __USE_GNU).
> 
> Tested for x86_64.
> 
> 2017-09-07  Joseph Myers  <joseph@codesourcery.com>
> 
> 	* sysdeps/unix/sysv/linux/bits/fcntl-linux.h [__USE_GNU]
> 	(F_GET_RW_HINT): New macro.
> 	[__USE_GNU] (F_SET_RW_HINT): Likewise.
> 	[__USE_GNU] (F_GET_FILE_RW_HINT): Likewise.
> 	[__USE_GNU] (F_SET_FILE_RW_HINT): Likewise.
> 	[__USE_GNU] (RWF_WRITE_LIFE_NOT_SET): Likewise.
> 	[__USE_GNU] (RWH_WRITE_LIFE_NONE): Likewise.
> 	[__USE_GNU] (RWH_WRITE_LIFE_SHORT): Likewise.
> 	[__USE_GNU] (RWH_WRITE_LIFE_MEDIUM): Likewise.
> 	[__USE_GNU] (RWH_WRITE_LIFE_LONG): Likewise.
> 	[__USE_GNU] (RWH_WRITE_LIFE_EXTREME): Likewise.
> 
> diff --git a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h b/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
> index fc65fc2..0c1a303 100644
> --- a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
> +++ b/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
> @@ -204,6 +204,11 @@
>  # define F_GETPIPE_SZ	1032	/* Set pipe page size array.  */
>  # define F_ADD_SEALS	1033	/* Add seals to file.  */
>  # define F_GET_SEALS	1034	/* Get seals for file.  */
> +/* Set / get write life time hints.  */
> +# define F_GET_RW_HINT	1035
> +# define F_SET_RW_HINT	1036
> +# define F_GET_FILE_RW_HINT	1037
> +# define F_SET_FILE_RW_HINT	1038
>  #endif
>  #ifdef __USE_XOPEN2K8
>  # define F_DUPFD_CLOEXEC 1030	/* Duplicate file descriptor with
> @@ -281,6 +286,16 @@ struct f_owner_ex
>  # define F_SEAL_WRITE	0x0008	/* Prevent writes.  */
>  #endif
>  
> +#ifdef __USE_GNU
> +/* Hint values for F_{GET,SET}_RW_HINT.  */
> +# define RWF_WRITE_LIFE_NOT_SET	0
> +# define RWH_WRITE_LIFE_NONE	1
> +# define RWH_WRITE_LIFE_SHORT	2
> +# define RWH_WRITE_LIFE_MEDIUM	3
> +# define RWH_WRITE_LIFE_LONG	4
> +# define RWH_WRITE_LIFE_EXTREME	5
> +#endif
> +

I bet these RWF/RWH names are going to be a source of confusion.  Said
that, if they are not going to be renamed in linux headers in the nearest
future, then the patch is OK.


-- 
ldv

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

      reply	other threads:[~2017-09-08 11:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-07 21:06 Joseph Myers
2017-09-08 11:45 ` Dmitry V. Levin [this message]

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=20170908114547.GA12992@altlinux.org \
    --to=ldv@altlinux.org \
    --cc=libc-alpha@sourceware.org \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).