LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 06:55 PM   #1
dbrazeau
Member
 
Registered: Aug 2009
Distribution: Fedora, OpenSuse, DENX Embedded Linux
Posts: 184

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, 10:20 PM   #2
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,862
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
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, 11:39 AM   #3
dbrazeau
Member
 
Registered: Aug 2009
Distribution: Fedora, OpenSuse, DENX Embedded Linux
Posts: 184

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, 12:08 PM   #4
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,862
Blog Entries: 1

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

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



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 12:45 AM
Building a new module into a Kernel dsylvester Slackware 4 10-03-2006 04:16 PM
building a hello world module sancho1980 Linux - Kernel 0 09-29-2006 08:29 PM
Undefined errno reference while compiling loadable module kesher Linux - Software 3 04-10-2006 01:22 AM
building a module pessanimahi Programming 17 10-06-2003 11:10 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:14 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration