Fennix  1.0.0
Full Documentation
errno.h File Reference

Go to the source code of this file.

Macros

#define errno   (*__errno_location())
 

Enumerations

enum  KernelErrors {
  EOK = 0 , E2BIG = 1 , EACCES = 2 , EADDRINUSE = 3 ,
  EADDRNOTAVAIL = 4 , EAFNOSUPPORT = 5 , EAGAIN = 6 , EALREADY = 7 ,
  EBADF = 8 , EBADMSG = 9 , EBUSY = 10 , ECANCELED = 11 ,
  ECHILD = 12 , ECONNABORTED = 13 , ECONNREFUSED = 14 , ECONNRESET = 15 ,
  EDEADLK = 16 , EDESTADDRREQ = 17 , EDOM = 18 , EDQUOT = 19 ,
  EEXIST = 20 , EFAULT = 21 , EFBIG = 22 , EHOSTUNREACH = 23 ,
  EIDRM = 24 , EILSEQ = 25 , EINPROGRESS = 26 , EINTR = 27 ,
  EINVAL = 28 , EIO = 29 , EISCONN = 30 , EISDIR = 31 ,
  ELOOP = 32 , EMFILE = 33 , EMLINK = 34 , EMSGSIZE = 35 ,
  EMULTIHOP = 36 , ENAMETOOLONG = 37 , ENETDOWN = 38 , ENETRESET = 39 ,
  ENETUNREACH = 40 , ENFILE = 41 , ENOBUFS = 42 , ENODATA = 43 ,
  ENODEV = 44 , ENOENT = 45 , ENOEXEC = 46 , ENOLCK = 47 ,
  ENOLINK = 48 , ENOMEM = 49 , ENOMSG = 50 , ENOPROTOOPT = 51 ,
  ENOSPC = 52 , ENOSR = 53 , ENOSTR = 54 , ENOSYS = 55 ,
  ENOTCONN = 56 , ENOTDIR = 57 , ENOTEMPTY = 58 , ENOTRECOVERABLE = 59 ,
  ENOTSOCK = 60 , ENOTSUP = 61 , ENOTTY = 62 , ENXIO = 63 ,
  EOPNOTSUPP = 64 , EOVERFLOW = 65 , EOWNERDEAD = 66 , EPERM = 67 ,
  EPIPE = 68 , EPROTO = 69 , EPROTONOSUPPORT = 70 , EPROTOTYPE = 71 ,
  ERANGE = 72 , EROFS = 73 , ESPIPE = 74 , ESRCH = 75 ,
  ESTALE = 76 , ETIME = 77 , ETIMEDOUT = 78 , ETXTBSY = 79 ,
  EWOULDBLOCK = 80 , EXDEV = 81 , __ERRNO_MAX
}
 

Functions

int * __errno_location (void) __attribute__((const))
 
char * strerror (int errnum)
 

Macro Definition Documentation

◆ errno

#define errno   (*__errno_location())

Definition at line 603 of file errno.h.

Enumeration Type Documentation

◆ KernelErrors

The documentation for these error codes are from: https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html

Full list: https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/basedefs/errno.h.html

Enumerator
EOK 

No Error

E2BIG 

Argument list too long. The sum of the number of bytes used by the new process image's argument list and environment list is greater than the system-imposed limit of {ARG_MAX} bytes. or: Lack of space in an output buffer. or: Argument is greater than the system-imposed maximum.

EACCES 

Permission denied. An attempt was made to access a file in a way forbidden by its file access permissions.

EADDRINUSE 

Address in use. The specified address is in use.

EADDRNOTAVAIL 

Address not available. The specified address is not available from the local system.

EAFNOSUPPORT 

Address family not supported. The implementation does not support the specified address family, or the specified address is not a valid address for the address family of the specified socket.

EAGAIN 

Resource temporarily unavailable. This is a temporary condition and later calls to the same routine may complete normally.

EALREADY 

Connection already in progress. A connection request is already in progress for the specified socket.

EBADF 

Bad file descriptor. A file descriptor argument is out of range, refers to no open file, or a read (write) request is made to a file that is only open for writing (reading).

EBADMSG 

