Linux/include/uapi/asm-generic/errno-base.h

Linux errno,linuxerrno

Linux/include/uapi/asm-generic/errno-base.h
#ifndef _ASM_GENERIC_ERRNO_BASE_H
#define _ASM_GENERIC_ERRNO_BASE_H

#define EPERM 1 /* Operation not permitted */
#define ENOENT 2 /* No such file or directory */
#define ESRCH 3 /* No such process */
#define EINTR 4 /* Interrupted system call */
#define EIO 5 /* I/O error */
#define ENXIO 6 /* No such device or address */
#define E2BIG 7 /* Argument list too long */
#define ENOEXEC 8 /* Exec format error */
#define EBADF 9 /* Bad file number */
#define ECHILD 10 /* No child processes */
#define EAGAIN 11 /* Try again */
#define ENOMEM 12 /* Out of memory */
#define EACCES 13 /* Permission denied */
#define EFAULT 14 /* Bad address */
#define ENOTBLK 15 /* Block device required */
#define EBUSY 16 /* Device or resource busy */
#define EEXIST 17 /* File exists */
#define EXDEV 18 /* Cross-device link */
#define ENODEV 19 /* No such device */
#define ENOTDIR 20 /* Not a directory */
#define EISDIR 21 /* Is a directory */
#define EINVAL 22 /* Invalid argument */
#define ENFILE 23 /* File table overflow */
#define EMFILE 24 /* Too many open files */
#define ENOTTY 25 /* Not a typewriter */
#define ETXTBSY 26 /* Text file busy */
#define EFBIG 27 /* File too large */
#define ENOSPC 28 /* No space left on device */
#define ESPIPE 29 /* Illegal seek */
#define EROFS 30 /* Read-only file system */
#define EMLINK 31 /* Too many links */
#define EPIPE 32 /* Broken pipe */
#define EDOM 33 /* Math argument out of domain of func */
#define ERANGE 34 /* Math result not representable */

#endif

Linux/include/uapi/asm-generic/errno.h
#ifndef _ASM_GENERIC_ERRNO_H
#define _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 */

/*
* This error code is special: arch syscall entry code will return
* -ENOSYS if users try to call a syscall that doesn’t exist. To keep
* failures of syscalls that really do exist distinguishable from
* failures due to attempts to use a nonexistent syscall, syscall
* implementations should refrain from returning -ENOSYS.
*/
#define ENOSYS 38 /* Invalid system call number */

#define ENOTEMPTY 39 /* Directory not empty */
#define ELOOP 40 /* Too many symbolic links encountered */
#define EWOULDBLOCK EAGAIN /* Operation would block */
#define ENOMSG 42 /* No message of desired type */
#define EIDRM 43 /* Identifier removed */
#define ECHRNG 44 /* Channel number out of range */
#define EL2NSYNC 45 /* Level 2 not synchronized */
#define EL3HLT 46 /* Level 3 halted */
#define EL3RST 47 /* Level 3 reset */
#define ELNRNG 48 /* Link number out of range */
#define EUNATCH 49 /* Protocol driver not attached */
#define ENOCSI 50 /* No CSI structure available */
#define EL2HLT 51 /* Level 2 halted */
#define EBADE 52 /* Invalid exchange */
#define EBADR 53 /* Invalid request descriptor */
#define EXFULL 54 /* Exchange full */
#define ENOANO 55 /* No anode */
#define EBADRQC 56 /* Invalid request code */
#define EBADSLT 57 /* Invalid slot */

#define EDEADLOCK EDEADLK

