is there any reason to *explicitly* include a UAPI header file?
i'm well aware of the header file search path defined in the
top-level Makefile:
# Use USERINCLUDE when you must reference the UAPI directories only.
USERINCLUDE := \
-I$(srctree)/arch/$(hdr-arch)/include/uapi \
-Iarch/$(hdr-arch)/include/generated/uapi \
-I$(srctree)/include/uapi \
-Iinclude/generated/uapi \
-include $(srctree)/include/linux/kconfig.h
# Use LINUXINCLUDE when you must reference the include/ directory.
# Needed to be compatible with the O= option
LINUXINCLUDE := \
-I$(srctree)/arch/$(hdr-arch)/include \
-Iarch/$(hdr-arch)/include/generated/uapi \
-Iarch/$(hdr-arch)/include/generated \
$(if $(KBUILD_SRC), -I$(srctree)/include) \
-Iinclude \
$(USERINCLUDE)so given that "kernel" header files will be found before "user" header files of the same name, is there any defense to doing something like this in include/linux/netdevice.h:
#include <uapi/linux/netdevice.h> #include <uapi/linux/if_bonding.h> #include <uapi/linux/pkt_cls.h>
why would someone, in kernel code, explicitly include a header file in uapi/?
it would seem that there are two possibilities. if there is only one
version of that file in uapi/, it'll be found eventually, and if there is a version of that file in, say, include/linux/, then it's the one that should be included, because one assumes that version would include the one under uapi/, no?
thoughts? am i just massively misunderstanding something?
rday
Signature · 7 lines
========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================