Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751453AbdHFU47 (ORCPT ); Sun, 6 Aug 2017 16:56:59 -0400 Received: from mail.kapsi.fi ([91.232.154.25]:40237 "EHLO mail.kapsi.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751342AbdHFU45 (ORCPT ); Sun, 6 Aug 2017 16:56:57 -0400 X-Greylist: delayed 869 seconds by postgrey-1.27 at vger.kernel.org; Sun, 06 Aug 2017 16:56:57 EDT Date: Sun, 6 Aug 2017 23:56:54 +0300 From: Mikko Rapeli To: Willem de Bruijn Cc: LKML , Linux API , Willem de Bruijn , Soheil Hassas Yeganeh , Network Development Subject: Re: [PATCH v06 18/36] uapi linux/errqueue.h: include linux/time.h in user space Message-ID: <20170806205654.GF28459@lakka.kapsi.fi> References: <20170806164428.2273-1-mikko.rapeli@iki.fi> <20170806164428.2273-19-mikko.rapeli@iki.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SA-Exim-Connect-IP: 2001:1bc8:1004::1 X-SA-Exim-Mail-From: mcfrisk@kapsi.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2127 Lines: 60 On Sun, Aug 06, 2017 at 04:23:16PM -0400, Willem de Bruijn wrote: > On Sun, Aug 6, 2017 at 12:44 PM, Mikko Rapeli wrote: > > linux/time.h conflicts with user space header time.h. Try to be compatible > > with both. > > > > Fixes userspace compilation error: > > > > error: array type has incomplete element type > > struct timespec ts[3]; > > > > Signed-off-by: Mikko Rapeli > > Cc: Willem de Bruijn > > Cc: Soheil Hassas Yeganeh > > Cc: netdev@vger.kernel.org > > --- > > include/uapi/linux/errqueue.h | 6 ++++++ > > 1 file changed, 6 insertions(+) > > > > diff --git a/include/uapi/linux/errqueue.h b/include/uapi/linux/errqueue.h > > index 07bdce1f444a..b310b2c6d94f 100644 > > --- a/include/uapi/linux/errqueue.h > > +++ b/include/uapi/linux/errqueue.h > > @@ -3,6 +3,12 @@ > > > > #include > > > > +#ifdef __KERNEL__ > > +#include > > +#else > > +#include > > +#endif /* __KERNEL__ */ > > This will break applications that include manually. > I previously sent a patch to use libc-compat to make compilation succeed > when both are included in the case where is included after > . > > https://lkml.org/lkml/2016/9/12/872 > > The inverse will require changes to the libc header to avoid redefining > symbols already defined by > > The second patch in that 2-patch set included > unconditionally after the fix. This broke builds that also included > in the wrong order. I did not resubmit the first patch as a > stand-alone, as it is not sufficient to avoid breakage. I wasn't aware of your change, but I was about to send this to fix the case when glibc is included before : https://github.com/mcfrisk/linux/commit/f3952a27b8a21c6478d26e6246055383483f6a66 but you also ran into problems where is included before which need fixes in libc header side. So how to proceed with these? I don't like leaving a few dozen non-compiling header files into uapi. -Mikko