#define EBFONT 59 /* Bad font file format */
#define ENOSTR 60 /* Device not a stream */
#define ENODATA 61 /* No data available */
#define ETIME 62 /* Timer expired */
#define ENOSR 63 /* Out of streams resources */
#define ENONET 64 /* Machine is not on the network */
#define ENOPKG 65 /* Package not installed */
#define EREMOTE 66 /* Object is remote */
#define ENOLINK 67 /* Link has been severed */
#define EADV 68 /* Advertise error */
#define ESRMNT 69 /* Srmount error */
#define ECOMM 70 /* Communication error on send */
#define EPROTO 71 /* Protocol error */
#define EMULTIHOP 72 /* Multihop attempted */
#define EDOTDOT 73 /* RFS specific error */
#define EBADMSG 74 /* Not a data message */
#define EOVERFLOW 75 /* Value too large for defined data type */
#define ENOTUNIQ 76 /* Name not unique on network */
#define EBADFD 77 /* File descriptor in bad state */
#define EREMCHG 78 /* Remote address changed */
#define ELIBACC 79 /* Can not access a needed shared library */
#define ELIBBAD 80 /* Accessing a corrupted shared library */
#define ELIBSCN 81 /* .lib section in a.out corrupted */
【澳门金沙国际】指鹿为马对照表。 #define ELIBMAX 82 /* Attempting to link in too many shared libraries
*/
#define ELIBEXEC 83 /* Cannot exec a shared library directly */
#define EILSEQ 84 /* Illegal byte sequence */
#define ERESTART 85 /* Interrupted system call should be restarted
*/
#define ESTRPIPE 86 /* Streams pipe error */
#define EUSERS 87 /* Too many users */
#define ENOTSOCK 88 /* Socket operation on non-socket */
#define EDESTADDRREQ 89 /* Destination address required */
#define EMSGSIZE 90 /* Message too long */
#define EPROTOTYPE 91 /* Protocol wrong type for socket */
#define ENOPROTOOPT 92 /* Protocol not available */
#define EPROTONOSUPPORT 93 /* Protocol not supported */
#define ESOCKTNOSUPPORT 94 /* Socket type not supported */
#define EOPNOTSUPP 95 /* Operation not supported on transport
endpoint */
#define EPFNOSUPPORT 96 /* Protocol family not supported */
#define EAFNOSUPPORT 97 /* Address family not supported by protocol
*/
#define EADDRINUSE 98 /* Address already in use */
#define EADDRNOTAVAIL 99 /* Cannot assign requested address */
#define ENETDOWN 100 /* Network is down */
#define ENETUNREACH 101 /* Network is unreachable */
#define ENETRESET 102 /* Network dropped connection because of reset
*/
#define ECONNABORTED 103 /* Software caused connection abort */
#define ECONNRESET 104 /* Connection reset by peer */
#define ENOBUFS 105 /* No buffer space available */
#define EISCONN 106 /* Transport endpoint is already connected */
#define ENOTCONN 107 /* Transport endpoint is not connected */
#define ESHUTDOWN 108 /* Cannot send after transport endpoint
shutdown */
#define ETOOMANYREFS 109 /* Too many references: cannot splice */
#define ETIMEDOUT 110 /* Connection timed out */
#define ECONNREFUSED 111 /* Connection refused */
#define EHOSTDOWN 112 /* Host is down */
#define EHOSTUNREACH 113 /* No route to host */
#define EALREADY 114 /* Operation already in progress */
#define EINPROGRESS 115 /* Operation now in progress */
#define ESTALE 116 /* Stale file handle */
#define EUCLEAN 117 /* Structure needs cleaning */
#define ENOTNAM 118 /* Not a XENIX named type file */
#define ENAVAIL 119 /* No XENIX semaphores available */
#define EISNAM 120 /* Is a named type file */
#define EREMOTEIO 121 /* Remote I/O error */
#define EDQUOT 122 /* Quota exceeded */

#define ENOMEDIUM 123 /* No medium found */
#define EMEDIUMTYPE 124 /* Wrong medium type */
#define ECANCELED 125 /* Operation Canceled */
#define ENOKEY 126 /* Required key not available */
#define EKEYEXPIRED 127 /* Key has expired */
#define EKEYREVOKED 128 /* Key has been revoked */
#define EKEYREJECTED 129 /* Key was rejected by service */

/* for robust mutexes */
#define EOWNERDEAD 130 /* Owner died */
#define ENOTRECOVERABLE 131 /* State not recoverable */

#define ERFKILL 132 /* Operation not possible due to RF-kill */

#define EHWPOISON 133 /* Memory page has hardware error */

#endif

 

Linux/include/linux/errno.h
#ifndef _LINUX_ERRNO_H
#define _LINUX_ERRNO_H

#include <uapi/linux/errno.h>

/*
* These should never be seen by user programs. To return one of
ERESTART*
* codes, signal_pending() MUST be set. Note that ptrace can observe
these
* at syscall exit tracing, but they will never be left for the
debugged user
* process to see.
*/
#define ERESTARTSYS 512
#define ERESTARTNOINTR 513
#define ERESTARTNOHAND 514 /* restart if no handler.. */
#define ENOIOCTLCMD 515 /* No ioctl command */
#define ERESTART_RESTARTBLOCK 516 /* restart by calling
sys_restart_syscall */
#define EPROBE_DEFER 517 /* Driver requests probe retry */
#define EOPENSTALE 518 /* open found a stale dentry */

/* Defined for the NFSv3 protocol */
#define EBADHANDLE 521 /* Illegal NFS file handle */
#define ENOTSYNC 522 /* Update synchronization mismatch */
#define EBADCOOKIE 523 /* Cookie is stale */
#define ENOTSUPP 524 /* Operation is not supported */
#define ETOOSMALL 525 /* Buffer or request is too small */
#define ESERVERFAULT 526 /* An untranslatable error occurred */
#define EBADTYPE 527 /* Type not supported by server */
#define EJUKEBOX 528 /* Request initiated, but will not complete
before timeout */
#define EIOCBQUEUED 529 /* iocb queued, will get completion event
*/
#define ERECALLCONFLICT 530 /* conflict with recalled state */

#endif

errno,linuxerrno
Linux/include/uapi/asm-generic/errno-base.h #ifndef
_ASM_GENERIC_ERRNO_BASE_H #define _ASM_GENERIC_ERRNO_BASE_H
#define EPERM 1 /* Operation not permitted…

Linux/include/uapi/asm-generic/errno-base.h

errno 在 <errno.h> 中定义,错误 Exx 的宏定义在
/usr/include/asm-generic 文件夹上面的 errno-base.h 和
errno.h,分别定义了 1-34 、35-132 的谬误定义。

#ifndef _ASM_GENERIC_ERRNO_BASE_H

#ifndef _ASM_GENERIC_ERRNO_BASE_H

strerror() 函数依照 errno 值重返错误描述字符串,上面程序打印对照表:

#define _ASM_GENERIC_ERRNO_BASE_H

#define _ASM_GENERIC_ERRNO_BASE_H

<!–

