linux-numa.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: linux-numa@vger.kernel.org
Subject: [PATCH] include sys/sysmacros.h for major/minor
Date: Mon, 18 Apr 2016 18:57:14 -0400	[thread overview]
Message-ID: <1461020234-20384-1-git-send-email-vapier@gentoo.org> (raw)

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

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 affinity.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/affinity.c b/affinity.c
index 9fbd6af..984291c 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.7.4

                 reply	other threads:[~2016-04-18 22:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1461020234-20384-1-git-send-email-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=linux-numa@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).