Bad message. During a read(), getmsg(), getpmsg(), or ioctl() I_RECVFD request to a STREAMS device, a message arrived at the head of the STREAM that is inappropriate for the function receiving the message. read() Message waiting to be read on a STREAM is not a data message. getmsg() or getpmsg() A file descriptor was received instead of a control message. ioctl() Control or data information was received instead of a file descriptor when I_RECVFD was specified.

EBUSY 

Resource busy. An attempt was made to make use of a system resource that is not currently available, as it is being used by another process in a manner that would have conflicted with the request being made by this process.

ECANCELED 

Operation canceled. The associated asynchronous operation was canceled before completion.

ECHILD 

No child process. A wait(), waitid(), or waitpid() function was executed by a process that had no existing or unwaited-for child process.

ECONNABORTED 

Connection aborted. The connection has been aborted.

ECONNREFUSED 

Connection refused. An attempt to connect to a socket was refused because there was no process listening or because the queue of connection requests was full and the underlying protocol does not support retransmissions.

ECONNRESET 

Connection reset. The connection was forcibly closed by the peer.

EDEADLK 

Resource deadlock would occur. An attempt was made to lock a system resource that would have resulted in a deadlock situation.

EDESTADDRREQ 

Destination address required. No bind address was established.

EDOM 

Domain error. An input argument is outside the defined domain of the mathematical function (defined in the ISO C standard).

EDQUOT 

Reserved.

EEXIST 

File exists. An existing file was mentioned in an inappropriate context; for example, as a new link name in the link() function.

EFAULT 

Bad address. The system detected an invalid address in attempting to use an argument of a call. The reliable detection of this error cannot be guaranteed, and when not detected may result in the generation of a signal, indicating an address violation, which is sent to the process.

EFBIG 

File too large. The size of a file would exceed the maximum file size of an implementation or offset maximum established in the corresponding file description.

EHOSTUNREACH 

Host is unreachable. The destination host cannot be reached (probably because the host is down or a remote router cannot reach it).

EIDRM 

Identifier removed. Returned during XSI interprocess communication if an identifier has been removed from the system.

EILSEQ 

Illegal byte sequence. A wide-character code has been detected that does not correspond to a valid character, or a byte sequence does not form a valid wide-character code (defined in the ISO C standard).

EINPROGRESS 

Operation in progress. This code is used to indicate that an asynchronous operation has not yet completed. or: O_NONBLOCK is set for the socket file descriptor and the connection cannot be immediately established.

EINTR 

Interrupted function call. An asynchronous signal was caught by the process during the execution of an interruptible function. If the signal handler performs a normal return, the interrupted function call may return this condition (see the Base Definitions volume of POSIX.1-2017, <signal.h>).

EINVAL 

Invalid argument. Some invalid argument was supplied; for example, specifying an undefined signal in a signal() function or a kill() function.

EIO 

Input/output error. Some physical input or output error has occurred. This error may be reported on a subsequent operation on the same file descriptor. Any other error-causing operation on the same file descriptor may cause the [EIO] error indication to be lost.

EISCONN 

Socket is connected. The specified socket is already connected.

EISDIR 

Is a directory. An attempt was made to open a directory with write mode specified.

ELOOP 

Symbolic link loop. A loop exists in symbolic links encountered during pathname resolution. This error may also be returned if more than {SYMLOOP_MAX} symbolic links are encountered during pathname resolution.

EMFILE 

File descriptor value too large or too many open streams. An attempt was made to open a file descriptor with a value greater than or equal to {OPEN_MAX}, or an attempt was made to open more than the maximum number of streams allowed in the process.

EMLINK 

Too many links. An attempt was made to have the link count of a single file exceed {LINK_MAX}.

EMSGSIZE 

Message too large. A message sent on a transport provider was larger than an internal message buffer or some other network limit. or: Inappropriate message buffer length.

EMULTIHOP 

Reserved.

ENAMETOOLONG 

Filename too long. The length of a pathname exceeds {PATH_MAX} and the implementation considers this to be an error, or a pathname component is longer than {NAME_MAX}. This error may also occur when pathname substitution, as a result of encountering a symbolic link during pathname resolution, results in a pathname string the size of which exceeds {PATH_MAX}.

ENETDOWN 

Network is down. The local network interface used to reach the destination is down.

ENETRESET 

The connection was aborted by the network.

ENETUNREACH 

Network unreachable. No route to the network is present.

ENFILE 

Too many files open in system. Too many files are currently open in the system. The system has reached its predefined limit for simultaneously open files and temporarily cannot accept requests to open another one.