#define EPERM 1 /* Operation not permitted */

#define EPERM 1 /* Operation not permitted */

Code highlighting produced by Actipro CodeHighlighter (freeware)

#define ENOENT 2 /* No such file or directory */

#define ENOENT 2 /* No such file or directory */

–>01.#include <errno.h> 
02.#include <string.h> 
03.#include <stdio.h> 
04. 
05.int main() 
06.{ 
07.    int i; 
08.    for(i = 0; i < 140; ++i) 
09.    { 
10.        errno = i; 
11.        printf(“errno %d :\t\t%s\n“,i,strerror(errno)); 
12.    } 
13.    return 0; 
14.} 
 

#define ESRCH 3 /* No such process */

#define ESRCH 3 /* No such process */

荒唐对照表: 

#define EINTR 4 /* Interrupted system call */

#define EINTR 4 /* Interrupted system call */

errno0 : Success

#define EIO 5 /* I/O error */

#define EIO 5 /* I/O error */

errno1 : Operation not permitted

#define ENXIO 6 /* No such device or address */

#define ENXIO 6 /* No such device or address */

errno2 : No such file or directory

#define E2BIG 7 /* Argument list too long */

#define E2BIG 7 /* Argument list too long */

errno3 : No such process

#define ENOEXEC 8 /* Exec format error */

#define ENOEXEC 8 /* Exec format error */

errno4 : Interrupted system call

#define EBADF 9 /* Bad file number */

#define EBADF 9 /* Bad file number */

errno5 : Input/output error

#define ECHILD 10 /* No child processes */

#define ECHILD 10 /* No child processes */

errno6 : No such device or address

#define EAGAIN 11 /* Try again */

#define EAGAIN 11 /* Try again */

errno7 : Argument list too long

#define ENOMEM 12 /* Out of memory */

#define ENOMEM 12 /* Out of memory */

errno8 : Exec format error

#define EACCES 13 /* Permission denied */

#define EACCES 13 /* Permission denied */

errno9 : Bad file descriptor

#define EFAULT 14 /* Bad address */

#define EFAULT 14 /* Bad address */

errno10 : No child processes

#define ENOTBLK 15 /* Block device required */

#define ENOTBLK 15 /* Block device required */

errno11 : Resource temporarily unavailable

#define EBUSY 16 /* Device or resource busy */

#define EBUSY 16 /* Device or resource busy */

errno12 : Cannot allocate memory

#define EEXIST 17 /* File exists */

#define EEXIST 17 /* File exists */

errno13 : Permission denied

#define EXDEV 18 /* Cross-device link */

#define EXDEV 18 /* Cross-device link */

errno14 : Bad address

#define ENODEV 19 /* No such device */

#define ENODEV 19 /* No such device */

errno15 : Block device required

#define ENOTDIR 20 /* Not a directory */

#define ENOTDIR 20 /* Not a directory */

errno16 : Device or resource busy

#define EISDIR 21 /* Is a directory */

#define EISDIR 21 /* Is a directory */

errno17 : File exists

#define EINVAL 22 /* Invalid argument */

#define EINVAL 22 /* Invalid argument */

errno18 : Invalid cross-device link

#define ENFILE 23 /* File table overflow */

#define ENFILE 23 /* File table overflow */

errno19 : No such device

#define EMFILE 24 /* Too many open files */

#define EMFILE 24 /*澳门金沙国际 , Too many open files */

errno20 : Not a directory

#define ENOTTY 25 /* Not a typewriter */

#define ENOTTY 25 /* Not a typewriter */

errno21 : Is a directory

#define ETXTBSY 26 /* Text file busy */

#define ETXTBSY 26 /* Text file busy */

errno22 : Invalid argument

#define EFBIG 27 /* File too large */

#define EFBIG 27 /* File too large */

errno23 : Too many open files in system

#define ENOSPC 28 /* No space left on device */

#define ENOSPC 28 /* No space left on device */

errno24 : Too many open files

#define ESPIPE 29 /* Illegal seek */

#define ESPIPE 29 /* Illegal seek */

errno25 : Inappropriate ioctl for device

#define EROFS 30 /* Read-only file system */

#define EROFS 30 /* Read-only file system */

errno26 : Text file busy

#define EMLINK 31 /* Too many links */

#define EMLINK 31 /* Too many links */

errno27 : File too large

#define EPIPE 32 /* Broken pipe */

#define EPIPE 32 /* Broken pipe */

errno28 : No space left on device

#define EDOM 33 /* Math argument out of domain of func */

#define EDOM 33 /* Math argument out of domain of func */

errno29 : Illegal seek

#define ERANGE 34 /* Math result not representable */

#define ERANGE 34 /* Math result not representable */

errno30 : Read-only file system

#endif

#endif

errno31 : Too many links

Linux/include/uapi/asm-generic/errno.h

Linux/include/uapi/asm-generic/errno.h

errno32 : Broken pipe

#ifndef _ASM_GENERIC_ERRNO_H

#ifndef _ASM_GENERIC_ERRNO_H

errno33 : Numerical argument out of domain

#define _ASM_GENERIC_ERRNO_H

#define _ASM_GENERIC_ERRNO_H

errno34 : Numerical result out of range

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

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

errno35 : Resource deadlock avoided

#define EDEADLK 35 /* Resource deadlock would occur */

