Skip to content

Commit f252853

Browse files
author
wlingze
committed
glibc-2.36 patch
1 parent 12682ea commit f252853

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

linux-user/syscall.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,25 @@
9595
#include <linux/soundcard.h>
9696
#include <linux/kd.h>
9797
#include <linux/mtio.h>
98+
99+
#ifdef HAVE_SYS_MOUNT_FSCONFIG
100+
/*
101+
* glibc >= 2.36 linux/mount.h conflicts with sys/mount.h,
102+
* which in turn prevents use of linux/fs.h. So we have to
103+
* define the constants ourselves for now.
104+
*/
105+
#define FS_IOC_GETFLAGS _IOR('f', 1, long)
106+
#define FS_IOC_SETFLAGS _IOW('f', 2, long)
107+
#define FS_IOC_GETVERSION _IOR('v', 1, long)
108+
#define FS_IOC_SETVERSION _IOW('v', 2, long)
109+
#define FS_IOC_FIEMAP _IOWR('f', 11, struct fiemap)
110+
#define FS_IOC32_GETFLAGS _IOR('f', 1, int)
111+
#define FS_IOC32_SETFLAGS _IOW('f', 2, int)
112+
#define FS_IOC32_GETVERSION _IOR('v', 1, int)
113+
#define FS_IOC32_SETVERSION _IOW('v', 2, int)
114+
#else
98115
#include <linux/fs.h>
116+
#endif
99117
#include <linux/fd.h>
100118
#if defined(CONFIG_FIEMAP)
101119
#include <linux/fiemap.h>

meson.build

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,6 +1149,9 @@ config_host_data.set('HAVE_PTY_H', cc.has_header('pty.h'))
11491149
config_host_data.set('HAVE_SYS_IOCCOM_H', cc.has_header('sys/ioccom.h'))
11501150
config_host_data.set('HAVE_SYS_KCOV_H', cc.has_header('sys/kcov.h'))
11511151
config_host_data.set('HAVE_SYSTEM_FUNCTION', cc.has_function('system', prefix: '#include <stdlib.h>'))
1152+
config_host_data.set('HAVE_SYS_MOUNT_FSCONFIG',
1153+
cc.has_header_symbol('sys/mount.h', 'FSCONFIG_SET_FLAG'))
1154+
11521155

11531156
config_host_data.set('CONFIG_PREADV', cc.has_function('preadv', prefix: '#include <sys/uio.h>'))
11541157

0 commit comments

Comments
 (0)