xref: /illumos-gate/usr/src/boot/sys/sys/errno.h (revision 68d77045)
1199767f8SToomas Soome /*-
2199767f8SToomas Soome  * Copyright (c) 1982, 1986, 1989, 1993
3199767f8SToomas Soome  *	The Regents of the University of California.  All rights reserved.
4199767f8SToomas Soome  * (c) UNIX System Laboratories, Inc.
5199767f8SToomas Soome  * All or some portions of this file are derived from material licensed
6199767f8SToomas Soome  * to the University of California by American Telephone and Telegraph
7199767f8SToomas Soome  * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8199767f8SToomas Soome  * the permission of UNIX System Laboratories, Inc.
9199767f8SToomas Soome  *
10199767f8SToomas Soome  * Redistribution and use in source and binary forms, with or without
11199767f8SToomas Soome  * modification, are permitted provided that the following conditions
12199767f8SToomas Soome  * are met:
13199767f8SToomas Soome  * 1. Redistributions of source code must retain the above copyright
14199767f8SToomas Soome  *    notice, this list of conditions and the following disclaimer.
15199767f8SToomas Soome  * 2. Redistributions in binary form must reproduce the above copyright
16199767f8SToomas Soome  *    notice, this list of conditions and the following disclaimer in the
17199767f8SToomas Soome  *    documentation and/or other materials provided with the distribution.
18199767f8SToomas Soome  * 4. Neither the name of the University nor the names of its contributors
19199767f8SToomas Soome  *    may be used to endorse or promote products derived from this software
20199767f8SToomas Soome  *    without specific prior written permission.
21199767f8SToomas Soome  *
22199767f8SToomas Soome  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23199767f8SToomas Soome  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24199767f8SToomas Soome  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25199767f8SToomas Soome  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26199767f8SToomas Soome  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27199767f8SToomas Soome  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28199767f8SToomas Soome  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29199767f8SToomas Soome  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30199767f8SToomas Soome  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31199767f8SToomas Soome  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32199767f8SToomas Soome  * SUCH DAMAGE.
33199767f8SToomas Soome  *
34199767f8SToomas Soome  *	@(#)errno.h	8.5 (Berkeley) 1/21/94
35199767f8SToomas Soome  * $FreeBSD$
36199767f8SToomas Soome  */
37199767f8SToomas Soome 
38199767f8SToomas Soome #ifndef _SYS_ERRNO_H_
39199767f8SToomas Soome #define _SYS_ERRNO_H_
40199767f8SToomas Soome 
41*68d77045SToomas Soome #if !defined(_KERNEL) && !defined(_STANDALONE)
42199767f8SToomas Soome #include <sys/cdefs.h>
43199767f8SToomas Soome __BEGIN_DECLS
44199767f8SToomas Soome int *	__error(void);
45199767f8SToomas Soome __END_DECLS
46199767f8SToomas Soome #define	errno		(* __error())
47199767f8SToomas Soome #endif
48199767f8SToomas Soome 
49199767f8SToomas Soome #define	EPERM		1		/* Operation not permitted */
50199767f8SToomas Soome #define	ENOENT		2		/* No such file or directory */
51199767f8SToomas Soome #define	ESRCH		3		/* No such process */
52199767f8SToomas Soome #define	EINTR		4		/* Interrupted system call */
53199767f8SToomas Soome #define	EIO		5		/* Input/output error */
54199767f8SToomas Soome #define	ENXIO		6		/* Device not configured */
55199767f8SToomas Soome #define	E2BIG		7		/* Argument list too long */
56199767f8SToomas Soome #define	ENOEXEC		8		/* Exec format error */
57199767f8SToomas Soome #define	EBADF		9		/* Bad file descriptor */
58199767f8SToomas Soome #define	ECHILD		10		/* No child processes */
59199767f8SToomas Soome #define	EDEADLK		11		/* Resource deadlock avoided */
60199767f8SToomas Soome 					/* 11 was EAGAIN */
61199767f8SToomas Soome #define	ENOMEM		12		/* Cannot allocate memory */
62199767f8SToomas Soome #define	EACCES		13		/* Permission denied */
63199767f8SToomas Soome #define	EFAULT		14		/* Bad address */
64199767f8SToomas Soome #ifndef _POSIX_SOURCE
65199767f8SToomas Soome #define	ENOTBLK		15		/* Block device required */
66199767f8SToomas Soome #endif
67199767f8SToomas Soome #define	EBUSY		16		/* Device busy */
68199767f8SToomas Soome #define	EEXIST		17		/* File exists */
69199767f8SToomas Soome #define	EXDEV		18		/* Cross-device link */
70199767f8SToomas Soome #define	ENODEV		19		/* Operation not supported by device */
71199767f8SToomas Soome #define	ENOTDIR		20		/* Not a directory */
72199767f8SToomas Soome #define	EISDIR		21		/* Is a directory */
73199767f8SToomas Soome #define	EINVAL		22		/* Invalid argument */
74199767f8SToomas Soome #define	ENFILE		23		/* Too many open files in system */
75199767f8SToomas Soome #define	EMFILE		24		/* Too many open files */
76199767f8SToomas Soome #define	ENOTTY		25		/* Inappropriate ioctl for device */
77199767f8SToomas Soome #ifndef _POSIX_SOURCE
78199767f8SToomas Soome #define	ETXTBSY		26		/* Text file busy */
79199767f8SToomas Soome #endif
80199767f8SToomas Soome #define	EFBIG		27		/* File too large */
81199767f8SToomas Soome #define	ENOSPC		28		/* No space left on device */
82199767f8SToomas Soome #define	ESPIPE		29		/* Illegal seek */
83199767f8SToomas Soome #define	EROFS		30		/* Read-only filesystem */
84199767f8SToomas Soome #define	EMLINK		31		/* Too many links */
85199767f8SToomas Soome #define	EPIPE		32		/* Broken pipe */
86199767f8SToomas Soome 
87199767f8SToomas Soome /* math software */
88199767f8SToomas Soome #define	EDOM		33		/* Numerical argument out of domain */
89199767f8SToomas Soome #define	ERANGE		34		/* Result too large */
90199767f8SToomas Soome 
91199767f8SToomas Soome /* non-blocking and interrupt i/o */
92199767f8SToomas Soome #define	EAGAIN		35		/* Resource temporarily unavailable */
93199767f8SToomas Soome #ifndef _POSIX_SOURCE
94199767f8SToomas Soome #define	EWOULDBLOCK	EAGAIN		/* Operation would block */
95199767f8SToomas Soome #define	EINPROGRESS	36		/* Operation now in progress */
96199767f8SToomas Soome #define	EALREADY	37		/* Operation already in progress */
97199767f8SToomas Soome 
98199767f8SToomas Soome /* ipc/network software -- argument errors */
99199767f8SToomas Soome #define	ENOTSOCK	38		/* Socket operation on non-socket */
100199767f8SToomas Soome #define	EDESTADDRREQ	39		/* Destination address required */
101199767f8SToomas Soome #define	EMSGSIZE	40		/* Message too long */
102199767f8SToomas Soome #define	EPROTOTYPE	41		/* Protocol wrong type for socket */
103199767f8SToomas Soome #define	ENOPROTOOPT	42		/* Protocol not available */
104199767f8SToomas Soome #define	EPROTONOSUPPORT	43		/* Protocol not supported */
105199767f8SToomas Soome #define	ESOCKTNOSUPPORT	44		/* Socket type not supported */
106199767f8SToomas Soome #define	EOPNOTSUPP	45		/* Operation not supported */
107199767f8SToomas Soome #define	ENOTSUP		EOPNOTSUPP	/* Operation not supported */
108199767f8SToomas Soome #define	EPFNOSUPPORT	46		/* Protocol family not supported */
109199767f8SToomas Soome #define	EAFNOSUPPORT	47		/* Address family not supported by protocol family */
110199767f8SToomas Soome #define	EADDRINUSE	48		/* Address already in use */
111199767f8SToomas Soome #define	EADDRNOTAVAIL	49		/* Can't assign requested address */
112199767f8SToomas Soome 
113199767f8SToomas Soome /* ipc/network software -- operational errors */
114199767f8SToomas Soome #define	ENETDOWN	50		/* Network is down */
115199767f8SToomas Soome #define	ENETUNREACH	51		/* Network is unreachable */
116199767f8SToomas Soome #define	ENETRESET	52		/* Network dropped connection on reset */
117199767f8SToomas Soome #define	ECONNABORTED	53		/* Software caused connection abort */
118199767f8SToomas Soome #define	ECONNRESET	54		/* Connection reset by peer */
119199767f8SToomas Soome #define	ENOBUFS		55		/* No buffer space available */
120199767f8SToomas Soome #define	EISCONN		56		/* Socket is already connected */
121199767f8SToomas Soome #define	ENOTCONN	57		/* Socket is not connected */
122199767f8SToomas Soome #define	ESHUTDOWN	58		/* Can't send after socket shutdown */
123199767f8SToomas Soome #define	ETOOMANYREFS	59		/* Too many references: can't splice */
124199767f8SToomas Soome #define	ETIMEDOUT	60		/* Operation timed out */
125199767f8SToomas Soome #define	ECONNREFUSED	61		/* Connection refused */
126199767f8SToomas Soome 
127199767f8SToomas Soome #define	ELOOP		62		/* Too many levels of symbolic links */
128199767f8SToomas Soome #endif /* _POSIX_SOURCE */
129199767f8SToomas Soome #define	ENAMETOOLONG	63		/* File name too long */
130199767f8SToomas Soome 
131199767f8SToomas Soome /* should be rearranged */
132199767f8SToomas Soome #ifndef _POSIX_SOURCE
133199767f8SToomas Soome #define	EHOSTDOWN	64		/* Host is down */
134199767f8SToomas Soome #define	EHOSTUNREACH	65		/* No route to host */
135199767f8SToomas Soome #endif /* _POSIX_SOURCE */
136199767f8SToomas Soome #define	ENOTEMPTY	66		/* Directory not empty */
137199767f8SToomas Soome 
138199767f8SToomas Soome /* quotas & mush */
139199767f8SToomas Soome #ifndef _POSIX_SOURCE
140199767f8SToomas Soome #define	EPROCLIM	67		/* Too many processes */
141199767f8SToomas Soome #define	EUSERS		68		/* Too many users */
142199767f8SToomas Soome #define	EDQUOT		69		/* Disc quota exceeded */
143199767f8SToomas Soome 
144199767f8SToomas Soome /* Network File System */
145199767f8SToomas Soome #define	ESTALE		70		/* Stale NFS file handle */
146199767f8SToomas Soome #define	EREMOTE		71		/* Too many levels of remote in path */
147199767f8SToomas Soome #define	EBADRPC		72		/* RPC struct is bad */
148199767f8SToomas Soome #define	ERPCMISMATCH	73		/* RPC version wrong */
149199767f8SToomas Soome #define	EPROGUNAVAIL	74		/* RPC prog. not avail */
150199767f8SToomas Soome #define	EPROGMISMATCH	75		/* Program version wrong */
151199767f8SToomas Soome #define	EPROCUNAVAIL	76		/* Bad procedure for program */
152199767f8SToomas Soome #endif /* _POSIX_SOURCE */
153199767f8SToomas Soome 
154199767f8SToomas Soome #define	ENOLCK		77		/* No locks available */
155199767f8SToomas Soome #define	ENOSYS		78		/* Function not implemented */
156199767f8SToomas Soome 
157199767f8SToomas Soome #ifndef _POSIX_SOURCE
158199767f8SToomas Soome #define	EFTYPE		79		/* Inappropriate file type or format */
159199767f8SToomas Soome #define	EAUTH		80		/* Authentication error */
160199767f8SToomas Soome #define	ENEEDAUTH	81		/* Need authenticator */
161199767f8SToomas Soome #define	EIDRM		82		/* Identifier removed */
162199767f8SToomas Soome #define	ENOMSG		83		/* No message of desired type */
163199767f8SToomas Soome #define	EOVERFLOW	84		/* Value too large to be stored in data type */
164199767f8SToomas Soome #define	ECANCELED	85		/* Operation canceled */
165199767f8SToomas Soome #define	EILSEQ		86		/* Illegal byte sequence */
166199767f8SToomas Soome #define	ENOATTR		87		/* Attribute not found */
167199767f8SToomas Soome 
168199767f8SToomas Soome #define	EDOOFUS		88		/* Programming error */
169199767f8SToomas Soome #endif /* _POSIX_SOURCE */
170199767f8SToomas Soome 
171199767f8SToomas Soome #define	EBADMSG		89		/* Bad message */
172199767f8SToomas Soome #define	EMULTIHOP	90		/* Multihop attempted */
173199767f8SToomas Soome #define	ENOLINK		91		/* Link has been severed */
174199767f8SToomas Soome #define	EPROTO		92		/* Protocol error */
175199767f8SToomas Soome 
176199767f8SToomas Soome #ifndef _POSIX_SOURCE
177199767f8SToomas Soome #define	ENOTCAPABLE	93		/* Capabilities insufficient */
178199767f8SToomas Soome #define	ECAPMODE	94		/* Not permitted in capability mode */
179199767f8SToomas Soome #define	ENOTRECOVERABLE	95		/* State not recoverable */
180199767f8SToomas Soome #define	EOWNERDEAD	96		/* Previous owner died */
181199767f8SToomas Soome #endif /* _POSIX_SOURCE */
182199767f8SToomas Soome 
183199767f8SToomas Soome #ifndef _POSIX_SOURCE
184199767f8SToomas Soome #define	ELAST		96		/* Must be equal largest errno */
185199767f8SToomas Soome #endif /* _POSIX_SOURCE */
186199767f8SToomas Soome 
187199767f8SToomas Soome #ifdef _KERNEL
188199767f8SToomas Soome /* pseudo-errors returned inside kernel to modify return to process */
189199767f8SToomas Soome #define	ERESTART	(-1)		/* restart syscall */
190199767f8SToomas Soome #define	EJUSTRETURN	(-2)		/* don't modify regs, just return */
191199767f8SToomas Soome #define	ENOIOCTL	(-3)		/* ioctl not handled by this layer */
192199767f8SToomas Soome #define	EDIRIOCTL	(-4)		/* do direct ioctl in GEOM */
193199767f8SToomas Soome #endif
194199767f8SToomas Soome 
195199767f8SToomas Soome #endif
196