20#include <kernel/types.h>
22#include <utils/compiler.h>
71static ALWAYS_INLINE
void *
PTR_ERR(error_t err)
73 return (
void *)((native_t)-err);
83#define IS_ERR(_x) ((native_t)(_x) > ((u32) - E_TOTAL_COUNT))
static ALWAYS_INLINE error_t ERR_FROM_PTR(const void *ptr)
Extract the error value contained inside a pointer
Definition: error.h:77
const char * err_to_str(error_t)
Retrieve the string description of an error code.
Definition: error.c:45
error
All the error types used in ths project.
Definition: error.h:28
static ALWAYS_INLINE void * PTR_ERR(error_t err)
Construct a pointer containing info about an error.
Definition: error.h:71
@ E_BAD_FD
File descriptor in bad state.
Definition: error.h:47
@ E_ADDR_IN_USE
Address already in use.
Definition: error.h:58
@ E_SEEK_PIPE
Illegal seek.
Definition: error.h:43
@ E_NOMEM
Out of memory.
Definition: error.h:34
@ E_TOTAL_COUNT
Total number of error codes, only used as a reference.
Definition: error.h:66
@ E_PROTOTYPE
Protocol wrong type for socket.
Definition: error.h:51
@ E_NOT_CONNECTED
Transport endpoint is not connected.
Definition: error.h:64
@ E_ADDR_NOT_AVAILABLE
Cannot assign requested address.
Definition: error.h:59
@ E_NOT_DIRECTORY
Is not a directory.
Definition: error.h:38
@ E_NET_UNREACHABLE
Network is unreachable.
Definition: error.h:61
@ E_EXIST
File exists.
Definition: error.h:36
@ E_SOCK_T_NOT_SUPPORTED
Socket type not supported.
Definition: error.h:54
@ E_NOT_SOCKET
Socket operation on non-socket.
Definition: error.h:48
@ E_NO_PROTO_OPT
Protocol not available.
Definition: error.h:52
@ E_NET_DOWN
Network is down.
Definition: error.h:60
@ E_READ_ONLY_FS
Read-only file system.
Definition: error.h:44
@ E_MSG_SIZE
Message too long.
Definition: error.h:50
@ E_PERM
Operation not permitted.
Definition: error.h:30
@ E_NO_BUFFER_SPACE
Not enough buffer space.
Definition: error.h:62
@ E_BUSY
Device or resource busy.
Definition: error.h:35
@ E_NAME_TOO_LONG
File name too long.
Definition: error.h:45
@ E_NFILE
File table overflow.
Definition: error.h:41
@ E_INVAL
Invalid argument.
Definition: error.h:40
@ E_WOULD_BLOCK
Resource temporarily unavailable.
Definition: error.h:33
@ E_NOT_IMPLEMENTED
Function not implemented.
Definition: error.h:46
@ E_AF_NOT_SUPPORTED
Address family not supported by protocol.
Definition: error.h:57
@ E_NOT_SUPPORTED
Operation not supported.
Definition: error.h:55
@ E_SUCCESS
No error.
Definition: error.h:29
@ E_IS_CONNECTED
Transport endpoint is already connected.
Definition: error.h:63
@ E_IO
I/O error.
Definition: error.h:32
@ E_MFILE
Too many opened files.
Definition: error.h:42
@ E_NODEV
No such device.
Definition: error.h:37
@ E_NOENT
Entry not found.
Definition: error.h:31
@ E_PROTO_NOT_SUPPORTED
Protocol not supported.
Definition: error.h:53
@ E_PF_NOT_SUPPORTED
Protocol family not supported.
Definition: error.h:56
@ E_IS_DIRECTORY
Is a directory.
Definition: error.h:39
@ E_DEST_ADDR_REQUIRED
Destination address required.
Definition: error.h:49