This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2] Coordinate if.h definitions for Linux and glibc (BZ #21367)


On 2017-04-10 03:48, Dmitry V. Levin wrote:
> On Sun, Apr 09, 2017 at 11:43:51PM +0200, Aurelien Jarno wrote:
> > This commit coordinates the definition of structures and enum already
> > defined the Linux kernel UAPI headers, following the procedure described
> > on https://sourceware.org/glibc/wiki/Synchronizing_Headers.
> > 
> > With this change, it is safe to include <net/if.h> and <linux/if.h> in
> > any order in a a userspace application.
> > 
> > Note: this as been fixed in commit 4a91cb61bb995 on the Linux side.
> > 
> > Changelog:
> > 	[BZ #21367]
> > 	* sysdeps/gnu/net/if.h: wrap IFF_* enums in
> > 	!defined __UAPI_DEF_IF_NET_DEVICE_FLAGS defines.
> > 	(struct ifmap): Wrap in !defined __UAPI_DEF_IF_IFMAP defines.
> > 	(struct ifreq): Wrap in !defined __UAPI_DEF_IF_IFREQ defines.
> > 	(struct ifconf): Wrap in !defined __UAPI_DEF_IF_IFCONF defines.
> > ---
> >  ChangeLog            | 9 +++++++++
> >  sysdeps/gnu/net/if.h | 9 +++++++++
> >  2 files changed, 18 insertions(+)
> > 
> > Changes v1 -> v2:
> >   Use '#ifndef' instead of '#if !' so that it also works with -Werror=undef
> 
> Please try to include this patched <net/if.h> after <linux/xattr.h>
> and see what's going to be defined.

Indeed you are correct. It seems that the way it's done on the Linux
side doesn't allow for any detection on the glibc side. Even worse
checking for _LINUX_IF_H in the glibc header doesn't work if the include
sequence is <linux/libc-compat.h>, <net/if.h> and <linux/if.h>.

I'll see what can be done on the kernel side first.

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                 http://www.aurel32.net

Attachment: signature.asc
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]