As per a suggestion on irc, wrap each of the error macros in ( ).
[newos.git] / include / newos / errors.h
blobfb030a50c9466eb1030acd783844ca1457ffe98e
1 /*
2 ** Copyright 2001, Travis Geiselbrecht. All rights reserved.
3 ** Distributed under the terms of the NewOS License.
4 */
5 #ifndef _SYS_ERRORS_H
6 #define _SYS_ERRORS_H
8 #define NO_ERROR 0
10 /* General errors */
11 #define ERR_GENERAL (-1)
12 #define ERR_NO_MEMORY (ERR_GENERAL-1)
13 #define ERR_IO_ERROR (ERR_GENERAL-2)
14 #define ERR_INVALID_ARGS (ERR_GENERAL-3)
15 #define ERR_TIMED_OUT (ERR_GENERAL-4)
16 #define ERR_NOT_ALLOWED (ERR_GENERAL-5)
17 #define ERR_PERMISSION_DENIED (ERR_GENERAL-6)
18 #define ERR_INVALID_BINARY (ERR_GENERAL-7)
19 #define ERR_INVALID_HANDLE (ERR_GENERAL-8)
20 #define ERR_NO_MORE_HANDLES (ERR_GENERAL-9)
21 #define ERR_UNIMPLEMENTED (ERR_GENERAL-10)
22 #define ERR_TOO_BIG (ERR_GENERAL-11)
23 #define ERR_NOT_FOUND (ERR_GENERAL-12)
24 #define ERR_NOT_IMPLEMENTED (ERR_GENERAL-13)
25 #define ERR_NOMORE_HANDLES (ERR_GENERAL-14)
27 /* Semaphore errors */
28 #define ERR_SEM_GENERAL (-1024)
29 #define ERR_SEM_DELETED (ERR_SEM_GENERAL-1)
30 #define ERR_SEM_TIMED_OUT (ERR_SEM_GENERAL-2)
31 #define ERR_SEM_OUT_OF_SLOTS (ERR_SEM_GENERAL-3)
32 #define ERR_SEM_NOT_ACTIVE (ERR_SEM_GENERAL-4)
33 #define ERR_SEM_INTERRUPTED (ERR_SEM_GENERAL-5)
34 #define ERR_SEM_NOT_INTERRUPTABLE (ERR_SEM_GENERAL-6)
35 #define ERR_SEM_NOT_FOUND (ERR_SEM_GENERAL-7)
38 /* Tasker errors */
39 #define ERR_TASK_GENERAL (-2048)
40 #define ERR_TASK_PROC_DELETED (ERR_TASK_GENERAL-1)
42 /* VFS errors */
43 #define ERR_VFS_GENERAL (-3072)
44 #define ERR_VFS_INVALID_FS (ERR_VFS_GENERAL-1)
45 #define ERR_VFS_NOT_MOUNTPOINT (ERR_VFS_GENERAL-2)
46 #define ERR_VFS_PATH_NOT_FOUND (ERR_VFS_GENERAL-3)
47 #define ERR_VFS_INSUFFICIENT_BUF (ERR_VFS_GENERAL-4)
48 #define ERR_VFS_READONLY_FS (ERR_VFS_GENERAL-5)
49 #define ERR_VFS_ALREADY_EXISTS (ERR_VFS_GENERAL-6)
50 #define ERR_VFS_FS_BUSY (ERR_VFS_GENERAL-7)
51 #define ERR_VFS_FD_TABLE_FULL (ERR_VFS_GENERAL-8)
52 #define ERR_VFS_CROSS_FS_RENAME (ERR_VFS_GENERAL-9)
53 #define ERR_VFS_DIR_NOT_EMPTY (ERR_VFS_GENERAL-10)
54 #define ERR_VFS_NOT_DIR (ERR_VFS_GENERAL-11)
55 #define ERR_VFS_WRONG_STREAM_TYPE (ERR_VFS_GENERAL-12)
56 #define ERR_VFS_ALREADY_MOUNTPOINT (ERR_VFS_GENERAL-13)
58 /* VM errors */
59 #define ERR_VM_GENERAL (-4096)
60 #define ERR_VM_INVALID_ASPACE (ERR_VM_GENERAL-1)
61 #define ERR_VM_INVALID_REGION (ERR_VM_GENERAL-2)
62 #define ERR_VM_BAD_ADDRESS (ERR_VM_GENERAL-3)
63 #define ERR_VM_PF_FATAL (ERR_VM_GENERAL-4)
64 #define ERR_VM_PF_BAD_ADDRESS (ERR_VM_GENERAL-5)
65 #define ERR_VM_PF_BAD_PERM (ERR_VM_GENERAL-6)
66 #define ERR_VM_PAGE_NOT_PRESENT (ERR_VM_GENERAL-7)
67 #define ERR_VM_NO_REGION_SLOT (ERR_VM_GENERAL-8)
68 #define ERR_VM_WOULD_OVERCOMMIT (ERR_VM_GENERAL-9)
69 #define ERR_VM_BAD_USER_MEMORY (ERR_VM_GENERAL-10)
71 /* Elf errors */
72 #define ERR_ELF_GENERAL (-5120)
73 #define ERR_ELF_RESOLVING_SYMBOL (ERR_ELF_GENERAL-1)
75 /* Ports errors */
76 #define ERR_PORT_GENERAL (-6144)
77 #define ERR_PORT_DELETED (ERR_PORT_GENERAL-1)
78 #define ERR_PORT_OUT_OF_SLOTS (ERR_PORT_GENERAL-2)
79 #define ERR_PORT_NOT_ACTIVE (ERR_PORT_GENERAL-3)
80 #define ERR_PORT_CLOSED (ERR_PORT_GENERAL-4)
81 #define ERR_PORT_TIMED_OUT (ERR_PORT_GENERAL-5)
82 #define ERR_PORT_INTERRUPTED (ERR_PORT_GENERAL-6)
83 #define ERR_PORT_NOT_FOUND (ERR_PORT_GENERAL-7)
85 /* Net errors */
86 #define ERR_NET_GENERAL (-7168)
87 #define ERR_NET_FAILED_ARP (ERR_NET_GENERAL-1)
88 #define ERR_NET_BAD_PACKET (ERR_NET_GENERAL-2)
89 #define ERR_NET_ARP_QUEUED (ERR_NET_GENERAL-3)
90 #define ERR_NET_NO_ROUTE (ERR_NET_GENERAL-4)
91 #define ERR_NET_SOCKET_ALREADY_BOUND (ERR_NET_GENERAL-5)
92 #define ERR_NET_ALREADY_CONNECTED (ERR_NET_GENERAL-6)
93 #define ERR_NET_CONNECTION_REFUSED (ERR_NET_GENERAL-7)
94 #define ERR_NET_NOT_CONNECTED (ERR_NET_GENERAL-8)
95 #define ERR_NET_REMOTE_CLOSE (ERR_NET_GENERAL-9)
96 #define ERR_NET_NOT_LISTENING (ERR_NET_GENERAL-10)
97 #define ERR_NET_BAD_ADDRESS (ERR_NET_GENERAL-11)
99 /* Pipe errors */
100 #define ERR_PIPE_GENERAL (-8192)
101 #define ERR_PIPE_WIDOW (ERR_PIPE_GENERAL-1)
103 #endif