Le lun. 25 oct. 2021 à 08:31, Michael Tokarev <m...@tls.msk.ru> a écrit : > > 22.10.2021 12:52, Fabrice Fontaine пишет: > > Include linux/falloc.h if CONFIG_FALLOCATE_ZERO_RANGE is defined to fix > > https://gitlab.com/qemu-project/qemu/-/commit/50482fda98bd62e072c30b7ea73c985c4e9d9bbb > > and avoid the following build failure on musl: > > > > ../block/export/fuse.c: In function 'fuse_fallocate': > > ../block/export/fuse.c:643:21: error: 'FALLOC_FL_ZERO_RANGE' undeclared > > (first use in this function) > > 643 | else if (mode & FALLOC_FL_ZERO_RANGE) { > > | ^~~~~~~~~~~~~~~~~~~~ > > > > Fixes: > > - > > http://autobuild.buildroot.org/results/be24433a429fda681fb66698160132c1c99bc53b > > > > Signed-off-by: Fabrice Fontaine <fontaine.fabr...@gmail.com> > > --- > > block/export/fuse.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/block/export/fuse.c b/block/export/fuse.c > > index 2e3bf8270b..823c126d23 100644 > > --- a/block/export/fuse.c > > +++ b/block/export/fuse.c > > @@ -31,6 +31,10 @@ > > #include <fuse.h> > > #include <fuse_lowlevel.h> > > > > +#if defined(CONFIG_FALLOCATE_ZERO_RANGE) > > shouldn't it be "if !defined" ? Nope, here is an extract of meson.build:
config_host_data.set('CONFIG_FALLOCATE_ZERO_RANGE', cc.has_header_symbol('linux/falloc.h', 'FALLOC_FL_ZERO_RANGE')) So, CONFIG_FALLOCATE_ZERO_RANGE is defined if FALLOC_FL_ZERO_RANGE is found in linux/falloc.h which is fine. However, because linux/falloc.h is not included in fuse.c, a build failure will be raised on musl (which does not define FALLOC_FL_ZERO_RANGE) > > /mjt > > > +#include <linux/falloc.h> > > +#endif > > + > > #ifdef __linux__ > > #include <linux/fs.h> > > #endif > > > Best Regards, Fabrice