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
epoll.h
eventfd.h
fanotify.h
fsuid.h
inotify.h
kd.h
klog.h
mount.h linux: Fix sys/mount.h usage with kernel headers 2022-08-12 09:15:28 -03:00
pci.h
personality.h
pidfd.h linux: Add pidfd_send_signal 2022-05-17 10:33:46 -03:00
prctl.h
procfs.h
ptrace.h
quota.h
raw.h
reboot.h
rseq.h Linux: Adjust struct rseq definition to current kernel version 2022-06-02 16:29:59 +02:00
signalfd.h
soundcard.h
swap.h
syscall.h
sysinfo.h
timerfd.h
timex.h
ttydefaults.h
user.h
vt.h