tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
Add missing files
Shea Levy
8 years ago
e3f947a1
4839b568
+200
1 changed file
expand all
collapse all
unified
split
pkgs
applications
virtualization
qemu
statfs-flags.patch
+200
pkgs/applications/virtualization/qemu/statfs-flags.patch
reviewed
···
1
1
+
commit d3282d2512774dc5027c98930a3852b2b6e8407a
2
2
+
Author: Shea Levy <shea@shealevy.com>
3
3
+
Date: Sun Feb 18 13:50:11 2018 -0500
4
4
+
5
5
+
linux-user: Support f_flags in statfs when available.
6
6
+
7
7
+
Signed-off-by: Shea Levy <shea@shealevy.com>
8
8
+
9
9
+
diff --git a/configure b/configure
10
10
+
index 913e14839d..52fe2bf941 100755
11
11
+
--- a/configure
12
12
+
+++ b/configure
13
13
+
@@ -5303,6 +5303,22 @@ if compile_prog "" "" ; then
14
14
+
have_utmpx=yes
15
15
+
fi
16
16
+
17
17
+
+##########################################
18
18
+
+# Check for newer fields of struct statfs on Linux
19
19
+
+
20
20
+
+if test "$linux_user" = "yes"; then
21
21
+
+ cat > $TMPC <<EOF
22
22
+
+#include <sys/vfs.h>
23
23
+
+
24
24
+
+int main(void) {
25
25
+
+ struct statfs fs;
26
26
+
+ fs.f_flags = 0;
27
27
+
+}
28
28
+
+EOF
29
29
+
+ if compile_object ; then
30
30
+
+ have_statfs_flags=yes
31
31
+
+ fi
32
32
+
+fi
33
33
+
##########################################
34
34
+
# checks for sanitizers
35
35
+
36
36
+
@@ -6518,6 +6534,10 @@ if test "$have_utmpx" = "yes" ; then
37
37
+
echo "HAVE_UTMPX=y" >> $config_host_mak
38
38
+
fi
39
39
+
40
40
+
+if test "$have_statfs_flags" = "yes" ; then
41
41
+
+ echo "HAVE_STATFS_FLAGS=y" >> $config_host_mak
42
42
+
+fi
43
43
+
+
44
44
+
if test "$ivshmem" = "yes" ; then
45
45
+
echo "CONFIG_IVSHMEM=y" >> $config_host_mak
46
46
+
fi
47
47
+
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
48
48
+
index 82b35a6bdf..77481eca2c 100644
49
49
+
--- a/linux-user/syscall.c
50
50
+
+++ b/linux-user/syscall.c
51
51
+
@@ -9534,6 +9534,9 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
52
52
+
__put_user(stfs.f_fsid.__val[1], &target_stfs->f_fsid.val[1]);
53
53
+
__put_user(stfs.f_namelen, &target_stfs->f_namelen);
54
54
+
__put_user(stfs.f_frsize, &target_stfs->f_frsize);
55
55
+
+#ifdef HAVE_STATFS_FLAGS
56
56
+
+ __put_user(stfs.f_flags, &target_stfs->f_flags);
57
57
+
+#endif
58
58
+
memset(target_stfs->f_spare, 0, sizeof(target_stfs->f_spare));
59
59
+
unlock_user_struct(target_stfs, arg2, 1);
60
60
+
}
61
61
+
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
62
62
+
index a35c52a60a..9f90451caf 100644
63
63
+
--- a/linux-user/syscall_defs.h
64
64
+
+++ b/linux-user/syscall_defs.h
65
65
+
@@ -362,7 +362,14 @@ struct kernel_statfs {
66
66
+
int f_ffree;
67
67
+
kernel_fsid_t f_fsid;
68
68
+
int f_namelen;
69
69
+
+#ifdef HAVE_STATFS_FLAGS
70
70
+
+ int f_frsize;
71
71
+
+ int f_flags;
72
72
+
+ int f_spare[4];
73
73
+
+#else
74
74
+
int f_spare[6];
75
75
+
+#endif
76
76
+
+
77
77
+
};
78
78
+
79
79
+
struct target_dirent {
80
80
+
@@ -2223,7 +2230,13 @@ struct target_statfs {
81
81
+
/* Linux specials */
82
82
+
target_fsid_t f_fsid;
83
83
+
int32_t f_namelen;
84
84
+
+#ifdef HAVE_STATFS_FLAGS
85
85
+
+ int32_t f_frsize;
86
86
+
+ int32_t f_flags;
87
87
+
+ int32_t f_spare[4];
88
88
+
+#else
89
89
+
int32_t f_spare[6];
90
90
+
+#endif
91
91
+
};
92
92
+
#else
93
93
+
struct target_statfs {
94
94
+
@@ -2239,7 +2252,13 @@ struct target_statfs {
95
95
+
/* Linux specials */
96
96
+
target_fsid_t f_fsid;
97
97
+
abi_long f_namelen;
98
98
+
+#ifdef HAVE_STATFS_FLAGS
99
99
+
+ abi_long f_frsize;
100
100
+
+ abi_long f_flags;
101
101
+
+ abi_long f_spare[4];
102
102
+
+#else
103
103
+
abi_long f_spare[6];
104
104
+
+#endif
105
105
+
};
106
106
+
#endif
107
107
+
108
108
+
@@ -2255,7 +2274,13 @@ struct target_statfs64 {
109
109
+
uint64_t f_bavail;
110
110
+
target_fsid_t f_fsid;
111
111
+
uint32_t f_namelen;
112
112
+
+#ifdef HAVE_STATFS_FLAGS
113
113
+
+ uint32_t f_frsize;
114
114
+
+ uint32_t f_flags;
115
115
+
+ uint32_t f_spare[4];
116
116
+
+#else
117
117
+
uint32_t f_spare[6];
118
118
+
+#endif
119
119
+
};
120
120
+
#elif (defined(TARGET_PPC64) || defined(TARGET_X86_64) || \
121
121
+
defined(TARGET_SPARC64) || defined(TARGET_AARCH64)) && \
122
122
+
@@ -2271,7 +2296,12 @@ struct target_statfs {
123
123
+
target_fsid_t f_fsid;
124
124
+
abi_long f_namelen;
125
125
+
abi_long f_frsize;
126
126
+
+#ifdef HAVE_STATFS_FLAGS
127
127
+
+ abi_long f_flags;
128
128
+
+ abi_long f_spare[4];
129
129
+
+#else
130
130
+
abi_long f_spare[5];
131
131
+
+#endif
132
132
+
};
133
133
+
134
134
+
struct target_statfs64 {
135
135
+
@@ -2285,7 +2315,12 @@ struct target_statfs64 {
136
136
+
target_fsid_t f_fsid;
137
137
+
abi_long f_namelen;
138
138
+
abi_long f_frsize;
139
139
+
+#ifdef HAVE_STATFS_FLAGS
140
140
+
+ abi_long f_flags;
141
141
+
+ abi_long f_spare[4];
142
142
+
+#else
143
143
+
abi_long f_spare[5];
144
144
+
+#endif
145
145
+
};
146
146
+
#elif defined(TARGET_S390X)
147
147
+
struct target_statfs {
148
148
+
@@ -2299,7 +2334,13 @@ struct target_statfs {
149
149
+
kernel_fsid_t f_fsid;
150
150
+
int32_t f_namelen;
151
151
+
int32_t f_frsize;
152
152
+
+#ifdef HAVE_STATFS_FLAGS
153
153
+
+ int32_t f_flags;
154
154
+
+ int32_t f_spare[4];
155
155
+
+#else
156
156
+
int32_t f_spare[5];
157
157
+
+#endif
158
158
+
+
159
159
+
};
160
160
+
161
161
+
struct target_statfs64 {
162
162
+
@@ -2313,7 +2354,12 @@ struct target_statfs64 {
163
163
+
kernel_fsid_t f_fsid;
164
164
+
int32_t f_namelen;
165
165
+
int32_t f_frsize;
166
166
+
+#ifdef HAVE_STATFS_FLAGS
167
167
+
+ int32_t f_flags;
168
168
+
+ int32_t f_spare[4];
169
169
+
+#else
170
170
+
int32_t f_spare[5];
171
171
+
+#endif
172
172
+
};
173
173
+
#else
174
174
+
struct target_statfs {
175
175
+
@@ -2327,7 +2373,12 @@ struct target_statfs {
176
176
+
target_fsid_t f_fsid;
177
177
+
uint32_t f_namelen;
178
178
+
uint32_t f_frsize;
179
179
+
+#ifdef HAVE_STATFS_FLAGS
180
180
+
+ uint32_t f_flags;
181
181
+
+ uint32_t f_spare[4];
182
182
+
+#else
183
183
+
uint32_t f_spare[5];
184
184
+
+#endif
185
185
+
};
186
186
+
187
187
+
struct target_statfs64 {
188
188
+
@@ -2341,7 +2392,12 @@ struct target_statfs64 {
189
189
+
target_fsid_t f_fsid;
190
190
+
uint32_t f_namelen;
191
191
+
uint32_t f_frsize;
192
192
+
+#ifdef HAVE_STATFS_FLAGS
193
193
+
+ uint32_t f_flags;
194
194
+
+ uint32_t f_spare[4];
195
195
+
+#else
196
196
+
uint32_t f_spare[5];
197
197
+
+#endif
198
198
+
};
199
199
+
#endif
200
200
+