ENOBUFS 

No buffer space available. Insufficient buffer resources were available in the system to perform the socket operation.

ENODATA 

No message available. No message is available on the STREAM head read queue.

ENODEV 

No such device. An attempt was made to apply an inappropriate function to a device; for example, trying to read a write-only device such as a printer.

ENOENT 

No such file or directory. A component of a specified pathname does not exist, or the pathname is an empty string.

ENOEXEC 

Executable file format error. A request is made to execute a file that, although it has appropriate privileges, is not in the format required by the implementation for executable files.

ENOLCK 

No locks available. A system-imposed limit on the number of simultaneous file and record locks has been reached and no more are currently available.

ENOLINK 

Reserved.

ENOMEM 

Not enough space. The new process image requires more memory than is allowed by the hardware or system-imposed memory management constraints.

ENOMSG 

No message of the desired type. The message queue does not contain a message of the required type during XSI interprocess communication.

ENOPROTOOPT 

Protocol not available. The protocol option specified to setsockopt() is not supported by the implementation.

ENOSPC 

No space left on a device. During the write() function on a regular file or when extending a directory, there is no free space left on the device.

ENOSR 

No STREAM resources. Insufficient STREAMS memory resources are available to perform a STREAMS-related function. This is a temporary condition; it may be recovered from if other processes release resources.

ENOSTR 

Not a STREAM. A STREAM function was attempted on a file descriptor that was not associated with a STREAMS device.

ENOSYS 

Functionality not supported. An attempt was made to use optional functionality that is not supported in this implementation.

ENOTCONN 

Socket not connected. The socket is not connected.

ENOTDIR 

Not a directory. A component of the specified pathname exists, but it is not a directory, when a directory was expected; or an attempt was made to create a non-directory file, and the specified pathname contains at least one non- <slash> character and ends with one or more trailing <slash> characters.

ENOTEMPTY 

Directory not empty. A directory other than an empty directory was supplied when an empty directory was expected.

ENOTRECOVERABLE 

State not recoverable. The state protected by a robust mutex is not recoverable.

ENOTSOCK 

Not a socket. The file descriptor does not refer to a socket.

ENOTSUP 

Not supported. The implementation does not support the requested feature or value.

ENOTTY 

Inappropriate I/O control operation. A control function has been attempted for a file or special file for which the operation is inappropriate.

ENXIO 

No such device or address. Input or output on a special file refers to a device that does not exist, or makes a request beyond the capabilities of the device. It may also occur when, for example, a tape drive is not on-line.

EOPNOTSUPP 

Operation not supported on socket. The type of socket (address family or protocol) does not support the requested operation.

EOVERFLOW 

Value too large to be stored in data type. An operation was attempted which would generate a value that is outside the range of values that can be represented in the relevant data type or that are allowed for a given data item.

EOWNERDEAD 

Previous owner died. The owner of a robust mutex terminated while holding the mutex lock.

EPERM 

Operation not permitted. An attempt was made to perform an operation limited to processes with appropriate privileges or to the owner of a file or other resource.

EPIPE 

Broken pipe. A write was attempted on a socket, pipe, or FIFO for which there is no process to read the data.

EPROTO 

Protocol error. Some protocol error occurred. This error is device-specific, but is generally not related to a hardware failure.

EPROTONOSUPPORT 

Protocol not supported. The protocol is not supported by the address family, or the protocol is not supported by the implementation.

EPROTOTYPE 

Protocol wrong type for socket. The socket type is not supported by the protocol.

ERANGE 

Result too large or too small. The result of the function is too large (overflow) or too small (underflow) to be represented in the available space.

EROFS 

Read-only file system. An attempt was made to modify a file or directory on a file system that is read-only.

ESPIPE 

Invalid seek. An attempt was made to access the file offset associated with a pipe or FIFO.

ESRCH 

No such process. No process can be found corresponding to that specified by the given process ID.

ESTALE 

Reserved.

ETIME 

STREAM ioctl() timeout. The timer set for a STREAMS ioctl() call has expired. The cause of this error is device-specific and could indicate either a hardware or software failure, or a timeout value that is too short for the specific operation. The status of the ioctl() operation is unspecified.

ETIMEDOUT 

