internal / external include files

Konstantin Andreev andreev at swemel.ru
Thu Jul 25 01:45:32 EDT 2019


Hi, Martin.

The [$KERNEL_ROOT/include/uapi/linux/stddef.h] you are talking about is just a few lines:

| #include <linux/compiler_types.h>
|
| #ifndef __always_inline
| #define __always_inline inline
| #endif

it turns into

| #ifndef __always_inline
| #define __always_inline inline
| #endif

after [make headers_install] installs it into [/usr/include/linux/stddef.h].

Userspace applications shall not use kernel tree directly.

Regards, Konstantin.

Martin Kaiser, 25 jul 2010 00:20 msk:
>
> I called gcc with -I $KERNEL_ROOT/include/uapi. This is the chain of files that were included.
>
> my_app.c
>     $GCC_SYSROOT/usr/include/netinet/in.h
>        ...
>
> and the error is
>
> $KERNEL_ROOT/include/uapi/linux/stddef.h:2:34: fatal error: linux/compiler_types.h: No such file or directory #include <linux/compiler_types.h>
>
> Best regards, Martin



More information about the Kernelnewbies mailing list