From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8CFDAC7618B for ; Wed, 24 Jul 2019 09:21:54 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4A7B2229F3 for ; Wed, 24 Jul 2019 09:21:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=kroah.com header.i=@kroah.com header.b="jTAhKEP5"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="gfYuhG45" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4A7B2229F3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kroah.com Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.92) (envelope-from ) id 1hqDSs-0001Pa-Cq; Wed, 24 Jul 2019 05:21:38 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1hqDSq-0001P3-69 for kernelnewbies@kernelnewbies.org; Wed, 24 Jul 2019 05:21:36 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 421B221F1E for ; Wed, 24 Jul 2019 05:21:35 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 24 Jul 2019 05:21:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kroah.com; h= date:from:to:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=3QAb60eydtN2xHZ/HVBVvIMuzBI Kmj/zv1T2dhyaMHA=; b=jTAhKEP50r2E4JTu3uu+x9QWp38dcYSFrVE5V5O7GIp vNXm6yckVY+RPtsk/Z/gHNeXCvEXzviRwhZnkNRblmu1KCh/Kr7xruQP2nCwB2rO /ohsohGCdt379Y4eHVA1LfoKzma7pyKx8im0VldFU9hZXGM3c4oL+9d1ogSuWAM3 JZuHA9VmWeL+q6x9QZ+tqitDemjEMAXJQ1F4WDSEWXwDCL9OYHIrhVPzVDwNYS2o prwdqUwANlRcMUjvdlsP8IXN0Dga2wSBtfkPrdNSvU0lnWTi36p1etU6Pd++as/p C/lqIKBX6Ecxo4oO8CcijGrSGjlDhPO9s+2vlnUun1Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=3QAb60 eydtN2xHZ/HVBVvIMuzBIKmj/zv1T2dhyaMHA=; b=gfYuhG45ToIIDMwq6hh1iO 6rhTa8nB7N3wf9IlmN89yNvRXlijnPQ/VQA1o4kwzuGCwZoz6VoN5f6fDe/sV9uY dLuiR8kkuvxdJFxyuerPz2XfjuaVYgu4nv4NU5GZ0f6UagYXRJPQawGx1pBi46Vx GrHY/RZlI6KBYOg6prfY5aQpVF2HSTNN8lGlRQ9epcYFlpkP5vBitEsQHpC8OuU3 Ei630p9kTs/QrG9p0RDfSJuPn3oyl11fhqUXJv+G09rsMLLMGKreLHL4Q/Q/NdxC XUZt+v4n2gXOxG3cbPLQc1wUOmMsNka22DwQ0pVmR+fdduVsP3RFU3bHWtcklpAQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrkedtgdduudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfhfgggtuggjfgesthdtre dttdervdenucfhrhhomhepifhrvghgucfmjfcuoehgrhgvgheskhhrohgrhhdrtghomheq necukfhppeekfedrkeeirdekledruddtjeenucfrrghrrghmpehmrghilhhfrhhomhepgh hrvghgsehkrhhorghhrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id 8463980068; Wed, 24 Jul 2019 05:21:34 -0400 (EDT) Date: Wed, 24 Jul 2019 11:21:33 +0200 From: Greg KH To: kernelnewbies@kernelnewbies.org Subject: Re: internal / external include files Message-ID: <20190724092133.GA6035@kroah.com> References: <20190724091100.lcfw3y7nbcelvgrc@viti.kaiser.cx> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190724091100.lcfw3y7nbcelvgrc@viti.kaiser.cx> User-Agent: Mutt/1.12.1 (2019-06-15) X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org On Wed, Jul 24, 2019 at 11:11:00AM +0200, Martin Kaiser wrote: > Dear all, > > is it correct that the files under include/uapi/ can be included by a > user space application? Yes. > I just ran into an error where my application ended up including > include/uapi/linux/stddef.h (with a number of intermediate steps). That's odd, what did you ask to be included that caused that? > This fails because the kernel's stddef.h includes > include/linux/compiler_types.h and this file is internal to > the kernel. What kernel version did this happen for? > What is the correct way to solve this? Should I fix my include path to > make sure that my application picks the stddef.h in the compiler's > sysroot rather than the kernel's stddef.h? The system stddef.h should always be used "first". > Or should include/uapi/linux/stddef.h guard the kernel-internal parts > using #ifdef __KERNEL__? There should no longer be any need for that. thanks, greg k-h _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies