From bc750375c3be262e994ac59cb09ed95dc7173cda Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 14 Aug 2024 15:31:57 +0200 Subject: [PATCH] meson: check for statmount and listmount syscalls ... keep statx stuff on one place. Signed-off-by: Karel Zak --- meson.build | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index c35610789..8dcc9c9cc 100644 --- a/meson.build +++ b/meson.build @@ -103,8 +103,27 @@ have_mountfd_api = cc.has_type('struct mount_attr', prefix : '#include ') conf.set('HAVE_STRUCT_STATX', have_struct_statx ? 1 : false) +have = cc.has_member('struct statx', 'stx_mnt_id', + prefix : '#include ') +conf.set('HAVE_STRUCT_STATX_STX_MNT_ID', have ? 1 : false) + + +have_statmount = cc.has_type('struct statmount', prefix : '#include ') > 0 +have_listmount = cc.has_header_symbol('linux/mount.h', 'LSMT_ROOT') + +# kernel headers provides the syscall, but there is not SYS_xxx yet +if have_statmount and not cc.has_header_symbol('bits/syscall.h', 'SYS_statmount') + conf.set('SYS_statmount', '__NR_statmount') +endif +if have_listmount and not cc.has_header_symbol('bits/syscall.h', 'SYS_listmount') + conf.set('SYS_listmount', '__NR_listmount') +endif + +conf.set('HAVE_STATMOUNT_API', have_statmount and have_listmount ? 1 : false) + have_sys_vfs_header = cc.has_header('sys/vfs.h') @@ -697,10 +716,6 @@ have = cc.has_member('struct stat', 'st_mtim.tv_nsec', prefix : '#include ') conf.set('HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC', have ? 1 : false) -have = cc.has_member('struct statx', 'stx_mnt_id', - prefix : '#include ') -conf.set('HAVE_STRUCT_STATX_STX_MNT_ID', have ? 1 : false) - # replacement for AC_STRUCT_TIMEZONE have = cc.has_member('struct tm', 'tm_zone', args : '-D_GNU_SOURCE', -- 2.47.3