PSXSDK
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
errno.h
Go to the documentation of this file.
1 /*
2  * errno.h
3  *
4  * PSXSDK
5  */
6 
7 #ifndef _ERRNO_H
8 #define _ERRNO_H
9 
10 // There is no real support for errno, this include exists
11 // mostly to make things compile
12 
13 /*
14  * Declarations from NetBSD's /usr/include/sys/errno.h
15  * BSD license
16  */
17 
18 #ifndef __IN_LIBC
19 extern int errno;
20 #endif
21 
22 #define EPERM 1 /* Operation not permitted */
23 #define ENOENT 2 /* No such file or directory */
24 #define ESRCH 3 /* No such process */
25 #define EINTR 4 /* Interrupted system call */
26 #define EIO 5 /* Input/output error */
27 #define ENXIO 6 /* Device not configured */
28 #define E2BIG 7 /* Argument list too long */
29 #define ENOEXEC 8 /* Exec format error */
30 #define EBADF 9 /* Bad file descriptor */
31 #define ECHILD 10 /* No child processes */
32 #define EDEADLK 11 /* Resource deadlock avoided */
33  /* 11 was EAGAIN */
34 #define ENOMEM 12 /* Cannot allocate memory */
35 #define EACCES 13 /* Permission denied */
36 #define EFAULT 14 /* Bad address */
37 #define ENOTBLK 15 /* Block device required */
38 #define EBUSY 16 /* Device busy */
39 #define EEXIST 17 /* File exists */
40 #define EXDEV 18 /* Cross-device link */
41 #define ENODEV 19 /* Operation not supported by device */
42 #define ENOTDIR 20 /* Not a directory */
43 #define EISDIR 21 /* Is a directory */
44 #define EINVAL 22 /* Invalid argument */
45 #define ENFILE 23 /* Too many open files in system */
46 #define EMFILE 24 /* Too many open files */
47 #define ENOTTY 25 /* Inappropriate ioctl for device */
48 #define ETXTBSY 26 /* Text file busy */
49 #define EFBIG 27 /* File too large */
50 #define ENOSPC 28 /* No space left on device */
51 #define ESPIPE 29 /* Illegal seek */
52 #define EROFS 30 /* Read-only file system */
53 #define EMLINK 31 /* Too many links */
54 #define EPIPE 32 /* Broken pipe */
55 
56 /* math software */
57 #define EDOM 33 /* Numerical argument out of domain */
58 #define ERANGE 34 /* Result too large or too small */
59 
60 /* non-blocking and interrupt i/o */
61 #define EAGAIN 35 /* Resource temporarily unavailable */
62 #define EWOULDBLOCK EAGAIN /* Operation would block */
63 #define EINPROGRESS 36 /* Operation now in progress */
64 #define EALREADY 37 /* Operation already in progress */
65 
66 /* ipc/network software -- argument errors */
67 #define ENOTSOCK 38 /* Socket operation on non-socket */
68 #define EDESTADDRREQ 39 /* Destination address required */
69 #define EMSGSIZE 40 /* Message too long */
70 #define EPROTOTYPE 41 /* Protocol wrong type for socket */
71 #define ENOPROTOOPT 42 /* Protocol option not available */
72 #define EPROTONOSUPPORT 43 /* Protocol not supported */
73 #define ESOCKTNOSUPPORT 44 /* Socket type not supported */
74 #define EOPNOTSUPP 45 /* Operation not supported */
75 #define EPFNOSUPPORT 46 /* Protocol family not supported */
76 #define EAFNOSUPPORT 47 /* Address family not supported by protocol family */
77 #define EADDRINUSE 48 /* Address already in use */
78 #define EADDRNOTAVAIL 49 /* Can't assign requested address */
79 
80 /* ipc/network software -- operational errors */
81 #define ENETDOWN 50 /* Network is down */
82 #define ENETUNREACH 51 /* Network is unreachable */
83 #define ENETRESET 52 /* Network dropped connection on reset */
84 #define ECONNABORTED 53 /* Software caused connection abort */
85 #define ECONNRESET 54 /* Connection reset by peer */
86 #define ENOBUFS 55 /* No buffer space available */
87 #define EISCONN 56 /* Socket is already connected */
88 #define ENOTCONN 57 /* Socket is not connected */
89 #define ESHUTDOWN 58 /* Can't send after socket shutdown */
90 #define ETOOMANYREFS 59 /* Too many references: can't splice */
91 #define ETIMEDOUT 60 /* Operation timed out */
92 #define ECONNREFUSED 61 /* Connection refused */
93 
94 #define ELOOP 62 /* Too many levels of symbolic links */
95 #define ENAMETOOLONG 63 /* File name too long */
96 
97 /* should be rearranged */
98 #define EHOSTDOWN 64 /* Host is down */
99 #define EHOSTUNREACH 65 /* No route to host */
100 #define ENOTEMPTY 66 /* Directory not empty */
101 
102 /* quotas & mush */
103 #define EPROCLIM 67 /* Too many processes */
104 #define EUSERS 68 /* Too many users */
105 #define EDQUOT 69 /* Disc quota exceeded */
106 
107 /* Network File System */
108 #define ESTALE 70 /* Stale NFS file handle */
109 #define EREMOTE 71 /* Too many levels of remote in path */
110 #define EBADRPC 72 /* RPC struct is bad */
111 #define ERPCMISMATCH 73 /* RPC version wrong */
112 #define EPROGUNAVAIL 74 /* RPC prog. not avail */
113 #define EPROGMISMATCH 75 /* Program version wrong */
114 #define EPROCUNAVAIL 76 /* Bad procedure for program */
115 
116 #define ENOLCK 77 /* No locks available */
117 #define ENOSYS 78 /* Function not implemented */
118 
119 #define EFTYPE 79 /* Inappropriate file type or format */
120 #define EAUTH 80 /* Authentication error */
121 #define ENEEDAUTH 81 /* Need authenticator */
122 
123 /* SystemV IPC */
124 #define EIDRM 82 /* Identifier removed */
125 #define ENOMSG 83 /* No message of desired type */
126 #define EOVERFLOW 84 /* Value too large to be stored in data type */
127 
128 /* Wide/multibyte-character handling, ISO/IEC 9899/AMD1:1995 */
129 #define EILSEQ 85 /* Illegal byte sequence */
130 
131 /* From IEEE Std 1003.1-2001 */
132 /* Base, Realtime, Threads or Thread Priority Scheduling option errors */
133 #define ENOTSUP 86 /* Not supported */
134 
135 /* Realtime option errors */
136 #define ECANCELED 87 /* Operation canceled */
137 
138 /* Realtime, XSI STREAMS option errors */
139 #define EBADMSG 88 /* Bad or Corrupt message */
140 
141 /* XSI STREAMS option errors */
142 #define ENODATA 89 /* No message available */
143 #define ENOSR 90 /* No STREAM resources */
144 #define ENOSTR 91 /* Not a STREAM */
145 #define ETIME 92 /* STREAM ioctl timeout */
146 
147 /* File system extended attribute errors */
148 #define ENOATTR 93 /* Attribute not found */
149 
150 /* Realtime, XSI STREAMS option errors */
151 #define EMULTIHOP 94 /* Multihop attempted */
152 #define ENOLINK 95 /* Link has been severed */
153 #define EPROTO 96 /* Protocol error */
154 
155 #define ELAST 96 /* Must equal largest errno */
156 
157 #ifdef _KERNEL
158 /* pseudo-errors returned inside kernel to modify return to process */
159 #define EJUSTRETURN -2 /* don't modify regs, just return */
160 #define ERESTART -3 /* restart syscall */
161 #define EPASSTHROUGH -4 /* ioctl not handled by this layer */
162 #define EDUPFD -5 /* Dup given fd */
163 #define EMOVEFD -6 /* Move given fd */
164 #endif
165 
166 #endif
167