Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to export a modified kernel header

I modified some files in the Linux kernel

include/linux/tcp.h
include/net/tcp.h 
net/ipv4/sysctl_net_ipv4.c
net/ipv4/tcp_output.c

Following this i compiled the modified Linux kernel

$ make modules_install  
$ make headers_install INSTALL_HDR_PATH=/usr/include  
$ make install  

The new kernel can start, everything seems normal. But when i tried to include the modified kernel header in my app, the compiler complains that the header does NOT define the types which i have just added. Upon checking /usr/include/netinet/tcp.h, i find that it is NOT the file i modified.

Q. How can i properly export modified Linux kernel headers to include in a C program ?

like image 626
xiao su Avatar asked Jul 26 '26 21:07

xiao su


1 Answers

A. Copy them to somewhere the code expects to find them, such as a directory you then pass to the compiler via -I, and then make sure that the code actually includes them.

like image 191
Ignacio Vazquez-Abrams Avatar answered Jul 30 '26 00:07

Ignacio Vazquez-Abrams



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!