Hi Keno, On 05/26/2018 02:23 AM, k...@juliacomputing.com wrote: > From: Keno Fischer <k...@alumni.harvard.edu> > > - Guard two Linux only headers. > - Define `ENOATTR` only if not only defined > (it's defined in system headers on Darwin). > > Signed-off-by: Keno Fischer <k...@juliacomputing.com> > --- > fsdev/file-op-9p.h | 2 ++ > hw/9pfs/9p-local.c | 2 ++ > include/qemu/xattr.h | 4 +++- > 3 files changed, 7 insertions(+), 1 deletion(-) > > diff --git a/fsdev/file-op-9p.h b/fsdev/file-op-9p.h > index 3fa062b..a13e729 100644 > --- a/fsdev/file-op-9p.h > +++ b/fsdev/file-op-9p.h > @@ -16,7 +16,9 @@ > > #include <dirent.h> > #include <utime.h> > +#ifdef CONFIG_LINUX
What about a less restrictive: #ifndef __APPLE__ > #include <sys/vfs.h> > +#endif > #include "qemu-fsdev-throttle.h" > > #define SM_LOCAL_MODE_BITS 0600 > diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c > index b37b1db..f6c7526 100644 > --- a/hw/9pfs/9p-local.c > +++ b/hw/9pfs/9p-local.c > @@ -27,10 +27,12 @@ > #include "qemu/error-report.h" > #include "qemu/option.h" > #include <libgen.h> > +#ifdef CONFIG_LINUX > #include <linux/fs.h> > #ifdef CONFIG_LINUX_MAGIC_H > #include <linux/magic.h> > #endif > +#endif > #include <sys/ioctl.h> > > #ifndef XFS_SUPER_MAGIC > diff --git a/include/qemu/xattr.h b/include/qemu/xattr.h > index a83fe8e..f1d0f7b 100644 > --- a/include/qemu/xattr.h > +++ b/include/qemu/xattr.h > @@ -22,7 +22,9 @@ > #ifdef CONFIG_LIBATTR > # include <attr/xattr.h> > #else > -# define ENOATTR ENODATA > +# if !defined(ENOATTR) > +# define ENOATTR ENODATA > +# endif > # include <sys/xattr.h> > #endif > Rest looks correct.