diff mbox series

[v2,02/10] lapi: add setxattrat() fallback definition

Message ID 20251007-xattrat-v2-2-bf458fa66358@suse.com
State Changes Requested
Delegated to: Andrea Cervesato
Headers show
Series setxattrat coverage | expand

Checks

Context Check Description
ltpci/debian_oldstable_gcc fail failure
ltpci/debian_stable_s390x-linux-gnu-gcc_s390x success success
ltpci/debian_stable_powerpc64le-linux-gnu-gcc_ppc64el success success
ltpci/debian_stable_aarch64-linux-gnu-gcc_arm64 success success
ltpci/ubuntu_jammy_gcc success success
ltpci/quay-io-centos-centos_stream9_gcc success success
ltpci/debian_stable_gcc success success
ltpci/ubuntu_bionic_gcc success success
ltpci/opensuse-leap_latest_gcc success success
ltpci/debian_testing_clang success success
ltpci/alpine_latest_gcc success success
ltpci/fedora_latest_clang success success
ltpci/debian_testing_gcc success success
ltpci/debian_oldstable_clang success success
ltpci/debian_stable_gcc success success
ltpci/opensuse-archive_42-2_gcc success success
ltpci/debian_oldstable_gcc success success

Commit Message

Andrea Cervesato Oct. 7, 2025, 6:46 a.m. UTC
From: Andrea Cervesato <andrea.cervesato@suse.com>

Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
---
 configure.ac         |  1 +
 include/lapi/xattr.h | 12 ++++++++++++
 2 files changed, 13 insertions(+)

Comments

Cyril Hrubis Oct. 7, 2025, 12:05 p.m. UTC | #1
Hi!
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
Cyril Hrubis Oct. 7, 2025, 3:16 p.m. UTC | #2
On Tue, Oct 07, 2025 at 08:46:54AM +0200, Andrea Cervesato wrote:
> From: Andrea Cervesato <andrea.cervesato@suse.com>
> 
> Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
> ---
>  configure.ac         |  1 +
>  include/lapi/xattr.h | 12 ++++++++++++
>  2 files changed, 13 insertions(+)
> 
> diff --git a/configure.ac b/configure.ac
> index c32d9992c..827a8e6eb 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -157,6 +157,7 @@ AC_CHECK_FUNCS_ONCE([ \
>      sendmmsg \
>      sethostid \
>      setns \
> +    setxattrat \
>      sigpending \
>      splice \
>      statx \
> diff --git a/include/lapi/xattr.h b/include/lapi/xattr.h
> index 8bd2d45e4..8ab7e51d5 100644
> --- a/include/lapi/xattr.h
> +++ b/include/lapi/xattr.h
> @@ -7,7 +7,9 @@
>  #define LAPI_XATTR_H__
>  
>  #include <stdint.h>
> +#include <stddef.h>
>  #include "config.h"
> +#include "lapi/syscalls.h"
>  
>  #ifdef HAVE_LINUX_XATTR_H
>  # include <linux/xattr.h>
> @@ -29,4 +31,14 @@ struct xattr_args {
>  };
>  #endif
>  
> +#ifndef HAVE_FUNC_SETXATTRAT
                  ^
		  Actually that FUNC shouldn't be there, it's just
		  HAVE_SETXATTRAT

> +static inline int setxattrat(int dfd, const char *pathname,
> +			     unsigned int at_flags, const char *name,
> +			     const struct xattr_args *uargs, size_t usize)
> +{
> +	return tst_syscall(__NR_setxattrat, dfd, pathname, at_flags, name,
> +		    uargs, usize);
> +}
> +#endif
> +
>  #endif /* LAPI_XATTR_H__ */
> 
> -- 
> 2.51.0
> 
> 
> -- 
> Mailing list info: https://lists.linux.it/listinfo/ltp
diff mbox series

Patch

diff --git a/configure.ac b/configure.ac
index c32d9992c..827a8e6eb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -157,6 +157,7 @@  AC_CHECK_FUNCS_ONCE([ \
     sendmmsg \
     sethostid \
     setns \
+    setxattrat \
     sigpending \
     splice \
     statx \
diff --git a/include/lapi/xattr.h b/include/lapi/xattr.h
index 8bd2d45e4..8ab7e51d5 100644
--- a/include/lapi/xattr.h
+++ b/include/lapi/xattr.h
@@ -7,7 +7,9 @@ 
 #define LAPI_XATTR_H__
 
 #include <stdint.h>
+#include <stddef.h>
 #include "config.h"
+#include "lapi/syscalls.h"
 
 #ifdef HAVE_LINUX_XATTR_H
 # include <linux/xattr.h>
@@ -29,4 +31,14 @@  struct xattr_args {
 };
 #endif
 
+#ifndef HAVE_FUNC_SETXATTRAT
+static inline int setxattrat(int dfd, const char *pathname,
+			     unsigned int at_flags, const char *name,
+			     const struct xattr_args *uargs, size_t usize)
+{
+	return tst_syscall(__NR_setxattrat, dfd, pathname, at_flags, name,
+		    uargs, usize);
+}
+#endif
+
 #endif /* LAPI_XATTR_H__ */