* Add Linux 4.13 constants to bits/fcntl-linux.h
@ 2017-09-07 21:06 Joseph Myers
2017-09-08 11:45 ` Dmitry V. Levin
0 siblings, 1 reply; 2+ messages in thread
From: Joseph Myers @ 2017-09-07 21:06 UTC (permalink / raw)
To: libc-alpha
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
+
/* Define some more compatibility macros to be backward compatible with
BSD systems which did not managed to hide these kernel macros. */
#ifdef __USE_MISC
--
Joseph S. Myers
joseph@codesourcery.com
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Add Linux 4.13 constants to bits/fcntl-linux.h
2017-09-07 21:06 Add Linux 4.13 constants to bits/fcntl-linux.h Joseph Myers
@ 2017-09-08 11:45 ` Dmitry V. Levin
0 siblings, 0 replies; 2+ messages in thread
From: Dmitry V. Levin @ 2017-09-08 11:45 UTC (permalink / raw)
To: libc-alpha
[-- 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 --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-09-08 11:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-07 21:06 Add Linux 4.13 constants to bits/fcntl-linux.h Joseph Myers
2017-09-08 11:45 ` Dmitry V. Levin
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).