some questions about errno.h

Michael Clarke michaelfclarke at
Sun Jan 2 04:41:20 EST 2011

Hi Vichy

I found there are 2 errno.h we can include when coding.
> #include <asm-generic/errno.h> and #include <linux/errno.h>
> is there difference or rue I need to follow when I want to take
> advantage of errno in kernel?

Looking at my sources you should use linux/errno.h. When I look, I see the

#ifndef _LINUX_ERRNO_H
#define _LINUX_ERRNO_H

#include <asm/errno.h>


#include <asm-generic/errno.h>


#include <asm-generic/errno-base.h>

#define EDEADLK         35      /* Resource deadlock would occur */
#define ENAMETOOLONG    36      /* File name too long */
#define ENOLCK          37      /* No record locks available */
#define ENOSYS          38      /* Function not implemented */

So, it only makes sense to use linux/errno.h in my opinion.

Hope this helps,

Michael F Clarke
MEng Software Engineering
PhD Candidate, Aberystwyth University

Help fight cancer with your spare CPU time:
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the Kernelnewbies mailing list