Results 1 to 2 of 2
I am using errno (global variable) in my socket.c file of the kernel and have also include <bits/errno.h> file and also define Extern int errno in the socket.c file. I ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 12-26-2011 #1
- Join Date
- Dec 2011
undefined reference to errno
I am using errno (global variable) in my socket.c file of the kernel
and have also include <bits/errno.h> file and also define Extern int errno in the socket.c file. I have done this to check out the errors which are received when a client and server are running ....
To include the changes which i have made in the socket.c file i am compiling the kernel. But it is giving me error as
Undefined reference to errno
So, anyone please help me out..
- 12-26-2011 #2
- Join Date
- Apr 2009
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
As far as I know, the errno variable is NOT defined in the kernel. The errno.h files simply contain the error macro values, such as EBADF, etc. You will need to implement and set/read your own variable inside your kernel module(s). Some modules use error, and others use things like si_errno, etc. Also, some are ints and others are uint32 variables. Using an int is preferred, since there are times (not too common) when you may want to set a negative value for an error.Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!