[AC_DEFINE([HAVE_TM_GMTOFF], [1], [Does struct tm have a field tm_gmtoff?])
])
+AC_CHECK_TYPES([struct fanotify_event_info_header], [], [], [[#include <linux/fanotify.h>]])
+
AC_CHECK_TYPES([struct mount_attr], [], [], [[#include <linux/mount.h>]])
AC_CHECK_TYPES([enum fsconfig_command], [], [], [[#include <linux/mount.h>]])
#include "mountP.h"
#include "monitor.h"
+/*
+ * The fanotify info header is suppported since kernel v5.1 (commit 5e469c830fdb5).
+ *
+ * We do not provide fallback for so old systems. There is fallback only for
+ * missing "struct fanotify_event_info_mnt" (since v6.15, commit 0f46d81f2bce9).
+ */
+#ifdef HAVE_STRUCT_FANOTIFY_EVENT_INFO_HEADER
+
#include "strutils.h"
#include "pathnames.h"
DBG(MONITOR, ul_debugobj(mn, "failed to allocate fanotify monitor [rc=%d]", rc));
return rc;
}
+
+
+#else /* !HAVE_STRUCT_FANOTIFY_EVENT_INFO_HEADER */
+
+int mnt_monitor_enable_fanotify(
+ struct libmnt_monitor *mn __attribute__((__unused__)),
+ int enable __attribute__((__unused__)),
+ int ns __attribute__((__unused__)))
+{
+ errno = ENOTSUP;
+ return -errno;
+}
+#endif
#if defined(HAVE_STATX) && defined(HAVE_STRUCT_STATX) && defined(AT_STATX_DONT_SYNC)
"statx",
#endif
+#ifdef HAVE_STRUCT_FANOTIFY_EVENT_INFO_HEADER
+ "fanotify",
+#endif
#if !defined(NDEBUG)
"assert", /* libc assert.h stuff */
#endif
conf.set('USE_LOGIN_LASTLOG', login_lastlogin ? 1 : false)
summary('login-lastlogin', login_lastlogin ? 'enabled' : 'disabled', section : 'components')
+have = cc.has_type('struct fanotify_event_info_header', prefix : '#include <linux/fanotify.h>')
+conf.set('HAVE_STRUCT_FANOTIFY_EVENT_INFO_HEADER', have ? 1 : false)
+
have_mountfd_api = cc.has_type('struct mount_attr', prefix : '#include <linux/mount.h>')
conf.set('HAVE_STRUCT_MOUNT_ATTR', have_mountfd_api ? 1 : false)
conf.set('HAVE_MOUNTFD_API', have_mountfd_api ? 1 : false)
-
have_struct_statx = cc.has_type('struct statx', prefix : '#include <sys/stat.h>')
conf.set('HAVE_STRUCT_STATX', have_struct_statx ? 1 : false)
have = cc.has_member('struct statx', 'stx_mnt_id',