]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: check for mount_attr in linux/mount.h
authorKarel Zak <kzak@redhat.com>
Tue, 31 May 2022 15:27:04 +0000 (17:27 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 3 Jan 2023 11:53:12 +0000 (12:53 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
configure.ac
include/mount-api-utils.h
meson.build

index 432f7e72504f13c612ae3050d46c6db0681bcc98..9f15648f120538a640585f07bf5a206f3186bec9 100644 (file)
@@ -498,7 +498,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 [AC_DEFINE([HAVE_TM_GMTOFF], [1], [Does struct tm have a field tm_gmtoff?])
 ])
 
-AC_CHECK_TYPES([struct mount_attr], [], [], [[#include <sys/mount.h>]])
+AC_CHECK_TYPES([struct mount_attr], [], [], [[#include <linux/mount.h>]])
 
 AC_CHECK_MEMBERS([struct termios.c_line],,,
     [[#include <termios.h>]])
index 4d3396ec41a9478d5089e4b40082b90554487613..b4611047682f2039ee3a34c1abf3893653f31c6f 100644 (file)
@@ -3,6 +3,7 @@
 
 #if defined(__linux__)
 #include <sys/syscall.h>
+#include <linux/mount.h>
 
 /*
  * Scope all of this beneath mount_setattr(). If this syscall is available all
index 24e75839f2e49d3c3901d6d761ded1f62b22924a..a145dbeb27dce7b4bf9fe9dd21eb1b4a50b57633 100644 (file)
@@ -499,8 +499,11 @@ funcs = '''
         newlocale
         mempcpy
         mkostemp
+        move_mount
+        mount_setattr
         nanosleep
         ntp_gettime
+        open_tree
         personality
         pidfd_open
         pidfd_send_signal
@@ -581,6 +584,10 @@ have = cc.has_member('struct tm', 'tm_gmtoff',
                      ''')
 conf.set('HAVE_TM_GMTOFF', have ? 1 : false)
 
+
+have = cc.sizeof('struct mount_attr', prefix : '#include <linux/mount.h>') > 0
+conf.set('HAVE_STRUCT_MOUNT_ATTR', have ? 1 : false)
+
 have = cc.has_member('struct termios', 'c_line',
                      prefix : '#include <termios.h>')
 conf.set('HAVE_STRUCT_TERMIOS_C_LINE', have ? 1 : false)