LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   some question about kernel-2.4.20/lib/errno.c (https://www.linuxquestions.org/questions/linux-kernel-70/some-question-about-kernel-2-4-20-lib-errno-c-729323/)

ao.yuan.young 05-29-2009 09:23 AM

some question about kernel-2.4.20/lib/errno.c
 
In kernel-2.4.20, there was a file named errno.c in folder lib. And a global variable named errno was defined in this .c file. But in kernel-2.6.27, this file doesn't exist any more.
In my hand, there are some code based on kernel-2.4.20, and the global variable errno is used, so if compile the code in my hand based on kernel-2.6.27, an error is given: no definition of errno. How do I solve this problem?

ronl 05-29-2009 10:39 AM

To use 'errno'
 
In the source file where you are trying to access the system variable
'errno', include the file "errno.h". This file is found in usr/include/linux and points to subsequent include files where errno is defined.

ao.yuan.young 05-29-2009 08:50 PM

Quote:

Originally Posted by ronl (Post 3556660)
In the source file where you are trying to access the system variable
'errno', include the file "errno.h". This file is found in usr/include/linux and points to subsequent include files where errno is defined.

Thanks for your answer, but I am not coding in user space, but in kernel space. So, do you know in kernel space what I should do to solve this problem??

ronl 06-01-2009 10:10 AM

I am running RedHat Enterprise Linux, 2.6.18-53.1.4.el5.
The 'errno' files also exist in the kernel source code folders.
Check in .../include/asm-generic/ :

#include <asm-generic/errno.h>

Good luck


All times are GMT -5. The time now is 02:02 PM.