[Libguestfs] [PATCH 1/2] file: Add missing include for FALLOC_FL_*

Nir Soffer nsoffer at redhat.com
Mon Jul 30 16:03:50 UTC 2018


On Mon, Jul 30, 2018 at 6:38 PM Eric Blake <eblake at redhat.com> wrote:

> On 07/29/2018 06:35 AM, Nir Soffer wrote:
> > On RHEL 7.5 we need to include <linux/falloc.h> for FALLOC_FL_* macros.
> > Without the macros, fallocate is never used and we fall back to manual
> > zeroing.
> >
>
> > @@ -41,6 +41,7 @@
> >   #include <sys/types.h>
> >   #include <sys/stat.h>
> >   #include <errno.h>
> > +#include <linux/falloc.h>   /* For FALLOC_FL_* on RHEL, glibc < 2.18 */
>
> This header is not available on all platforms; does it need a configure
> check, or do we not care about non-Linux compilation?


I'm not sure if nbdkit tries to be portable, but I think we should care.

Is #if defined(__linux__) good enough for this?

Nir
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20180730/f952a1d2/attachment.htm>


More information about the Libguestfs mailing list