Add AT_HANDLE_FID from Linux 6.5 to bits/fcntl-linux.h

Message ID 51bfe740-7f2f-9f14-1ad-4a20e61a3a25@codesourcery.com
State Committed
Commit 2399ab0d2076b485aa81855e048a7a44d3c12eaa
Headers
Series Add AT_HANDLE_FID from Linux 6.5 to bits/fcntl-linux.h |

Checks

Context Check Description
redhat-pt-bot/TryBot-apply_patch success Patch applied to master at the time it was sent
redhat-pt-bot/TryBot-32bit success Build for i686
linaro-tcwg-bot/tcwg_glibc_build--master-arm warning Patch is already merged
linaro-tcwg-bot/tcwg_glibc_check--master-arm warning Patch is already merged
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 warning Patch is already merged
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 warning Patch is already merged

Commit Message

Joseph Myers Oct. 13, 2023, 11:26 p.m. UTC
  Linux 6.5 adds a constant AT_HANDLE_FID; add it to glibc.  Because
this is a flag for the function name_to_handle_at declared in
bits/fcntl-linux.h, put the flag there rather than alongside other
AT_* flags in (OS-independent) fcntl.h.

Tested for x86_64.
  

Comments

Florian Weimer Oct. 14, 2023, 8:45 a.m. UTC | #1
* Joseph Myers:

> Linux 6.5 adds a constant AT_HANDLE_FID; add it to glibc.  Because
> this is a flag for the function name_to_handle_at declared in
> bits/fcntl-linux.h, put the flag there rather than alongside other
> AT_* flags in (OS-independent) fcntl.h.
>
> Tested for x86_64.
>
> diff --git a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h b/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
> index df378c7b89..dd9d9baf09 100644
> --- a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
> +++ b/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
> @@ -368,6 +368,17 @@ struct file_handle
>  # define MAX_HANDLE_SZ	128
>  #endif
>  
> +#ifdef __USE_GNU
> +/* Flags for name_to_handle_at.  See comment in fcntl.h about the use
> +   of the same AT_* flag bits for different purposes in different
> +   functions.  */
> +# define AT_HANDLE_FID		AT_REMOVEDIR /* File handle is needed
> +						to compare object
> +						identity and may not
> +						be usable to
> +						open_by_handle_at.  */
> +#endif
> +

Looks good.  Thanks.
  

Patch

diff --git a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h b/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
index df378c7b89..dd9d9baf09 100644
--- a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
+++ b/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
@@ -368,6 +368,17 @@  struct file_handle
 # define MAX_HANDLE_SZ	128
 #endif
 
+#ifdef __USE_GNU
+/* Flags for name_to_handle_at.  See comment in fcntl.h about the use
+   of the same AT_* flag bits for different purposes in different
+   functions.  */
+# define AT_HANDLE_FID		AT_REMOVEDIR /* File handle is needed
+						to compare object
+						identity and may not
+						be usable to
+						open_by_handle_at.  */
+#endif
+
 __BEGIN_DECLS
 
 #ifdef __USE_GNU