From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/11289 Path: news.gmane.org!.POSTED!not-for-mail From: Hauke Mehrtens Newsgroups: gmane.linux.kernel.api,gmane.linux.lib.musl.general,gmane.linux.kernel Subject: Re: [musl] Re: [PATCH resent] uapi libc compat: allow non-glibc to opt out of uapi definitions Date: Tue, 25 Apr 2017 08:45:43 +0200 Message-ID: <21e624b9-7ab1-dcf9-fb1e-c31dd564a283@hauke-m.de> References: <20161111120820.GA435@nyan> <1488977188.4347.134.camel@infradead.org> <459a8faf-4585-5063-3d94-3a1fecfa8289@redhat.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1493102752 31618 195.159.176.226 (25 Apr 2017 06:45:52 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 25 Apr 2017 06:45:52 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 Cc: "David S. Miller" , linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: musl-ZwoEplunGu1jrUoiu81ncdBPR1lH4CV8@public.gmane.org, David Woodhouse , Felix Janda , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Original-X-From: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Tue Apr 25 08:45:46 2017 Return-path: Envelope-to: glka-linux-api@m.gmane.org Original-Received: from vger.kernel.org ([209.132.180.67]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d2uEK-0006KR-2e for glka-linux-api@m.gmane.org; Tue, 25 Apr 2017 08:45:44 +0200 Original-Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand id S980498AbdDYGpt (ORCPT ); Tue, 25 Apr 2017 02:45:49 -0400 Original-Received: from hauke-m.de ([5.39.93.123]:35592 "EHLO mail.hauke-m.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932761AbdDYGps (ORCPT ); Tue, 25 Apr 2017 02:45:48 -0400 Original-Received: from [192.168.0.100] (ip-109-45-3-139.web.vodafone.de [109.45.3.139]) by mail.hauke-m.de (Postfix) with ESMTPSA id CA7D1100306; Tue, 25 Apr 2017 08:45:45 +0200 (CEST) In-Reply-To: <459a8faf-4585-5063-3d94-3a1fecfa8289-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> Original-Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Precedence: bulk List-ID: X-Mailing-List: linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Xref: news.gmane.org gmane.linux.kernel.api:23080 gmane.linux.lib.musl.general:11289 gmane.linux.kernel:2463117 Archived-At: On 03/08/2017 05:39 PM, Carlos O'Donell wrote: > Any header needing compat with a libc includes libc-compat.h (per the > documented way the model works). With this patch any included linux kernel > header that also includes libc-compat.h would immediately define all > the __UAPI_DEF_* constants to 1 as-if it had defined those structures, > but it has not. > > For example, with these two patches applied, the inclusion of linux/if.h > would define __UAPI_DEF_XATTR to 1, but linux/if.h has not defined > XATTR_CREATE or other constants, so a subsequent inclusion sys/xattrs.h > from userspace would _not_ define XATTR_CREATE because __UAPI_DEF_XATTR set > to 1 indicates the kernel has. > > I don't want to read into the model you are proposing and would rather you > document the semantics clearly so we can all see what you mean. What about moving the code from libc-comapt.h into the specific header files? This way including linux/if.h would not have an impact on __UAPI_DEF_XATTR, because this is defined in linux/xattr.h. We would still have a problem when the specific Linux header file gets included before the libc header file, but at least musl does not support this anyway. Hauke