netlink.h: Remove kernel.h include for userspace compatability
Some userspace programs want to use FD_ZERO, FD_SET, etc. but the
bionic headers have an old copy of the kernel headers and so
those defines (and __FD_ZERO, __FD_SET, etc.) are defined in
bionic's copy of kernel headers. If a program includes the
auto-generated kernel headers and the bionic kernel headers they
will have a problem because __FD_* macros are not defined. They
can override the posix_types.h header from the kernel and use the
bionic ones but this leads to another problem if they include
netlink.h (which they might do). If they include netlink.h this
kernel.h include will pull in sysinfo.h and that uses
__kernel_ulong_t which is defined in posix_types.h. Because the
program is overriding posix_types.h (to get the __FD_* macros)
the kernel version of posix_types.h won't be used and so
__kernel_ulong_t won't be defined and the build will fail. The
simplest solution is to just drop this kernel.h include and hope
that nobody uses netlink.h without including kernel.h as well. If
userspace uses the few macros in netlink.h that use the kernel.h
include we'll run into the same problem again.
Signed-off-by:
Stephen Boyd <sboyd@codeaurora.org>
Loading
Please register or sign in to comment