--- /dev/null
+https://bugzilla.gnome.org/show_bug.cgi?id=776532
+https://bugs.gentoo.org/580234
+
+--- a/metadata/meta-daemon.c
++++ b/metadata/meta-daemon.c
+@@ -27,6 +27,7 @@
+ #include <glib/gstdio.h>
+ #include <locale.h>
+ #include <stdlib.h>
++#include <sys/sysmacros.h>
+ #include "metatree.h"
+ #include "gvfsdaemonprotocol.h"
+ #include "metadata-dbus.h"
+--- a/metadata/metatree.c
++++ b/metadata/metatree.c
+@@ -1,4 +1,5 @@
+ #include "config.h"
++#include <sys/sysmacros.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/mman.h>