Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1630216

Re: [musl] Re: [PATCH resent] uapi libc compat: allow non-glibc to opt out of uapi definitions

From Hauke Mehrtens <hauke@hauke-m.de>
Newsgroups linux.kernel
Subject Re: [musl] Re: [PATCH resent] uapi libc compat: allow non-glibc to opt out of uapi definitions
Date 2017-04-25 08:50 +0200
Message-ID <tA2sp-17M-9@gated-at.bofh.it> (permalink)
References <sCiYi-4ee-21@gated-at.bofh.it> <tiJYS-7cO-19@gated-at.bofh.it> <tiMWJ-Kk-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [musl] Re: [PATCH resent] uapi libc compat: allow non-glibc to  opt out of uapi definitions Hauke Mehrtens <hauke@hauke-m.de> - 2017-04-25 08:50 +0200
  Re: [musl] Re: [PATCH resent] uapi libc compat: allow non-glibc to  opt out of uapi definitions Carlos O'Donell <carlos@redhat.com> - 2017-04-25 14:30 +0200
    Re: [musl] Re: [PATCH resent] uapi libc compat: allow non-glibc to  opt out of uapi definitions Rich Felker <dalias@libc.org> - 2017-04-25 19:10 +0200

csiph-web