aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-support/numactl/files/0001-include-sys-sysmacros.h-for-major-minor.patch
blob: db157b388cb5480fe9f229a4c483a140f465b438 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
From 25691a084a2012a339395ade567dbae814e237e9 Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
Date: Mon, 18 Apr 2016 18:49:51 -0400
Subject: [PATCH] include sys/sysmacros.h for major/minor

These functions are not part of any official spec, and glibc has always
kept them in sys/sysmacros.h.  As glibc moves to conform to POSIX, and
more alternative C libraries come up, we need to include this header
explicitly to get the prototypes.  Otherwise we fail to build like:

affinity.c: In function 'affinity_file':
affinity.c:177:7: warning: implicit declaration of function 'major' [-Wimplicit-function-declaration]
   if (major(d) != maj || minor(d) != min)
       ^
affinity.c:177:26: warning: implicit declaration of function 'minor' [-Wimplicit-function-declaration]
   if (major(d) != maj || minor(d) != min)
                          ^
./.libs/libnuma.so: undefined reference to 'minor'
./.libs/libnuma.so: undefined reference to 'major'
collect2: error: ld returned 1 exit status

See downstream bug: https://bugs.gentoo.org/580098
---
 affinity.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/affinity.c b/affinity.c
index c460acf..85597fc 100644
--- a/affinity.c
+++ b/affinity.c
@@ -40,6 +40,7 @@
 #include <linux/rtnetlink.h>
 #include <linux/netlink.h>
 #include <sys/types.h>
+#include <sys/sysmacros.h>
 #include <ctype.h>
 #include <assert.h>
 #include <regex.h>
-- 
2.11.1