Find the answer to your Linux question:
Results 1 to 4 of 4
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 ...
  1. #1
    Just Joined!
    Join Date
    May 2009
    Posts
    2

    Question 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?

    *ps: I'm coding in kernel space.

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    In the 2.6 kernel code I have, there is an extern int errno declared in linux/unistd.h. My guess is that if you declare an external int to that variable, you should be ok.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    May 2009
    Posts
    2
    I don't think it would work to do like that, for in kernel-2.6.27, there is no definition of errno in linux/unistd.h. All the file where variable errno appears are in folder arch.

  4. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    Quote Originally Posted by ao_yuan_young View Post
    I don't think it would work to do like that, for in kernel-2.6.27, there is no definition of errno in linux/unistd.h. All the file where variable errno appears are in folder arch.
    Well, there was in 2.6.18 kernels. Have you tried just declaring an extern int errno; in your code? It could be defined in the assembly language modules somewhere.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...