#define EDEADLK 35 /* Resource deadlock would occur */

errno36 : File name too long

#define ENAMETOOLONG 36 /* File name too long */

#define ENAMETOOLONG 36 /* File name too long */

errno37 : No locks available

#define ENOLCK 37 /* No record locks available */

#define ENOLCK 37 /* No record locks available */

errno38 : Function not implemented

/*
*
This error code is special: arch syscall entry code will return
*
-ENOSYS if users try to call a syscall that doesn’t exist. To
keep
*
failures of syscalls that really do exist distinguishable from
*
failures due to attempts to use a nonexistent syscall, syscall
*
implementations should refrain from returning -ENOSYS.

/*
*
This error code is special: arch syscall entry code will return
*
-ENOSYS if users try to call a syscall that doesn’t exist. To
keep
*
failures of syscalls that really do exist distinguishable from
*
failures due to attempts to use a nonexistent syscall, syscall
*
implementations should refrain from returning -ENOSYS.

errno39 : Directory not empty

*/

*/

errno40 : Too many levels of symbolic links

#define ENOSYS 38 /* Invalid system call number */

#define ENOSYS 38 /* Invalid system call number */

errno41 : Unknown error 41

#define ENOTEMPTY 39 /* Directory not empty */

#define ENOTEMPTY 39 /* Directory not empty */

errno42 : No message of desired type

#define ELOOP 40 /* Too many symbolic links encountered */

#define ELOOP 40 /* Too many symbolic links encountered */

errno43 : Identifier removed

#define EWOULDBLOCK EAGAIN /* Operation would block */

#define EWOULDBLOCK EAGAIN /* Operation would block */

errno44 : Channel number out of range

#define ENOMSG 42 /* No message of desired type */

#define ENOMSG 42 /* No message of desired type */

errno45 : Level 2 not synchronized

#define EIDRM 43 /* Identifier removed */

#define EIDRM 43 /* Identifier removed */

errno46 : Level 3 halted

#define ECHRNG 44 /* Channel number out of range */

#define ECHRNG 44 /* Channel number out of range */

errno47 : Level 3 reset

#define EL2NSYNC 45 /* Level 2 not synchronized */

#define EL2NSYNC 45 /* Level 2 not synchronized */

errno48 : Link number out of range

#define EL3HLT 46 /* Level 3 halted */

#define EL3HLT 46 /* Level 3 halted */

errno49 : Protocol driver not attached

#define EL3RST 47 /* Level 3 reset */

#define EL3RST 47 /* Level 3 reset */

errno50 : No CSI structure available

#define ELNRNG 48 /* Link number out of range */

#define ELNRNG 48 /* Link number out of range */

errno51 : Level 2 halted

#define EUNATCH 49 /* Protocol driver not attached */

#define EUNATCH 49 /* Protocol driver not attached */

errno52 : Invalid exchange

#define ENOCSI 50 /* No CSI structure available */

#define ENOCSI 50 /* No CSI structure available */

errno53 : Invalid request descriptor

#define EL2HLT 51 /* Level 2 halted */

#define EL2HLT 51 /* Level 2 halted */

errno54 : Exchange full

#define EBADE 52 /* Invalid exchange */

#define EBADE 52 /* Invalid exchange */

errno55 : No anode

#define EBADR 53 /* Invalid request descriptor */

#define EBADR 53 /* Invalid request descriptor */

errno56 : Invalid request code

#define EXFULL 54 /* Exchange full */

#define EXFULL 54 /* Exchange full */

errno57 : Invalid slot

#define ENOANO 55 /* No anode */

#define ENOANO 55 /* No anode */

errno58 : Unknown error 58

#define EBADRQC 56 /* Invalid request code */

#define EBADRQC 56 /* Invalid request code */

errno59 : Bad font file format

#define EBADSLT 57 /* Invalid slot */

#define EBADSLT 57 /* Invalid slot */

errno60 : Device not a stream

#define EDEADLOCK EDEADLK

#define EDEADLOCK EDEADLK

errno61 : No data available

#define EBFONT 59 /* Bad font file format */

#define EBFONT 59 /* Bad font file format */

errno62 : Timer expired

#define ENOSTR 60 /* Device not a stream */

#define ENOSTR 60 /* Device not a stream */

errno63 : Out of streams resources

#define ENODATA 61 /* No data available */

#define ENODATA 61 /* No data available */

errno64 : Machine is not on the network

#define ETIME 62 /* Timer expired */

#define ETIME 62 /* Timer expired */

errno65 : Package not installed

#define ENOSR 63 /* Out of streams resources */

#define ENOSR 63 /* Out of streams resources */

errno66 : Object is remote

#define ENONET 64 /* Machine is not on the network */

#define ENONET 64 /* Machine is not on the network */

errno67 : Link has been severed

#define ENOPKG 65 /* Package not installed */

#define ENOPKG 65 /* Package not installed */

errno68 : Advertise error

#define EREMOTE 66 /* Object is remote */

#define EREMOTE 66 /* Object is remote */

errno69 : Srmount error

#define ENOLINK 67 /* Link has been severed */

#define ENOLINK 67 /* Link has been severed */

errno70 : Communication error on send

#define EADV 68 /* Advertise error */

#define EADV 68 /* Advertise error */

errno71 : Protocol error

#define ESRMNT 69 /* Srmount error */

