From e716d135557106410cdd46f01b865eaab3938fd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= Date: Wed, 5 Feb 2025 14:23:00 +0100 Subject: [PATCH] generic glibc: guard definitions of functions introduced in 2.36 --- lib/libc/include/generic-glibc/sys/mount.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/libc/include/generic-glibc/sys/mount.h b/lib/libc/include/generic-glibc/sys/mount.h index 0fdc9f3ad0..8f17a7bb09 100644 --- a/lib/libc/include/generic-glibc/sys/mount.h +++ b/lib/libc/include/generic-glibc/sys/mount.h @@ -235,6 +235,8 @@ struct mount_attr #define FSPICK_NO_AUTOMOUNT 0x00000004 #define FSPICK_EMPTY_PATH 0x00000008 +// zig patch: check target glibc version +#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 36) || __GLIBC__ > 2 #ifndef FSOPEN_CLOEXEC /* The type of fsconfig call made. */ @@ -268,6 +270,7 @@ enum fsconfig_command #define OPEN_TREE_CLONE 1 /* Clone the target tree and attach the clone */ #define OPEN_TREE_CLOEXEC O_CLOEXEC /* Close the file on execve() */ +#endif __BEGIN_DECLS @@ -282,6 +285,9 @@ extern int umount (const char *__special_file) __THROW; /* Unmount a filesystem. Force unmounting if FLAGS is set to MNT_FORCE. */ extern int umount2 (const char *__special_file, int __flags) __THROW; +// zig patch: check target glibc version +#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 36) || __GLIBC__ > 2 + /* Open the filesystem referenced by FS_NAME so it can be configured for mouting. */ extern int fsopen (const char *__fs_name, unsigned int __flags) __THROW; @@ -320,6 +326,8 @@ extern int mount_setattr (int __dfd, const char *__path, unsigned int __flags, struct mount_attr *__uattr, size_t __usize) __THROW; +#endif /* (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 36) || __GLIBC__ > 2 */ + __END_DECLS -#endif /* _SYS_MOUNT_H */ \ No newline at end of file +#endif /* _SYS_MOUNT_H */