Patchwork Add F_SEAL_FUTURE_WRITE from Linux 5.1 to bits/fcntl-linux.h

login
register
mail settings
Submitter Joseph Myers
Date May 20, 2019, 9:58 p.m.
Message ID <alpine.DEB.2.21.1905202158180.19503@digraph.polyomino.org.uk>
Download mbox | patch
Permalink /patch/32776/
State New
Headers show

Comments

Joseph Myers - May 20, 2019, 9:58 p.m.
This patch adds the new F_SEAL_FUTURE_WRITE constant from Linux 5.1 to
bits/fcntl-linux.h.

Tested for x86_64.

2019-05-20  Joseph Myers  <joseph@codesourcery.com>

	* sysdeps/unix/sysv/linux/bits/fcntl-linux.h [__USE_GNU]
	(F_SEAL_FUTURE_WRITE): New macro.
Florian Weimer - May 21, 2019, 6:04 a.m.
* Joseph Myers:

> This patch adds the new F_SEAL_FUTURE_WRITE constant from Linux 5.1 to
> bits/fcntl-linux.h.
>
> Tested for x86_64.
>
> 2019-05-20  Joseph Myers  <joseph@codesourcery.com>
>
> 	* sysdeps/unix/sysv/linux/bits/fcntl-linux.h [__USE_GNU]
> 	(F_SEAL_FUTURE_WRITE): New macro.
>
> diff --git a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h b/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
> index 4b4d6f7ae5..3f32eb328b 100644
> --- a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
> +++ b/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
> @@ -284,6 +284,8 @@ struct f_owner_ex
>  # define F_SEAL_SHRINK	0x0002	/* Prevent file from shrinking.  */
>  # define F_SEAL_GROW	0x0004	/* Prevent file from growing.  */
>  # define F_SEAL_WRITE	0x0008	/* Prevent writes.  */
> +# define F_SEAL_FUTURE_WRITE	0x0010	/* Prevent future writes while
> +					   mapped.  */
>  #endif
>  
>  #ifdef __USE_GNU

I checked this against the Linux sources and the change looks good to
me.

Thanks,
Florian

Patch

diff --git a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h b/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
index 4b4d6f7ae5..3f32eb328b 100644
--- a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
+++ b/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
@@ -284,6 +284,8 @@  struct f_owner_ex
 # define F_SEAL_SHRINK	0x0002	/* Prevent file from shrinking.  */
 # define F_SEAL_GROW	0x0004	/* Prevent file from growing.  */
 # define F_SEAL_WRITE	0x0008	/* Prevent writes.  */
+# define F_SEAL_FUTURE_WRITE	0x0010	/* Prevent future writes while
+					   mapped.  */
 #endif
 
 #ifdef __USE_GNU