Regarding Linux error numbers

Is there any link or material where I can learn more about the different numbers of errors in Linux?

Currently, in man errno, I get one line for each error number, but I would like to know the conditions or the chances for which a particular error occurs (more detailed description in short words)

For instance,

EADDRNOTAVAIL 99 /* Cannot assign requested address */

The above error occurs when the socket tries to bind to an ip address that is not on the local computer. Similarly for all other bugs is there any wiki or stuff for more info

+5
source share
6 answers

, -, man "-".

, errno 34 fscanf(), :

grep 34 $(find /usr/include -name '*errno*h')

, :

/usr/include/bits/errno.h:#define ERANGE 34 /* Math result not representable. */
/usr/include/asm-generic/errno-base.h:#define ERANGE 34 /* Math result not ... */

, man fscanf(), :

ERANGE - The result of an integer conversion would exceed the size
         that can be stored in the corresponding integer type.

() .

() , grep :

grep define $(find /usr/include -name '*errno*h') | less

.

, ( , ), (, EADDRNOTAVAIL) 1 - this ( ):


bind(2) , . , IP- 127.0.0.1 1.2.3.4, 1.2.3.5, . , , , , .
, " ", , . IP- (.. socketpair), (value = 99 Linux).
4 EADDRNOTAVAIL:
      - (2)
      - (2)
      - setsockopt (2)
      - (7)

, , .


1 Firefox, ?: -)

+9

. , , , -.

"" , errno .

+3

API specfic. . :

Many functions provide an error number in errno, which has type int
and is defined in <errno.h>.

, errno.h. Glib .

EDIT: , , Google , , man .

0

GLIBC, %m printf():

#include <errno.h>
...
int fh = fopen(...);
if (0 > fh) printf("Couldn't open the file: %d, %m\n", errno);

.

0

, , , . - ; IP- ip (7), :

   EADDRNOTAVAIL
          A nonexistent interface was requested or  the  requested  source
          address was not local.

tcp (7) udp (7).

0

.

#include<stdio.h>
#include<string.h>

int main()
{
        int i= 0 ;

        for ( i = 0 ; i<=132; i++ )
        {
                printf("no %d == %s \n", i , strerror(i));
        }
}
no 0 == Success
no 1 == Operation not permitted
no 2 == No such file or directory
no 3 == No such process
no 4 == Interrupted system call
no 5 == Input/output error
no 6 == No such device or address
no 7 == Argument list too long
no 8 == Exec format error
no 9 == Bad file descriptor
no 10 == No child processes
no 11 == Resource temporarily unavailable
no 12 == Cannot allocate memory
no 13 == Permission denied
no 14 == Bad address
no 15 == Block device required
no 16 == Device or resource busy
no 17 == File exists
no 18 == Invalid cross-device link
no 19 == No such device
no 20 == Not a directory
no 21 == Is a directory
no 22 == Invalid argument
no 23 == Too many open files in system
no 24 == Too many open files
no 25 == Inappropriate ioctl for device
no 26 == Text file busy
no 27 == File too large
no 28 == No space left on device
no 29 == Illegal seek
no 30 == Read-only file system
no 31 == Too many links
no 32 == Broken pipe
no 33 == Numerical argument out of domain
no 34 == Numerical result out of range
no 35 == Resource deadlock avoided
no 36 == File name too long
no 37 == No locks available
no 38 == Function not implemented
no 39 == Directory not empty
no 40 == Too many levels of symbolic links
no 41 == Unknown error 41
no 42 == No message of desired type
no 43 == Identifier removed
no 44 == Channel number out of range
no 45 == Level 2 not synchronized
no 46 == Level 3 halted
no 47 == Level 3 reset
no 48 == Link number out of range
no 49 == Protocol driver not attached
no 50 == No CSI structure available
no 51 == Level 2 halted
no 52 == Invalid exchange
no 53 == Invalid request descriptor
no 54 == Exchange full
no 55 == No anode
no 56 == Invalid request code
no 57 == Invalid slot
no 58 == Unknown error 58
no 59 == Bad font file format
no 60 == Device not a stream
no 61 == No data available
no 62 == Timer expired
no 63 == Out of streams resources
no 64 == Machine is not on the network
no 65 == Package not installed
no 66 == Object is remote
no 67 == Link has been severed
no 68 == Advertise error
no 69 == Srmount error
no 70 == Communication error on send
no 71 == Protocol error
no 72 == Multihop attempted
no 73 == RFS specific error
no 74 == Bad message
no 75 == Value too large for defined data type
no 76 == Name not unique on network
no 77 == File descriptor in bad state
no 78 == Remote address changed
no 79 == Can not access a needed shared library
no 80 == Accessing a corrupted shared library
no 81 == .lib section in a.out corrupted
no 82 == Attempting to link in too many shared libraries
no 83 == Cannot exec a shared library directly
no 84 == Invalid or incomplete multibyte or wide character
no 85 == Interrupted system call should be restarted
no 86 == Streams pipe error
no 87 == Too many users
no 88 == Socket operation on non-socket
no 89 == Destination address required
no 90 == Message too long
no 91 == Protocol wrong type for socket
no 92 == Protocol not available
no 93 == Protocol not supported
no 94 == Socket type not supported
no 95 == Operation not supported
no 96 == Protocol family not supported
no 97 == Address family not supported by protocol
no 98 == Address already in use
no 99 == Cannot assign requested address
no 100 == Network is down
no 101 == Network is unreachable
no 102 == Network dropped connection on reset
no 103 == Software caused connection abort
no 104 == Connection reset by peer
no 105 == No buffer space available
no 106 == Transport endpoint is already connected
no 107 == Transport endpoint is not connected
no 108 == Cannot send after transport endpoint shutdown
no 109 == Too many references: cannot splice
no 110 == Connection timed out
no 111 == Connection refused
no 112 == Host is down
no 113 == No route to host
no 114 == Operation already in progress
no 115 == Operation now in progress
no 116 == Stale NFS file handle
no 117 == Structure needs cleaning
no 118 == Not a XENIX named type file
no 119 == No XENIX semaphores available
no 120 == Is a named type file
no 121 == Remote I/O error
no 122 == Disk quota exceeded
no 123 == No medium found
no 124 == Wrong medium type
no 125 == Operation canceled
no 126 == Required key not available
no 127 == Key has expired
no 128 == Key has been revoked
no 129 == Key was rejected by service
no 130 == Owner died
no 131 == State not recoverable
no 132 == Unknown error 132
0
source

All Articles