glibc/sysdeps/unix/sysv/linux/sys
Adhemerval Zanella 774058d729 linux: Fix sys/mount.h usage with kernel headers
Now that kernel exports linux/mount.h and includes it on linux/fs.h,
its definitions might clash with glibc exports sys/mount.h.  To avoid
the need to rearrange the Linux header to be always after glibc one,
the glibc sys/mount.h is changed to:

  1. Undefine the macros also used as enum constants.  This covers prior
     inclusion of <linux/mount.h> (for instance MS_RDONLY).

  2. Include <linux/mount.h> based on the usual __has_include check
     (needs to use __has_include ("linux/mount.h") to paper over GCC
     bugs.

  3. Define enum fsconfig_command only if FSOPEN_CLOEXEC is not defined.
     (FSOPEN_CLOEXEC should be a very close proxy.)

  4. Define struct mount_attr if MOUNT_ATTR_SIZE_VER0 is not defined.
     (Added in the same commit on the Linux side.)

This patch also adds some tests to check if including linux/fs.h and
linux/mount.h after and before sys/mount.h does work.

Checked on x86_64-linux-gnu.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
2022-08-12 09:15:28 -03:00
..
acct.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
epoll.h Add access function attributes to epoll_wait 2022-03-14 20:02:43 +05:30
eventfd.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
fanotify.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
fsuid.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
inotify.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
kd.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
klog.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
mount.h linux: Fix sys/mount.h usage with kernel headers 2022-08-12 09:15:28 -03:00
pci.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
personality.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
pidfd.h linux: Add pidfd_send_signal 2022-05-17 10:33:46 -03:00
prctl.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
procfs.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
ptrace.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
quota.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
raw.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
reboot.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
rseq.h Linux: Adjust struct rseq definition to current kernel version 2022-06-02 16:29:59 +02:00
signalfd.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
soundcard.h update from main archive 961008 1996-10-08 23:39:20 +00:00
swap.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
syscall.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
sysinfo.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
timerfd.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
timex.h ntp_xxxtimex: Use __nonnull to avoid null pointer 2022-05-05 17:48:04 +05:30
ttydefaults.h Update. 1999-06-08 21:20:07 +00:00
user.h [BZ #6505] 2008-05-11 00:44:42 +00:00
vt.h update from main archive 1996-09-27 03:45:24 +00:00