#define ESRMNT 69 /* Srmount error */

errno72 : Multihop attempted

#define ECOMM 70 /* Communication error on send */

#define ECOMM 70 /* Communication error on send */

errno73 : RFS specific error

#define EPROTO 71 /* Protocol error */

#define EPROTO 71 /* Protocol error */

errno74 : Bad message

#define EMULTIHOP 72 /* Multihop attempted */

#define EMULTIHOP 72 /* Multihop attempted */

errno75 : Value too large for defined datatype

#define EDOTDOT 73 /* RFS specific error */

#define EDOTDOT 73 /* RFS specific error */

errno76 : Name not unique on network

#define EBADMSG 74 /* Not a data message */

#define EBADMSG 74 /* Not a data message */

errno77 : File descriptor in bad state

#define EOVERFLOW 75 /* Value too large for defined data type
*/

#define EOVERFLOW 75 /* Value too large for defined data type
*/

errno78 : Remote address changed

#define ENOTUNIQ 76 /* Name not unique on network */

#define ENOTUNIQ 76 /* Name not unique on network */

errno79 : Can not access a needed sharedlibrary

#define EBADFD 77 /* File descriptor in bad state */

#define EBADFD 77 /* File descriptor in bad state */

errno80 : Accessing a corrupted sharedlibrary

#define EREMCHG 78 /* Remote address changed */

#define EREMCHG 78 /* Remote address changed */

errno81 : .lib section in a.out corrupted

#define ELIBACC 79 /* Can not access a needed shared library
*/

#define ELIBACC 79 /* Can not access a needed shared library
*/

errno82 : Attempting to link in too manyshared libraries

#define ELIBBAD 80 /* Accessing a corrupted shared library
*/

#define ELIBBAD 80 /* Accessing a corrupted shared library
*/

errno83 : Cannot exec a shared librarydirectly

#define ELIBSCN 81 /* .lib section in a.out corrupted */

#define ELIBSCN 81 /* .lib section in a.out corrupted */

errno84 : Invalid or incomplete multibyte orwide character

#define ELIBMAX 82 /* Attempting to link in too many shared libraries
*/

#define ELIBMAX 82 /* Attempting to link in too many shared libraries
*/

errno85 : Interrupted system call should berestarted

#define ELIBEXEC 83 /* Cannot exec a shared library directly
*/

#define ELIBEXEC 83 /* Cannot exec a shared library directly
*/

errno86 : Streams pipe error

#define EILSEQ 84 /* Illegal byte sequence */

#define EILSEQ 84 /* Illegal byte sequence */

errno87 : Too many users

#define ERESTART 85 /* Interrupted system call should be restarted
*/

#define ERESTART 85 /* Interrupted system call should be restarted
*/

errno88 : Socket operation on non-socket

#define ESTRPIPE 86 /* Streams pipe error */

#define ESTRPIPE 86 /* Streams pipe error */

errno89 : Destinationaddress required

#define EUSERS 87 /* Too many users */

#define EUSERS 87 /* Too many users */

errno90 : Message too long

#define ENOTSOCK 88 /* Socket operation on non-socket */

#define ENOTSOCK 88 /* Socket operation on non-socket */

errno91 : Protocol wrong type for socket

#define EDESTADDRREQ 89 /* Destination address required */

#define EDESTADDRREQ 89 /* Destination address required */

errno92 : Protocol not available

#define EMSGSIZE 90 /* Message too long */

#define EMSGSIZE 90 /* Message too long */

errno93 : Protocol not supported

#define EPROTOTYPE 91 /* Protocol wrong type for socket */

#define EPROTOTYPE 91 /* Protocol wrong type for socket */

errno94 : Socket type not supported

#define ENOPROTOOPT 92 /* Protocol not available */

#define ENOPROTOOPT 92 /* Protocol not available */

errno95 : Operation not supported

#define EPROTONOSUPPORT 93 /* Protocol not supported */

#define EPROTONOSUPPORT 93 /* Protocol not supported */

errno96 : Protocol family not supported

#define ESOCKTNOSUPPORT 94 /* Socket type not supported */

#define ESOCKTNOSUPPORT 94 /* Socket type not supported */

errno97 : Address family not supported byprotocol

#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint
*/

#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint
*/

errno98 : Address already in use

#define EPFNOSUPPORT 96 /* Protocol family not supported */

#define EPFNOSUPPORT 96 /* Protocol family not supported */

errno99 : Cannot assign requested address

#define EAFNOSUPPORT 97 /* Address family not supported by protocol
*/

#define EAFNOSUPPORT 97 /* Address family not supported by protocol
*/

errno100 : Network is down

#define EADDRINUSE 98 /* Address already in use */

#define EADDRINUSE 98 /* Address already in use */

errno101 : Network is unreachable

#define EADDRNOTAVAIL 99 /* Cannot assign requested address
*/

#define EADDRNOTAVAIL 99 /* Cannot assign requested address
*/

errno102 : Network dropped connection onreset

#define ENETDOWN 100 /* Network is down */

#define ENETDOWN 100 /* Network is down */

errno103 : Software caused connection abort

#define ENETUNREACH 101 /* Network is unreachable */

#define ENETUNREACH 101 /* Network is unreachable */

errno104 : Connection reset by peer

#define ENETRESET 102 /* Network dropped connection because of reset
*/

