Hacking ToolsHow ToLearn HackUncategorized

101 Linux Error Code

100 Linux Error Codes for C Programming Language using errno

Linux Error CodesLinux Error Code:-C code snippet tries to open a file through an open system call. There are two flags in the open call. The O_CREAT flag is to create a file if the file does not exist. The O_EXCL flag is used with O_CREAT if the file already exists open call will fail with the proper error number.

Linux Error Code in C code :-

$ cat fileopen.c
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
main()
{
// Declaration of a file descriptor
int fd;

// Opening a file
fd = open("/root/sasikala/testing",O_CREAT|O_EXCL);
// If Open is failed
if ( fd < 0 ) {
        printf("Opening file : Failed\n");
        printf ("Error no is : %d\n", errno);
        printf("Error description is : %s\n",strerror(errno));
}
// If Open is success
else
        printf("Opening file : Success\n");

}

$ cc -o fileopen fileopen.c
$ ./fileopen

Opening file : Success

$ ./fileopen
Opening file : Failed
Error no is : 17
Error description is : File exists

open got executed successfully, and it created the file since the file was not available. In next execution, it throws an error number 17, which is “File already exist”.  Linux Error Code

The following table shows a list of error numbers and its descriptions in Linux operation system . Linux Error Code

Linux Error Code

Error numberError CodeError Description
1EPERMOperation not permitted
2ENOENTNo such file or directory
3ESRCHNo such process
4EINTRInterrupted system call
5EIOI/O error
6ENXIONo such device or address
7E2BIGArgument list too long
8ENOEXECExec format error
9EBADFBad file number
10ECHILDNo child processes
11EAGAINTry again
12ENOMEMOut of memory
13EACCESPermission denied
14EFAULTBad address
15ENOTBLKBlock device required
16EBUSYDevice or resource busy
17EEXISTFile exists
18EXDEVCross-device link
19ENODEVNo such device
20ENOTDIRNot a directory
21EISDIRIs a directory
22EINVALInvalid argument
23ENFILEFile table overflow
24EMFILEToo many open files
25ENOTTYNot a typewriter
26ETXTBSYText file busy
27EFBIGFile too large
28ENOSPCNo space left on device
29ESPIPEIllegal seek
30EROFSRead-only file system
31EMLINKToo many links
32EPIPEBroken pipe
33EDOMMath argument out of domain of func
34ERANGEMath result not representable
35EDEADLKResource deadlock would occur
36ENAMETOOLONGFile name too long
37ENOLCKNo record locks available
38ENOSYSFunction not implemented
39ENOTEMPTYDirectory not empty
40ELOOPToo many symbolic links encountered
42ENOMSGNo message of desired type
43EIDRMIdentifier removed
44ECHRNGChannel number out of range
45EL2NSYNCLevel 2 not synchronized
46EL3HLTLevel 3 halted
47EL3RSTLevel 3 reset
48ELNRNGLink number out of range
49EUNATCHProtocol driver not attached
50ENOCSINo CSI structure available
51EL2HLTLevel 2 halted
52EBADEInvalid exchange
53EBADRInvalid request descriptor
54EXFULLExchange full
55ENOANONo anode
56EBADRQCInvalid request code
57EBADSLTInvalid slot
59EBFONTBad font file format
60ENOSTRDevice not a stream
61ENODATANo data available
62ETIMETimer expired
63ENOSROut of streams resources
64ENONETMachine is not on the network
65ENOPKGPackage not installed
66EREMOTEObject is remote
67ENOLINKLink has been severed
68EADVAdvertise error
69ESRMNTSrmount error
70ECOMMCommunication error on send
71EPROTOProtocol error
72EMULTIHOPMultihop attempted
73EDOTDOTRFS specific error
74EBADMSGNot a data message
75EOVERFLOWValue too large for defined data type
76ENOTUNIQName not unique on network
77EBADFDFile descriptor in bad state
78EREMCHGRemote address changed
79ELIBACCCan not access a needed shared library
80ELIBBADAccessing a corrupted shared library
81ELIBSCN.lib section in a.out corrupted
82ELIBMAXAttempting to link in too many shared libraries
83ELIBEXECCannot exec a shared library directly
84EILSEQIllegal byte sequence
85ERESTARTInterrupted system call should be restarted
86ESTRPIPEStreams pipe error
87EUSERSToo many users
88ENOTSOCKSocket operation on non-socket
89EDESTADDRREQDestination address required
90EMSGSIZEMessage too long
91EPROTOTYPEProtocol wrong type for socket
92ENOPROTOOPTProtocol not available
93EPROTONOSUPPORTProtocol not supported
94ESOCKTNOSUPPORTSocket type not supported
95EOPNOTSUPPOperation not supported on transport endpoint
96EPFNOSUPPORTProtocol family not supported
97EAFNOSUPPORTAddress family not supported by protocol
98EADDRINUSEAddress already in use
99EADDRNOTAVAILCannot assign requested address
100ENETDOWNNetwork is down
101ENETUNREACHNetwork is unreachable

Having same terms, Linux error codes, Linux error codes list, error codes in Linux, error codes in Linux
list of error codes in Linux, error, errors,#define,error code

Osman

Speaker, Founder, and CEO — Global hack News | Latest Hacking News, IT Security News, and Cyber Security

Leave a Reply