From patchwork Tue Apr 18 21:00:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hauke Mehrtens X-Patchwork-Id: 751996 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3w6yHv4zGHz9s2x for ; Wed, 19 Apr 2017 07:02:19 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932079AbdDRVB5 (ORCPT ); Tue, 18 Apr 2017 17:01:57 -0400 Received: from hauke-m.de ([5.39.93.123]:50648 "EHLO mail.hauke-m.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755365AbdDRVA5 (ORCPT ); Tue, 18 Apr 2017 17:00:57 -0400 Received: from hauke-desktop.lan (p20030086280AA000AB197C0F60BF2052.dip0.t-ipconnect.de [IPv6:2003:86:280a:a000:ab19:7c0f:60bf:2052]) by mail.hauke-m.de (Postfix) with ESMTPSA id D7E05100304; Tue, 18 Apr 2017 23:00:54 +0200 (CEST) From: Hauke Mehrtens To: davem@davemloft.net, netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, jarod@redhat.com, jogo@openwrt.org, david.heidelberger@ixit.cz, maillist-linux@barfooze.de, mikko.rapeli@iki.fi, dwmw2@infradead.org, Hauke Mehrtens Subject: [PATCH v2 1/3] uapi glibc compat: add libc compat code when not build for kernel Date: Tue, 18 Apr 2017 23:00:34 +0200 Message-Id: <20170418210036.26039-2-hauke@hauke-m.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170418210036.26039-1-hauke@hauke-m.de> References: <20170418210036.26039-1-hauke@hauke-m.de> X-Spam-Status: No, score=0.0 required=7.0 tests=UNPARSEABLE_RELAY, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on hauke-m.de Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Instead of checking if this header file is used in the glibc, check if it is not used in kernel context, this way it will also work with other libc implementations like musl. The __USE_MISC symbol is glibc specific and not available in musl libc. Only do this check when glibc is used. This is based on an older patch from David Heidelberger Acked-by: Mikko Rapeli Signed-off-by: Hauke Mehrtens --- include/uapi/linux/libc-compat.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h index 44b8a6bd5fe1..43a81136ea6e 100644 --- a/include/uapi/linux/libc-compat.h +++ b/include/uapi/linux/libc-compat.h @@ -48,11 +48,11 @@ #ifndef _UAPI_LIBC_COMPAT_H #define _UAPI_LIBC_COMPAT_H -/* We have included glibc headers... */ -#if defined(__GLIBC__) +/* We have included libc headers... */ +#if !defined(__KERNEL__) -/* Coordinate with glibc net/if.h header. */ -#if defined(_NET_IF_H) && defined(__USE_MISC) +/* Coordinate with libc net/if.h header. */ +#if defined(_NET_IF_H) && (!defined(__GLIBC__) || defined(__USE_MISC)) /* GLIBC headers included first so don't define anything * that would already be defined. */ @@ -168,7 +168,7 @@ /* If we did not see any headers from any supported C libraries, * or we are being included in the kernel, then define everything * that we need. */ -#else /* !defined(__GLIBC__) */ +#else /* defined(__KERNEL__) */ /* Definitions for if.h */ #define __UAPI_DEF_IF_IFCONF 1 @@ -208,6 +208,6 @@ /* Definitions for xattr.h */ #define __UAPI_DEF_XATTR 1 -#endif /* __GLIBC__ */ +#endif /* __KERNEL__ */ #endif /* _UAPI_LIBC_COMPAT_H */