This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Kernel header workarounds in linux/bits/sigcontext.h still necessary?
- From: Zack Weinberg <zackw at panix dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>, Andreas Jaeger <aj at suse dot de>
- Date: Tue, 28 May 2019 13:52:52 -0400
- Subject: Kernel header workarounds in linux/bits/sigcontext.h still necessary?
sysdeps/.../linux/bits/sigcontext.h contains two workarounds for buggy
kernel headers:
#ifndef sigcontext_struct
/* Kernel headers before 2.1.1 define a struct sigcontext_struct, but
we need sigcontext. */
# define sigcontext_struct sigcontext
# include <asm/sigcontext.h>
/* The Linux kernel headers redefine NULL wrongly, so cleanup afterwards. */
# define __need_NULL
# include <stddef.h>
#endif
The `sigcontext_struct` define has been there since the file was
created (in 1996) [1], and the attempt to recreate NULL (which,
incidentallly, will not work if stddef.h has already been included)
has been there since 2011 [2]. Neither appears to be necessary anymore
with Linux 4.19's uapi asm/sigcontext.h. Do we know how long ago the
kernel header bugs were fixed? Could we possibly remove the
workarounds?
cc:ing Andreas Jaeger who introduced the NULL workaround.
zw
[1] https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/i386/sigcontext.h;h=92733ab4471e2a8ee810960545b566e5bb79a76a;hb=cccda09fd700b0720f2ec3c7c516e0fedca4a6c2
[2] https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=6e502e19455c6110dd4487d91b7b7d6d8121f9ba