Blame 0001-include-sys-sysmacros.h-for-major-minor.patch

9d877e
From 25691a084a2012a339395ade567dbae814e237e9 Mon Sep 17 00:00:00 2001
9d877e
From: Mike Frysinger <vapier@gentoo.org>
9d877e
Date: Mon, 18 Apr 2016 18:49:51 -0400
9d877e
Subject: [PATCH] include sys/sysmacros.h for major/minor
9d877e
9d877e
These functions are not part of any official spec, and glibc has always
9d877e
kept them in sys/sysmacros.h.  As glibc moves to conform to POSIX, and
9d877e
more alternative C libraries come up, we need to include this header
9d877e
explicitly to get the prototypes.  Otherwise we fail to build like:
9d877e
9d877e
affinity.c: In function 'affinity_file':
9d877e
affinity.c:177:7: warning: implicit declaration of function 'major' [-Wimplicit-function-declaration]
9d877e
   if (major(d) != maj || minor(d) != min)
9d877e
       ^
9d877e
affinity.c:177:26: warning: implicit declaration of function 'minor' [-Wimplicit-function-declaration]
9d877e
   if (major(d) != maj || minor(d) != min)
9d877e
                          ^
9d877e
./.libs/libnuma.so: undefined reference to 'minor'
9d877e
./.libs/libnuma.so: undefined reference to 'major'
9d877e
collect2: error: ld returned 1 exit status
9d877e
9d877e
See downstream bug: https://bugs.gentoo.org/580098
9d877e
---
9d877e
 affinity.c | 1 +
9d877e
 1 file changed, 1 insertion(+)
9d877e
9d877e
diff --git a/affinity.c b/affinity.c
9d877e
index c460acf..85597fc 100644
9d877e
--- a/affinity.c
9d877e
+++ b/affinity.c
9d877e
@@ -40,6 +40,7 @@
9d877e
 #include <linux/rtnetlink.h>
9d877e
 #include <linux/netlink.h>
9d877e
 #include <sys/types.h>
9d877e
+#include <sys/sysmacros.h>
9d877e
 #include <ctype.h>
9d877e
 #include <assert.h>
9d877e
 #include <regex.h>
9d877e
-- 
9d877e
2.15.1
9d877e