xref: /netbsd/sys/sys/errno.h (revision c4a72b64)
1 /*	$NetBSD: errno.h,v 1.29 2002/11/12 13:52:28 kleink Exp $	*/
2 
3 /*
4  * Copyright (c) 1982, 1986, 1989, 1993
5  *	The Regents of the University of California.  All rights reserved.
6  * (c) UNIX System Laboratories, Inc.
7  * All or some portions of this file are derived from material licensed
8  * to the University of California by American Telephone and Telegraph
9  * Co. or Unix System Laboratories, Inc. and are reproduced herein with
10  * the permission of UNIX System Laboratories, Inc.
11  *
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions
14  * are met:
15  * 1. Redistributions of source code must retain the above copyright
16  *    notice, this list of conditions and the following disclaimer.
17  * 2. Redistributions in binary form must reproduce the above copyright
18  *    notice, this list of conditions and the following disclaimer in the
19  *    documentation and/or other materials provided with the distribution.
20  * 3. All advertising materials mentioning features or use of this software
21  *    must display the following acknowledgement:
22  *	This product includes software developed by the University of
23  *	California, Berkeley and its contributors.
24  * 4. Neither the name of the University nor the names of its contributors
25  *    may be used to endorse or promote products derived from this software
26  *    without specific prior written permission.
27  *
28  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
29  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
30  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
31  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
32  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
37  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38  * SUCH DAMAGE.
39  *
40  *	@(#)errno.h	8.5 (Berkeley) 1/21/94
41  */
42 
43 #ifndef _SYS_ERRNO_H_
44 #define _SYS_ERRNO_H_
45 
46 #define	EPERM		1		/* Operation not permitted */
47 #define	ENOENT		2		/* No such file or directory */
48 #define	ESRCH		3		/* No such process */
49 #define	EINTR		4		/* Interrupted system call */
50 #define	EIO		5		/* Input/output error */
51 #define	ENXIO		6		/* Device not configured */
52 #define	E2BIG		7		/* Argument list too long */
53 #define	ENOEXEC		8		/* Exec format error */
54 #define	EBADF		9		/* Bad file descriptor */
55 #define	ECHILD		10		/* No child processes */
56 #define	EDEADLK		11		/* Resource deadlock avoided */
57 					/* 11 was EAGAIN */
58 #define	ENOMEM		12		/* Cannot allocate memory */
59 #define	EACCES		13		/* Permission denied */
60 #define	EFAULT		14		/* Bad address */
61 #if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE)
62 #define	ENOTBLK		15		/* Block device required */
63 #endif /* !_POSIX_SOURCE && !_XOPEN_SOURCE */
64 #define	EBUSY		16		/* Device busy */
65 #define	EEXIST		17		/* File exists */
66 #define	EXDEV		18		/* Cross-device link */
67 #define	ENODEV		19		/* Operation not supported by device */
68 #define	ENOTDIR		20		/* Not a directory */
69 #define	EISDIR		21		/* Is a directory */
70 #define	EINVAL		22		/* Invalid argument */
71 #define	ENFILE		23		/* Too many open files in system */
72 #define	EMFILE		24		/* Too many open files */
73 #define	ENOTTY		25		/* Inappropriate ioctl for device */
74 #ifndef _POSIX_SOURCE
75 #define	ETXTBSY		26		/* Text file busy */
76 #endif /* !_POSIX_SOURCE */
77 #define	EFBIG		27		/* File too large */
78 #define	ENOSPC		28		/* No space left on device */
79 #define	ESPIPE		29		/* Illegal seek */
80 #define	EROFS		30		/* Read-only file system */
81 #define	EMLINK		31		/* Too many links */
82 #define	EPIPE		32		/* Broken pipe */
83 
84 /* math software */
85 #define	EDOM		33		/* Numerical argument out of domain */
86 #define	ERANGE		34		/* Result too large */
87 
88 /* non-blocking and interrupt i/o */
89 #define	EAGAIN		35		/* Resource temporarily unavailable */
90 #ifndef _POSIX_SOURCE
91 #define	EWOULDBLOCK	EAGAIN		/* Operation would block */
92 #define	EINPROGRESS	36		/* Operation now in progress */
93 #define	EALREADY	37		/* Operation already in progress */
94 
95 /* ipc/network software -- argument errors */
96 #define	ENOTSOCK	38		/* Socket operation on non-socket */
97 #define	EDESTADDRREQ	39		/* Destination address required */
98 #define	EMSGSIZE	40		/* Message too long */
99 #define	EPROTOTYPE	41		/* Protocol wrong type for socket */
100 #define	ENOPROTOOPT	42		/* Protocol not available */
101 #define	EPROTONOSUPPORT	43		/* Protocol not supported */
102 #ifndef _XOPEN_SOURCE
103 #define	ESOCKTNOSUPPORT	44		/* Socket type not supported */
104 #endif /* !_XOPEN_SOURCE */
105 #define	EOPNOTSUPP	45		/* Operation not supported */
106 #ifndef _XOPEN_SOURCE
107 #define	EPFNOSUPPORT	46		/* Protocol family not supported */
108 #endif /* !_XOPEN_SOURCE */
109 #define	EAFNOSUPPORT	47		/* Address family not supported by protocol family */
110 #define	EADDRINUSE	48		/* Address already in use */
111 #define	EADDRNOTAVAIL	49		/* Can't assign requested address */
112 
113 /* ipc/network software -- operational errors */
114 #define	ENETDOWN	50		/* Network is down */
115 #define	ENETUNREACH	51		/* Network is unreachable */
116 #ifndef _XOPEN_SOURCE
117 #define	ENETRESET	52		/* Network dropped connection on reset */
118 #endif /* !_XOPEN_SOURCE */
119 #define	ECONNABORTED	53		/* Software caused connection abort */
120 #define	ECONNRESET	54		/* Connection reset by peer */
121 #define	ENOBUFS		55		/* No buffer space available */
122 #define	EISCONN		56		/* Socket is already connected */
123 #define	ENOTCONN	57		/* Socket is not connected */
124 #ifndef _XOPEN_SOURCE
125 #define	ESHUTDOWN	58		/* Can't send after socket shutdown */
126 #define	ETOOMANYREFS	59		/* Too many references: can't splice */
127 #endif /* !_XOPEN_SOURCE */
128 #define	ETIMEDOUT	60		/* Operation timed out */
129 #define	ECONNREFUSED	61		/* Connection refused */
130 
131 #define	ELOOP		62		/* Too many levels of symbolic links */
132 #endif /* !_POSIX_SOURCE */
133 #define	ENAMETOOLONG	63		/* File name too long */
134 
135 /* should be rearranged */
136 #ifndef _POSIX_SOURCE
137 #ifndef _XOPEN_SOURCE
138 #define	EHOSTDOWN	64		/* Host is down */
139 #endif /* !_XOPEN_SOURCE */
140 #define	EHOSTUNREACH	65		/* No route to host */
141 #endif /* !_POSIX_SOURCE */
142 #define	ENOTEMPTY	66		/* Directory not empty */
143 
144 /* quotas & mush */
145 #ifndef _POSIX_SOURCE
146 #ifndef _XOPEN_SOURCE
147 #define	EPROCLIM	67		/* Too many processes */
148 #define	EUSERS		68		/* Too many users */
149 #endif /* !_XOPEN_SOURCE */
150 #define	EDQUOT		69		/* Disc quota exceeded */
151 
152 /* Network File System */
153 #define	ESTALE		70		/* Stale NFS file handle */
154 #ifndef _XOPEN_SOURCE
155 #define	EREMOTE		71		/* Too many levels of remote in path */
156 #define	EBADRPC		72		/* RPC struct is bad */
157 #define	ERPCMISMATCH	73		/* RPC version wrong */
158 #define	EPROGUNAVAIL	74		/* RPC prog. not avail */
159 #define	EPROGMISMATCH	75		/* Program version wrong */
160 #define	EPROCUNAVAIL	76		/* Bad procedure for program */
161 #endif /* !_XOPEN_SOURCE */
162 #endif /* !_POSIX_SOURCE */
163 
164 #define	ENOLCK		77		/* No locks available */
165 #define	ENOSYS		78		/* Function not implemented */
166 
167 #if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE)
168 #define	EFTYPE		79		/* Inappropriate file type or format */
169 #define	EAUTH		80		/* Authentication error */
170 #define	ENEEDAUTH	81		/* Need authenticator */
171 #endif /* !_POSIX_SOURCE && !_XOPEN_SOURCE */
172 
173 /* SystemV IPC */
174 #ifndef _POSIX_SOURCE
175 #define	EIDRM		82		/* Identifier removed */
176 #define	ENOMSG		83		/* No message of desired type */
177 #define	EOVERFLOW	84		/* Value too large to be stored in data type */
178 #endif /* !_POSIX_SOURCE */
179 
180 /* Wide/multibyte-character handling, ISO/IEC 9899/AMD1:1995 */
181 #define	EILSEQ		85		/* Illegal byte sequence */
182 
183 /* From IEEE Std 1003.1-2001 */
184 /* Base, Realtime, Threads or Thread Priority Scheduling option errors */
185 #define ENOTSUP		86		/* Not supported */
186 
187 /* Realtime option errors */
188 #define ECANCELED	87		/* Operation canceled */
189 
190 /* Realtime, XSI STREAMS option errors */
191 #define EBADMSG		88		/* Bad or Corrupt message */
192 
193 /* XSI STREAMS option errors  */
194 #define ENODATA		89		/* No message available */
195 #define ENOSR		90		/* No STREAM resources */
196 #define ENOSTR		91		/* Not a STREAM */
197 
198 #define	ELAST		91		/* Must equal largest errno */
199 
200 #ifdef _KERNEL
201 /* pseudo-errors returned inside kernel to modify return to process */
202 #define	EJUSTRETURN	-2		/* don't modify regs, just return */
203 #define	ERESTART	-3		/* restart syscall */
204 #define	EPASSTHROUGH	-4		/* ioctl not handled by this layer */
205 #endif
206 
207 #endif /* !_SYS_ERRNO_H_ */
208