summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorHeiko Thiery <heiko.thiery@gmail.com>2021-05-08 08:49:26 +0200
committerDavid Ahern <dsahern@kernel.org>2021-05-17 02:31:29 +0000
commitc5b72cc56bf88160bbf477ec8565fed865e7a1c9 (patch)
tree72df1a3fe43c5e5749b1f738de4009d4c765dfda /configure
parent62c88ed9402650823a88c2974efdc39a320dfe7b (diff)
lib/fs: fix issue when {name,open}_to_handle_at() is not implemented
With commit d5e6ee0dac64 the usage of functions name_to_handle_at() and open_by_handle_at() are introduced. But these function are not available e.g. in uclibc-ng < 1.0.35. To have a backward compatibility check for the availability in the configure script and in case of absence do a direct syscall. Fixes: d5e6ee0dac64 ("ss: introduce cgroup2 cache and helper functions") Cc: Dmitry Yakunin <zeil@yandex-team.ru> Cc: Petr Vorel <petr.vorel@gmail.com> Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com> Reviewed-by: Petr Vorel <petr.vorel@gmail.com> Signed-off-by: David Ahern <dsahern@kernel.org>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure28
1 files changed, 28 insertions, 0 deletions
diff --git a/configure b/configure
index 2c363d3b..179eae08 100755
--- a/configure
+++ b/configure
@@ -202,6 +202,31 @@ EOF
rm -f $TMPDIR/setnstest.c $TMPDIR/setnstest
}
+check_name_to_handle_at()
+{
+ cat >$TMPDIR/name_to_handle_at_test.c <<EOF
+#define _GNU_SOURCE
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+int main(int argc, char **argv)
+{
+ struct file_handle *fhp;
+ int mount_id, flags, dirfd;
+ char *pathname;
+ name_to_handle_at(dirfd, pathname, fhp, &mount_id, flags);
+ return 0;
+}
+EOF
+ if $CC -I$INCLUDE -o $TMPDIR/name_to_handle_at_test $TMPDIR/name_to_handle_at_test.c >/dev/null 2>&1; then
+ echo "yes"
+ echo "CFLAGS += -DHAVE_HANDLE_AT" >>$CONFIG
+ else
+ echo "no"
+ fi
+ rm -f $TMPDIR/name_to_handle_at_test.c $TMPDIR/name_to_handle_at_test
+}
+
check_ipset()
{
cat >$TMPDIR/ipsettest.c <<EOF
@@ -492,6 +517,9 @@ fi
echo -n "libc has setns: "
check_setns
+echo -n "libc has name_to_handle_at: "
+check_name_to_handle_at
+
echo -n "SELinux support: "
check_selinux