I'm writing a kernel module and I've begun to look into sockets. I've been able to include other linux headers, use their functions, and the makefile will be fine. When I include linux/socket.h, the compiler is able to find the file, but if I call socket()
or connect()
or such, it says they are implicitly declared. How would I be able to fix this?
I've used cat to look into the file to make sure it's correct, which it is. I've tried just hardcoding the location
/usr/src/linux-headers-4.18.0-17-generic/linux/socket.h
I've also tried using linux-headers-4.18.0-17's socket.h but that also doesn't work.
one of the errors: error: implicit declaration of function 'socket'; did you mean 'sget'? [-Werror=implicit-function--declaration]