blob: 2f2a9b87e17b7e8c272552ab9dfdd973bd1c684c [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001From 52bead95d2957437c691891fcdc49bd6afccdd49 Mon Sep 17 00:00:00 2001
2From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
3Date: Fri, 12 Apr 2024 18:45:13 +0200
4Subject: Create.c: fix uclibc build
5
6Define FALLOC_FL_ZERO_RANGE if needed as FALLOC_FL_ZERO_RANGE is only
7defined for aarch64 on uclibc-ng resulting in the following or1k build
8failure since commit 577fd10486d8d1472a6b559066f344ac30a3a391:
9
10Create.c: In function 'write_zeroes_fork':
11Create.c:155:35: error: 'FALLOC_FL_ZERO_RANGE' undeclared (first use in this function)
12 155 | if (fallocate(fd, FALLOC_FL_ZERO_RANGE | FALLOC_FL_KEEP_SIZE,
13 | ^~~~~~~~~~~~~~~~~~~~
14
15Fixes:
16 - http://autobuild.buildroot.org/results/0e04bcdb591ca5642053e1f7e31384f06581e989
17
18Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
19Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
20---
21 Create.c | 4 ++++
22 1 file changed, 4 insertions(+)
23
24--- a/Create.c
25+++ b/Create.c
26@@ -32,6 +32,10 @@
27 #include <sys/signalfd.h>
28 #include <sys/wait.h>
29
30+#ifndef FALLOC_FL_ZERO_RANGE
31+#define FALLOC_FL_ZERO_RANGE 16
32+#endif
33+
34 static int round_size_and_verify(unsigned long long *size, int chunk)
35 {
36 if (*size == 0)