[LTP] [PATCH v3] syscalls/mount_setattr01: Add basic functional test

Petr Vorel pvorel@suse.cz
Mon Apr 25 12:48:03 CEST 2022

Hi Chen, all,

> diff --git a/include/lapi/fsmount.h b/include/lapi/fsmount.h
> +
> +/*
> + * mount_setattr()
> + */
> +struct mount_attr {
If you build on new enough glibc (and apply to recent master), you get failures
due struct redefinition:

In file included from mount_setattr01.c:34:
../../../../include/lapi/fsmount.h:48:8: error: redefinition of ‘struct mount_attr’
   48 | struct mount_attr {
      |        ^~~~~~~~~~
In file included from ../../../../include/lapi/mount.h:11,
                 from ../../../../include/lapi/fsmount.h:15,
                 from mount_setattr01.c:34:
/usr/include/linux/mount.h:129:8: note: originally defined here

This is due my recent changes:

c0cb5d196 ("lapi/mount.h: Include kernel/libc header")

8ae596f8b ("lapi/fsmount.h: Include lapi/mount.h instead libc header")

This requires to put into configure.ac
AC_CHECK_TYPES([struct mount_attr],,,[
# include <linux/mount.h>
# include <sys/mount.h>

and here check for #ifndef HAVE_STRUCT_MOUNT_ATTR

Maybe it wasn't a good idea to combine <linux/mount.h> and <sys/mount.h>
(struct is only in <linux/mount.h>).

If we agree on it and this is the only issue, it can be applied before merge.

Kind regards,

More information about the ltp mailing list