#define ENETRESET 102 /* Network dropped connection because of reset
*/

errno105 : No buffer space available

#define ECONNABORTED 103 /* Software caused connection abort
*/

#define ECONNABORTED 103 /* Software caused connection abort
*/

errno106 : Transport endpoint is alreadyconnected

#define ECONNRESET 104 /* Connection reset by peer */

#define ECONNRESET 104 /* Connection reset by peer */

errno107 : Transport endpoint is notconnected

#define ENOBUFS 105 /* No buffer space available */

#define ENOBUFS 105 /* No buffer space available */

errno108 : Cannot send after transportendpoint shutdown

#define EISCONN 106 /* Transport endpoint is already connected
*/

#define EISCONN 106 /* Transport endpoint is already connected
*/

errno109 : Too many references: cannot splice

#define ENOTCONN 107 /* Transport endpoint is not connected
*/

#define ENOTCONN 107 /* Transport endpoint is not connected
*/

errno110 : Connection timed out

#define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown
*/

#define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown
*/

errno111 : Connection refused

#define ETOOMANYREFS 109 /* Too many references: cannot splice
*/

#define ETOOMANYREFS 109 /* Too many references: cannot splice
*/

errno112 : Host is down

#define ETIMEDOUT 110 /* Connection timed out */

#define ETIMEDOUT 110 /* Connection timed out */

errno113 : No route to host

#define ECONNREFUSED 111 /* Connection refused */

#define ECONNREFUSED 111 /* Connection refused */

errno114 : Operation already in progress

#define EHOSTDOWN 112 /* Host is down */

#define EHOSTDOWN 112 /* Host is down */

errno115 : Operation now in progress

#define EHOSTUNREACH 113 /* No route to host */

#define EHOSTUNREACH 113 /* No route to host */

errno116 : Stale NFS file handle

#define EALREADY 114 /* Operation already in progress */

#define EALREADY 114 /* Operation already in progress */

errno117 : Structure needs cleaning

#define EINPROGRESS 115 /* Operation now in progress */

#define EINPROGRESS 115 /* Operation now in progress */

errno118 : Not a XENIX named type file

#define ESTALE 116 /* Stale file handle */

#define ESTALE 116 /* Stale file handle */

errno119 : No XENIX semaphores available

#define EUCLEAN 117 /* Structure needs cleaning */

#define EUCLEAN 117 /* Structure needs cleaning */

errno120 : Is a named type file

#define ENOTNAM 118 /* Not a XENIX named type file */

#define ENOTNAM 118 /* Not a XENIX named type file */

errno121 : Remote I/O error

#define ENAVAIL 119 /* No XENIX semaphores available */

#define ENAVAIL 119 /* No XENIX semaphores available */

errno122 : Disk quota exceeded

#define EISNAM 120 /* Is a named type file */

#define EISNAM 120 /* Is a named type file */

errno123 : No medium found

#define EREMOTEIO 121 /* Remote I/O error */

#define EREMOTEIO 121 /* Remote I/O error */

errno124 : Wrong medium type

#define EDQUOT 122 /* Quota exceeded */

#define EDQUOT 122 /* Quota exceeded */

errno125 : Operation canceled

#define ENOMEDIUM 123 /* No medium found */

#define ENOMEDIUM 123 /* No medium found */

errno126 : Required key not available

#define EMEDIUMTYPE 124 /* Wrong medium type */

#define EMEDIUMTYPE 124 /* Wrong medium type */

errno127 : Key has expired

#define ECANCELED 125 /* Operation Canceled */

#define ECANCELED 125 /* Operation Canceled */

errno128 : Key has been revoked

#define ENOKEY 126 /* Required key not available */

#define ENOKEY 126 /* Required key not available */

errno129 : Key was rejected by service

#define EKEYEXPIRED 127 /* Key has expired */

#define EKEYEXPIRED 127 /* Key has expired */

errno130 : Owner died

#define EKEYREVOKED 128 /* Key has been revoked */

#define EKEYREVOKED 128 /* Key has been revoked */

errno131 : State not recoverable

#define EKEYREJECTED 129 /* Key was rejected by service */

#define EKEYREJECTED 129 /* Key was rejected by service */

errno132 : Operation not possible due toRF-kill

/*
for robust mutexes */

/*
for robust mutexes */

errno133 : Unknown error 133

#define EOWNERDEAD 130 /* Owner died */

#define EOWNERDEAD 130 /* Owner died */

errno134 : Unknown error 134

#define ENOTRECOVERABLE 131 /* State not recoverable */

#define ENOTRECOVERABLE 131 /* State not recoverable */

errno135 : Unknown error 135

#define ERFKILL 132 /* Operation not possible due to RF-kill
*/

#define ERFKILL 132 /* Operation not possible due to RF-kill
*/

errno136 : Unknown error 136

#define EHWPOISON 133 /* Memory page has hardware error */

#define EHWPOISON 133 /* Memory page has hardware error */

errno137 : Unknown error 137

#endif

#endif

errno138 : Unknown error 138

 

 

errno139 : Unknown error 139

Linux/include/linux/errno.h

Linux/include/linux/errno.h

由上可知Linux对错误宏的定义。

#ifndef _LINUX_ERRNO_H

#ifndef _LINUX_ERRNO_H