Connection timed out. The connection to a remote machine has timed out. If the connection timed out during execution of the function that reported this error (as opposed to timing out prior to the function being called), it is unspecified whether the function has completed some or all of the documented behavior associated with a successful completion of the function. or: Operation timed out. The time limit associated with the operation was exceeded before the operation completed.

ETXTBSY 

Text file busy. An attempt was made to execute a pure-procedure program that is currently open for writing, or an attempt has been made to open for writing a pure-procedure program that is being executed.

EWOULDBLOCK 

Operation would block. An operation on a socket marked as non-blocking has encountered a situation such as no data available that otherwise would have caused the function to suspend execution.

EXDEV 

Improper link. A link to a file on another file system was attempted.

__ERRNO_MAX 

Definition at line 28 of file errno.h.

29 {
33  EOK = 0,
34 
44  E2BIG = 1,
45 
50  EACCES = 2,
51 
55  EADDRINUSE = 3,
56 
61  EADDRNOTAVAIL = 4,
62 
68  EAFNOSUPPORT = 5,
69 
74  EAGAIN = 6,
75 
80  EALREADY = 7,
81 
87  EBADF = 8,
88 
102  EBADMSG = 9,
103 
110  EBUSY = 10,
111 
116  ECANCELED = 11,
117 
123  ECHILD = 12,
124 
128  ECONNABORTED = 13,
129 
136  ECONNREFUSED = 14,
137 
141  ECONNRESET = 15,
142 
147  EDEADLK = 16,
148 
152  EDESTADDRREQ = 17,
153 
158  EDOM = 18,
159 
163  EDQUOT = 19,
164 
169  EEXIST = 20,
170 
178  EFAULT = 21,
179 
185  EFBIG = 22,
186 
192  EHOSTUNREACH = 23,
193 
198  EIDRM = 24,
199 
205  EILSEQ = 25,
206 
214  EINPROGRESS = 26,
215 
223  EINTR = 27,
224 
230  EINVAL = 28,
231 
238  EIO = 29,
239 
243  EISCONN = 30,
244 
249  EISDIR = 31,
250 
257  ELOOP = 32,
258 
265  EMFILE = 33,
266 
271  EMLINK = 34,
272 
279  EMSGSIZE = 35,
280 
284  EMULTIHOP = 36,
285 
294  ENAMETOOLONG = 37,
295 
300  ENETDOWN = 38,
301 
305  ENETRESET = 39,
306 
310  ENETUNREACH = 40,
311 
318  ENFILE = 41,
319 
324  ENOBUFS = 42,
325 
330  ENODATA = 43,
331 
337  ENODEV = 44,
338 
343  ENOENT = 45,
344 
350  ENOEXEC = 46,
351 
357  ENOLCK = 47,
358 
362  ENOLINK = 48,
363 
369  ENOMEM = 49,
370 
375  ENOMSG = 50,
376 
381  ENOPROTOOPT = 51,
382 
388  ENOSPC = 52,
389 
396  ENOSR = 53,
397 
402  ENOSTR = 54,
403 
408  ENOSYS = 55,
409 
413  ENOTCONN = 56,
414 
422  ENOTDIR = 57,
423 
428  ENOTEMPTY = 58,
429 
434  ENOTRECOVERABLE = 59,
435 
439  ENOTSOCK = 60,
440 
445  ENOTSUP = 61,
446 
452  ENOTTY = 62,
453 
460  ENXIO = 63,
461 
466  EOPNOTSUPP = 64,
467 
474  EOVERFLOW = 65,
475 
480  EOWNERDEAD = 66,
481 
487  EPERM = 67,
488 
493  EPIPE = 68,
494 
500  EPROTO = 69,
501 
507  EPROTONOSUPPORT = 70,
508 
513  EPROTOTYPE = 71,
514 
520  ERANGE = 72,
521 
526  EROFS = 73,
527 
532  ESPIPE = 74,
533 
538  ESRCH = 75,
539 
543  ESTALE = 76,
544 
552  ETIME = 77,
553 
566  ETIMEDOUT = 78,
567 
574  ETXTBSY = 79,
575 
581  EWOULDBLOCK = 80,
582 
586  EXDEV = 81,
587 
589 } KernelErrors;
KernelErrors
Definition: errno.h:29
@ EMFILE
Definition: errno.h:265
@ EMSGSIZE
Definition: errno.h:279
@ ENOTCONN
Definition: errno.h:413
@ ENOTSOCK
Definition: errno.h:439
@ ECONNREFUSED
Definition: errno.h:136
@ EPERM
Definition: errno.h:487
@ ETIME
Definition: errno.h:552
@ ENXIO
Definition: errno.h:460
@ EOK
Definition: errno.h:33
@ EDOM
Definition: errno.h:158
@ EISCONN
Definition: errno.h:243
@ ENOSPC
Definition: errno.h:388
@ ENODATA
Definition: errno.h:330
@ ENETUNREACH
Definition: errno.h:310
@ ENOMSG
Definition: errno.h:375
@ EFBIG
Definition: errno.h:185
@ ENOTRECOVERABLE
Definition: errno.h:434
@ ERANGE
Definition: errno.h:520
@ EDEADLK
Definition: errno.h:147
@ EAGAIN
Definition: errno.h:74
@ ECONNRESET
Definition: errno.h:141
@ ESRCH
Definition: errno.h:538
@ EEXIST
Definition: errno.h:169
@ EWOULDBLOCK
Definition: errno.h:581
@ EROFS
Definition: errno.h:526
@ ETIMEDOUT
Definition: errno.h:566
@ EPROTO
Definition: errno.h:500
@ EACCES
Definition: errno.h:50
@ ENOTSUP
Definition: errno.h:445
@ EADDRNOTAVAIL
Definition: errno.h:61
@ ECONNABORTED
Definition: errno.h:128
@ ENOSR
Definition: errno.h:396
@ EISDIR
Definition: errno.h:249
@ ENOLCK
Definition: errno.h:357
@ EIO
Definition: errno.h:238
@ ESTALE
Definition: errno.h:543
@ E2BIG
Definition: errno.h:44
@ EHOSTUNREACH
Definition: errno.h:192
@ EINVAL
Definition: errno.h:230
@ ETXTBSY
Definition: errno.h:574
@ __ERRNO_MAX
Definition: errno.h:588
@ EDQUOT
Definition: errno.h:163
@ EBADF
Definition: errno.h:87
@ EINTR
Definition: errno.h:223
@ ENOTDIR
Definition: errno.h:422
@ EPROTONOSUPPORT
Definition: errno.h:507
@ EBADMSG
Definition: errno.h:102
@ EXDEV
Definition: errno.h:586
@ ENETRESET
Definition: errno.h:305
@ ENOENT
Definition: errno.h:343
@ EMULTIHOP
Definition: errno.h:284
@ EBUSY
Definition: errno.h:110
@ ESPIPE
Definition: errno.h:532
@ EOPNOTSUPP
Definition: errno.h:466
@ EILSEQ
Definition: errno.h:205
@ EPROTOTYPE
Definition: errno.h:513
@ ENOSTR
Definition: errno.h:402
@ ENOSYS
Definition: errno.h:408
@ ENAMETOOLONG
Definition: errno.h:294
@ ELOOP
Definition: errno.h:257
@ EDESTADDRREQ
Definition: errno.h:152
@ ENOTEMPTY
Definition: errno.h:428
@ EOVERFLOW
Definition: errno.h:474
@ ENOPROTOOPT
Definition: errno.h:381
@ EADDRINUSE
Definition: errno.h:55
@ ENOEXEC
Definition: errno.h:350
@ ENOBUFS
Definition: errno.h:324
@ ENOLINK
Definition: errno.h:362
@ ENODEV
Definition: errno.h:337
@ EPIPE
Definition: errno.h:493
@ ECHILD
Definition: errno.h:123
@ EMLINK
Definition: errno.h:271
@ ENOMEM
Definition: errno.h:369
@ ECANCELED
Definition: errno.h:116
@ ENETDOWN
Definition: errno.h:300
@ EOWNERDEAD
Definition: errno.h:480
@ EIDRM
Definition: errno.h:198
@ EALREADY
Definition: errno.h:80
@ ENOTTY
Definition: errno.h:452
@ EAFNOSUPPORT
Definition: errno.h:68
@ EFAULT
Definition: errno.h:178
@ ENFILE
Definition: errno.h:318
@ EINPROGRESS
Definition: errno.h:214

Function Documentation

◆ __errno_location()

int* __errno_location ( void  ) const

◆ strerror()

char* strerror ( int  errnum)