hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/tools/bpf/bpftool/feature.c
....@@ -135,12 +135,12 @@
135135
136136 /* Probing functions */
137137
138
-static int read_procfs(const char *path)
138
+static long read_procfs(const char *path)
139139 {
140140 char *endptr, *line = NULL;
141141 size_t len = 0;
142142 FILE *fd;
143
- int res;
143
+ long res;
144144
145145 fd = fopen(path, "r");
146146 if (!fd)
....@@ -162,7 +162,7 @@
162162
163163 static void probe_unprivileged_disabled(void)
164164 {
165
- int res;
165
+ long res;
166166
167167 /* No support for C-style ouptut */
168168
....@@ -181,14 +181,14 @@
181181 printf("Unable to retrieve required privileges for bpf() syscall\n");
182182 break;
183183 default:
184
- printf("bpf() syscall restriction has unknown value %d\n", res);
184
+ printf("bpf() syscall restriction has unknown value %ld\n", res);
185185 }
186186 }
187187 }
188188
189189 static void probe_jit_enable(void)
190190 {
191
- int res;
191
+ long res;
192192
193193 /* No support for C-style ouptut */
194194
....@@ -210,7 +210,7 @@
210210 printf("Unable to retrieve JIT-compiler status\n");
211211 break;
212212 default:
213
- printf("JIT-compiler status has unknown value %d\n",
213
+ printf("JIT-compiler status has unknown value %ld\n",
214214 res);
215215 }
216216 }
....@@ -218,7 +218,7 @@
218218
219219 static void probe_jit_harden(void)
220220 {
221
- int res;
221
+ long res;
222222
223223 /* No support for C-style ouptut */
224224
....@@ -240,7 +240,7 @@
240240 printf("Unable to retrieve JIT hardening status\n");
241241 break;
242242 default:
243
- printf("JIT hardening status has unknown value %d\n",
243
+ printf("JIT hardening status has unknown value %ld\n",
244244 res);
245245 }
246246 }
....@@ -248,7 +248,7 @@
248248
249249 static void probe_jit_kallsyms(void)
250250 {
251
- int res;
251
+ long res;
252252
253253 /* No support for C-style ouptut */
254254
....@@ -267,14 +267,14 @@
267267 printf("Unable to retrieve JIT kallsyms export status\n");
268268 break;
269269 default:
270
- printf("JIT kallsyms exports status has unknown value %d\n", res);
270
+ printf("JIT kallsyms exports status has unknown value %ld\n", res);
271271 }
272272 }
273273 }
274274
275275 static void probe_jit_limit(void)
276276 {
277
- int res;
277
+ long res;
278278
279279 /* No support for C-style ouptut */
280280
....@@ -287,7 +287,7 @@
287287 printf("Unable to retrieve global memory limit for JIT compiler for unprivileged users\n");
288288 break;
289289 default:
290
- printf("Global memory limit for JIT compiler for unprivileged users is %d bytes\n", res);
290
+ printf("Global memory limit for JIT compiler for unprivileged users is %ld bytes\n", res);
291291 }
292292 }
293293 }