Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755131AbbFRS63 (ORCPT ); Thu, 18 Jun 2015 14:58:29 -0400 Received: from mail-la0-f44.google.com ([209.85.215.44]:33837 "EHLO mail-la0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752251AbbFRS6T (ORCPT ); Thu, 18 Jun 2015 14:58:19 -0400 MIME-Version: 1.0 In-Reply-To: <9141492.JqTlmk9dHk@wuerfel> References: <9141492.JqTlmk9dHk@wuerfel> From: Andy Lutomirski Date: Thu, 18 Jun 2015 11:57:56 -0700 Message-ID: Subject: Re: UAPI headers including non-UAPI headers by accident? To: Arnd Bergmann Cc: Michael Kerrisk-manpages , Andy Lutomirski , "linux-kernel@vger.kernel.org" , Linux API , David Woodhouse Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1866 Lines: 57 On Thu, Jun 18, 2015 at 12:58 AM, Arnd Bergmann wrote: > On Thursday 18 June 2015 09:52:36 Michael Kerrisk wrote: >> [CC += David] >> >> On 2 June 2015 at 18:36, Andy Lutomirski wrote: >> > include/uapi/linux/signal.h starts with: >> > >> > #ifndef _UAPI_LINUX_SIGNAL_H >> > #define _UAPI_LINUX_SIGNAL_H >> > >> > #include >> > #include >> > >> > This causes it to include , which is not the same thing >> > as . Changing that will break userspace use of >> > this header, though, as the uapi/ won't get removed. >> > >> > What's the correct fix? This is causing trouble with a UML build for me. >> >> Perhaps David has some insight, since he architected the original UAPI split. > > The uapi headers are installed without the uapi prefix. This means > that inside of the kernel, we get > > > linux/signal.h > -> uapi/linux/signal.h > -> asm/signal.h > -> uapi/asm/signal.h > > while in the installed headers we just get > > linux/signal.h > -> asm/signal.h > > This all looks right to me: user space only sees the exported portions > under the traditional names, while the kernel sees both the kernel-side > and user-side definitions from the same path. > It seems counterintuitive and error-prone to me that including would pull in non-UAPI asm/signal.h declarations in the kernel but not when used from userspace. It would make it very easy to break the header such that it's only broken in a userspace context. --Andy -- Andy Lutomirski AMA Capital Management, LLC -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/