头文件 /usr/include/asm-generic/errno-base.h 的源码:

#define _LINUX_ERRNO_H

#define _LINUX_ERRNO_H

#ifndef _ASM_GENERIC_ERRNO_BASE_H
#define _ASM_GENERIC_ERRNO_BASE_H

#include <uapi/linux/errno.h>

#include <uapi/linux/errno.h>

#define EPERM 1 /* Operation not permitted */
#define ENOENT2 /* No such file or directory */
#define ESRCH 3 /* No such process */
#define EINTR 4 /* Interrupted system call */
#define EIO 5 /* I/O error */
#define ENXIO 6 /* No such device or address */
#define E2BIG 7 /* Argument list too long */
#define ENOEXEC8 /* Exec format error */
#define EBADF 9 /* Bad file number */
#define ECHILD10 /* No child processes */
#define EAGAIN11 /* Try again */
#define ENOMEM12 /* Out of memory */
#define EACCES13 /* Permission denied */
#define EFAULT14 /* Bad address */
#define ENOTBLK15 /* Block device required */
#define EBUSY 16 /* Device or resource busy */
#define EEXIST17 /* File exists */
#define EXDEV 18 /* Cross-device link */
#define ENODEV19 /* No such device */
#define ENOTDIR20 /* Not a directory */
#define EISDIR21 /* Is a directory */
#define EINVAL22 /* Invalid argument */
#define ENFILE23 /* File table overflow */
#define EMFILE24 /* Too many open files */
#define ENOTTY25 /* Not a typewriter */
#define ETXTBSY26 /* Text file busy */
#define EFBIG 27 /* File too large */
#define ENOSPC28 /* No space left on device */
#define ESPIPE29 /* Illegal seek */
#define EROFS 30 /* Read-only file system */
#define EMLINK31 /* Too many links */
#define EPIPE 32 /* Broken pipe */
#define EDOM 33 /* Math argument out of domain of func */
#define ERANGE34 /* Math result not representable */

/*
*
These should never be seen by user programs. To return one of
ERESTART*
*
codes, signal_pending() MUST be set. Note that ptrace can observe
these
*
at syscall exit tracing, but they will never be left for the debugged
user
*
process to see.

/*
*
These should never be seen by user programs. To return one of
ERESTART*
*
codes, signal_pending() MUST be set. Note that ptrace can observe
these
*
at syscall exit tracing, but they will never be left for the debugged
user
*
process to see.

#endif

*/

*/

头文件/usr/include/asm-generic/erno.h源码:

#define ERESTARTSYS 512

#define ERESTARTSYS 512

#ifndef _ASM_GENERIC_ERRNO_H
#define _ASM_GENERIC_ERRNO_H

#define ERESTARTNOINTR 513

#define ERESTARTNOINTR 513

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

#define ERESTARTNOHAND 514 /* restart if no handler.. */

#define ERESTARTNOHAND 514 /* restart if no handler.. */

#define EDEADLK35 /* Resource deadlock would occur */
#define ENAMETOOLONG36 /* File name too long */
#define ENOLCK37 /* No record locks available */
#define ENOSYS38 /* Function not implemented */
#define ENOTEMPTY39 /* Directory not empty */
#define ELOOP 40 /* Too many symbolic links encountered */
#define EWOULDBLOCKEAGAIN /* Operation would block */
#define ENOMSG42 /* No message of desired type */
#define EIDRM 43 /* Identifier removed */
#define ECHRNG44 /* Channel number out of range */
#define EL2NSYNC45 /* Level 2 not synchronized */
#define EL3HLT46 /* Level 3 halted */
#define EL3RST47 /* Level 3 reset */
#define ELNRNG48 /* Link number out of range */
#define EUNATCH49 /* Protocol driver not attached */
#define ENOCSI50 /* No CSI structure available */
#define EL2HLT51 /* Level 2 halted */
#define EBADE 52 /* Invalid exchange */
#define EBADR 53 /* Invalid request descriptor */
#define EXFULL54 /* Exchange full */
#define ENOANO55 /* No anode */
#define EBADRQC56 /* Invalid request code */
#define EBADSLT57 /* Invalid slot */

#define ENOIOCTLCMD 515 /* No ioctl command */

#define ENOIOCTLCMD 515 /* No ioctl command */

#define EDEADLOCKEDEADLK

#define ERESTART_RESTARTBLOCK 516 /* restart by calling
sys_restart_syscall */

#define ERESTART_RESTARTBLOCK 516 /* restart by calling
sys_restart_syscall */

