[LTP] [PATCH 1/2] statmount.h: add check for STATMOUNT_MNT_NS_ID

Jack Morgan jmorgan@naotchy.com
Wed Sep 17 16:59:25 CEST 2025


On 9/15/25 02:15, Cyril Hrubis wrote:
> Hi!
>>> +/* Enable mnt_ns_id check when system struct statmount is not defined. */
>>> +#if !defined(HAVE_STRUCT_STATMOUNT) && !defined(LTP_HAVE_STATMOUNT_MNT_NS_ID)
>>> +#define LTP_HAVE_STATMOUNT_MNT_NS_ID 1
>>> +#endif
> 
> On a second look this looks like you are working around the
> fallback definition we have. But there is no configure check for
> STATMOUNT_MNT_NS_ID that has to be added to configure.ac, we need
> something as:
> 
> AC_CHECK_MEMBERS([struct statmount.mnt_ns_id],,,[#include <unistd.h>])
> 
> That would define HAVE_STRUCT_STATMOUNT_MNT_NS_ID if that field is
> present in the system headers.
> 
> And then we can use that with:
> 
> #if !defined(HAVE_STRUCT_STATMOUNT) || defined(HAVE_STRUCT_STATMOUNT_MNT_NS_ID)
> # define LTP_HAVE_STRUCT_STATMOUNT_MNT_NS_ID 1
> #endif

Thanks for the feedback. I'll send v2 of patches.

Cheers,
jmorgan




More information about the ltp mailing list