All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
To: netdev@vger.kernel.org
Cc: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Subject: [PATCH iproute2] Fix compilation with kernel headers < 3.4
Date: Mon, 26 Feb 2018 19:51:12 +0100	[thread overview]
Message-ID: <20180226185112.9657-1-thomas.de_schampheleire@nokia.com> (raw)

Since commit 596b1c94aa38e21b7a8c8562e8b61ccb744255d2, iproute2 uses types
__kernel_long_t and __kernel_ulong_t but does not provide internal
definitions for it.

This means that compilation using kernel headers that are older than 3.4
(where these types were added) will fail. This situation may be uncommon for
native compilation, but not uncommon for cross compilation where the
toolchains may be a bit older.

Provide the necessary types internally if not provided by the kernel
headers to fix compilation in such cases.

Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
---
 include/uapi/linux/posix_types.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/uapi/linux/posix_types.h b/include/uapi/linux/posix_types.h
index 9a7a740b..60f3d378 100644
--- a/include/uapi/linux/posix_types.h
+++ b/include/uapi/linux/posix_types.h
@@ -35,4 +35,13 @@ typedef int __kernel_mqd_t;
 
 #include <asm/posix_types.h>
 
+/* in case the kernel header asm/posix_types.h is too old (< 3.4) to provide
+ * __kernel_long_t, provide it here */
+#ifndef __kernel_long_t
+typedef long		__kernel_long_t;
+#endif
+#ifndef __kernel_ulong_t
+typedef unsigned long	__kernel_ulong_t;
+#endif
+
 #endif /* _LINUX_POSIX_TYPES_H */
-- 
2.16.1

             reply	other threads:[~2018-02-26 18:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-26 18:51 Thomas De Schampheleire [this message]
2018-02-26 18:58 ` [PATCH iproute2] Fix compilation with kernel headers < 3.4 Stephen Hemminger
2018-02-26 19:21   ` Thomas De Schampheleire
2018-02-26 19:27 ` Serhey Popovych
2018-02-26 19:46 Serhey Popovych
2018-02-26 19:48 ` Serhey Popovych
2018-02-26 20:32 ` Thomas De Schampheleire
2018-02-26 20:38   ` Serhey Popovych
2018-02-27 10:16 ` Thomas De Schampheleire
2018-02-27 12:21   ` Serhey Popovych

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=20180226185112.9657-1-thomas.de_schampheleire@nokia.com \
    --to=thomas.de_schampheleire@nokia.com \
    --cc=netdev@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.