#define EBFONT59 /* Bad font file format */
#define ENOSTR60 /* Device not a stream */
#define ENODATA61 /* No data available */
#define ETIME 62 /* Timer expired */
#define ENOSR 63 /* Out of streams resources */
#define ENONET64 /* Machine is not on the network */
#define ENOPKG65 /* Package not installed */
#define EREMOTE66 /* Object is remote */
#define ENOLINK67 /* Link has been severed */
#define EADV 68 /* Advertise error */
#define ESRMNT69 /* Srmount error */
#define ECOMM 70 /* Communication error on send */
#define EPROTO71 /* Protocol error */
#define EMULTIHOP72 /* Multihop attempted */
#define EDOTDOT73 /* RFS specific error */
#define EBADMSG74 /* Not a data message */
#define EOVERFLOW75 /* Value too large for defined data type */
#define ENOTUNIQ76 /* Name not unique on network */
#define EBADFD77 /* File descriptor in bad state */
#define EREMCHG78 /* Remote address changed */
#define ELIBACC79 /* Can not access a needed shared library */
#define ELIBBAD80 /* Accessing a corrupted shared library */
#define ELIBSCN81 /* .lib section in a.out corrupted */
#define ELIBMAX82 /* Attempting to link in too many shared libraries
*/
#define ELIBEXEC83 /* Cannot exec a shared library directly */
#define EILSEQ84 /* Illegal byte sequence */
#define ERESTART85 /* Interrupted system call should be restarted
*/
#define ESTRPIPE86 /* Streams pipe error */
#define EUSERS87 /* Too many users */
#define ENOTSOCK88 /* Socket operation on non-socket */
#define EDESTADDRREQ89 /* Destination address required */
#define EMSGSIZE90 /* Message too long */
#define EPROTOTYPE91 /* Protocol wrong type for socket */
#define ENOPROTOOPT92 /* Protocol not available */
#define EPROTONOSUPPORT93 /* Protocol not supported */
#define ESOCKTNOSUPPORT94 /* Socket type not supported */
#define EOPNOTSUPP95 /* Operation not supported on transport endpoint
*/
#define EPFNOSUPPORT96 /* Protocol family not supported */
#define EAFNOSUPPORT97 /* Address family not supported by protocol
*/
#define EADDRINUSE98 /* Address already in use */
#define EADDRNOTAVAIL99 /* Cannot assign requested address */
#define ENETDOWN100 /* Network is down */
#define ENETUNREACH101 /* Network is unreachable */
#define ENETRESET102 /* Network dropped connection because of reset
*/
#define ECONNABORTED103 /* Software caused connection abort */
#define ECONNRESET104 /* Connection reset by peer */
#define ENOBUFS105 /* No buffer space available */
#define EISCONN106 /* Transport endpoint is already connected */
#define ENOTCONN107 /* Transport endpoint is not connected */
#define ESHUTDOWN108 /* Cannot send after transport endpoint shutdown
*/
#define ETOOMANYREFS109 /* Too many references: cannot splice */
#define ETIMEDOUT110 /* Connection timed out */
#define ECONNREFUSED111 /* Connection refused */
#define EHOSTDOWN112 /* Host is down */
#define EHOSTUNREACH113 /* No route to host */
#define EALREADY114 /* Operation already in progress */
#define EINPROGRESS115 /* Operation now in progress */
#define ESTALE116 /* Stale NFS file handle */
#define EUCLEAN117 /* Structure needs cleaning */
#define ENOTNAM118 /* Not a XENIX named type file */
#define ENAVAIL119 /* No XENIX semaphores available */
#define EISNAM120 /* Is a named type file */
#define EREMOTEIO121 /* Remote I/O error */
#define EDQUOT122 /* Quota exceeded */

#define EPROBE_DEFER 517 /* Driver requests probe retry */

#define EPROBE_DEFER 517 /* Driver requests probe retry */

#define ENOMEDIUM123 /* No medium found */
#define EMEDIUMTYPE124 /* Wrong medium type */
#define ECANCELED125 /* Operation Canceled */
#define ENOKEY126 /* Required key not available */
#define EKEYEXPIRED127 /* Key has expired */
#define EKEYREVOKED128 /* Key has been revoked */
#define EKEYREJECTED129 /* Key was rejected by service */

#define EOPENSTALE 518 /* open found a stale dentry */

#define EOPENSTALE 518 /* open found a stale dentry */

/* for robust mutexes */
#define EOWNERDEAD130 /* Owner died */
#define ENOTRECOVERABLE131 /* State not recoverable */

/*
Defined for the NFSv3 protocol */

/*
Defined for the NFSv3 protocol */

#define ERFKILL 132/* Operation not possible due to RF-kill */

#define EBADHANDLE 521 /* Illegal NFS file handle */

#define EBADHANDLE 521 /* Illegal NFS file handle */

#endif

#define ENOTSYNC 522 /* Update synchronization mismatch */

#define ENOTSYNC 522 /* Update synchronization mismatch */

澳门金沙国际 1

#define EBADCOOKIE 523 /* Cookie is stale */

#define EBADCOOKIE 523 /* Cookie is stale */

#define ENOTSUPP 524 /* Operation is not supported */

#define ENOTSUPP 524 /* Operation is not supported */

#define ETOOSMALL 525 /* Buffer or request is too small */

#define ETOOSMALL 525 /* Buffer or request is too small */

#define ESERVERFAULT 526 /* An untranslatable error occurred
*/

#define ESERVERFAULT 526 /* An untranslatable error occurred
*/

#define EBADTYPE 527 /* Type not supported by server */

#define EBADTYPE 527 /* Type not supported by server */

#define EJUKEBOX 528 /* Request initiated, but will not complete
before timeout */

#define EJUKEBOX 528 /* Request initiated, but will not complete
before timeout */

#define EIOCBQUEUED 529 /* iocb queued, will get completion event
*/

#define EIOCBQUEUED 529 /* iocb queued, will get completion event
*/

#define ERECALLCONFLICT 530 /* conflict with recalled state
*/

#define ERECALLCONFLICT 530 /* conflict with recalled state
*/

#endif

#endif

相关文章