LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 10-25-2011, 07:55 PM   #1
dbrazeau
Member
 
Registered: Aug 2009
Distribution: Fedora, OpenSuse, DENX Embedded Linux
Posts: 162

Rep: Reputation: 28
building module... errno undeclared


I'm trying to build a driver module, but I keep getting:
Code:
error: 'errno' undeclared (first use in this function)
I'm including <linux/errno.h>, and it apparently has no problem finding it, so why is errno still undeclared?
 
Old 10-25-2011, 11:20 PM   #2
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 1,883

Rep: Reputation: 520Reputation: 520Reputation: 520Reputation: 520Reputation: 520Reputation: 520
I think there is no errno when you are in the kernel space; return values between -4095 and -1 are the error codes.
 
Old 10-26-2011, 12:39 PM   #3
dbrazeau
Member
 
Registered: Aug 2009
Distribution: Fedora, OpenSuse, DENX Embedded Linux
Posts: 162

Original Poster
Rep: Reputation: 28
Quote:
Originally Posted by NevemTeve View Post
I think there is no errno when you are in the kernel space; return values between -4095 and -1 are the error codes.
I believe you are correct. If you return an negative number, the kernel will internally set errno to that value.
 
Old 10-26-2011, 01:08 PM   #4
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 1,883

Rep: Reputation: 520Reputation: 520Reputation: 520Reputation: 520Reputation: 520Reputation: 520
(When the supervisor call returns negative value, the C library sets the errno.)
 
Old 10-27-2011, 12:23 PM   #5
dbrazeau
Member
 
Registered: Aug 2009
Distribution: Fedora, OpenSuse, DENX Embedded Linux
Posts: 162

Original Poster
Rep: Reputation: 28
Quote:
Originally Posted by NevemTeve View Post
(When the supervisor call returns negative value, the C library sets the errno.)
Oh, ok. Thanks.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] ErrNo 14 and ErrNo 256 in yum server configuration nivedhitha Linux - Server 4 05-22-2011 01:45 AM
Building a new module into a Kernel dsylvester Slackware 4 10-03-2006 05:16 PM
building a hello world module sancho1980 Linux - Kernel 0 09-29-2006 09:29 PM
Undefined errno reference while compiling loadable module kesher Linux - Software 3 04-10-2006 02:22 AM
building a module pessanimahi Programming 17 10-06-2003 12:10 PM


All times are GMT -5. The time now is 04:12 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration