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


Groups > linux.kernel > #1602066

Re: [PATCH 3/4] uapi glibc compat: Do not check for __USE_MISC

From Mikko Rapeli <mikko.rapeli@iki.fi>
Newsgroups linux.kernel
Subject Re: [PATCH 3/4] uapi glibc compat: Do not check for __USE_MISC
Date 2017-03-16 09:30 +0100
Message-ID <tlyXf-3YD-15@gated-at.bofh.it> (permalink)
References <tkjQB-7HV-7@gated-at.bofh.it> <tkjQC-7HV-21@gated-at.bofh.it> <tlyud-3u5-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Mar 16, 2017 at 07:59:12AM +0000, David Woodhouse wrote:
> On Sun, 2017-03-12 at 23:00 +0100, Hauke Mehrtens wrote:
> > __USE_MISC is glibc specific and not available in musl libc. Only do
> > this check when glibc is used. This fixes a problem with musl libc.
> > ...
> > -/* Coordinate with glibc net/if.h header. */
> > -#if defined(_NET_IF_H) && defined(__USE_MISC)
> > +/* Coordinate with libc net/if.h header. */
> > +#if defined(_NET_IF_H) && (!defined(__GLIBC__) || defined(__USE_MISC))
> 
> I *really* don't like building up a plethora of knowledge about
> specific libc implementations in the kernel. As a general rule, if we
> have *anything* that depends on __GLIBC__ then we are Doing It Wrong™.

Kernel does not depend on glibc but uapi headers check for some defintions
so that userspace code can include both libc and kernel header files
without compiler errors.

This interface between kernel and libc header files is messy due to long
history of copying header files from kernel to libc implementations etc
and thus this kind of ifdef magic with in depth knowledge of various
libc's defintions is currently unavoidable.

-Mikko

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


Thread

Re: [PATCH 3/4] uapi glibc compat: Do not check for __USE_MISC David Woodhouse <dwmw2@infradead.org> - 2017-03-16 09:00 +0100
  Re: [PATCH 3/4] uapi glibc compat: Do not check for __USE_MISC Mikko Rapeli <mikko.rapeli@iki.fi> - 2017-03-16 09:30 +0100
    Re: [PATCH 3/4] uapi glibc compat: Do not check for __USE_MISC Hauke Mehrtens <hauke@hauke-m.de> - 2017-03-17 19:20 +0100

csiph-web