xref: /illumos-gate/usr/src/uts/common/sys/errno.h (revision b4203d757c7c247e39c94c09a94021a3a8121062)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2000 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*	Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T	*/
28 /*	  All Rights Reserved	*/
29 
30 /*
31  * University Copyright- Copyright (c) 1982, 1986, 1988
32  * The Regents of the University of California
33  * All Rights Reserved
34  *
35  * University Acknowledgment- Portions of this document are derived from
36  * software developed by the University of California, Berkeley, and its
37  * contributors.
38  */
39 
40 #ifndef _SYS_ERRNO_H
41 #define	_SYS_ERRNO_H
42 
43 #ifdef	__cplusplus
44 extern "C" {
45 #endif
46 
47 /*
48  * Error codes
49  */
50 
51 #define	EPERM	1	/* Not super-user			*/
52 #define	ENOENT	2	/* No such file or directory		*/
53 #define	ESRCH	3	/* No such process			*/
54 #define	EINTR	4	/* interrupted system call		*/
55 #define	EIO	5	/* I/O error				*/
56 #define	ENXIO	6	/* No such device or address		*/
57 #define	E2BIG	7	/* Arg list too long			*/
58 #define	ENOEXEC	8	/* Exec format error			*/
59 #define	EBADF	9	/* Bad file number			*/
60 #define	ECHILD	10	/* No children				*/
61 #define	EAGAIN	11	/* Resource temporarily unavailable	*/
62 #define	ENOMEM	12	/* Not enough core			*/
63 #define	EACCES	13	/* Permission denied			*/
64 #define	EFAULT	14	/* Bad address				*/
65 #define	ENOTBLK	15	/* Block device required		*/
66 #define	EBUSY	16	/* Mount device busy			*/
67 #define	EEXIST	17	/* File exists				*/
68 #define	EXDEV	18	/* Cross-device link			*/
69 #define	ENODEV	19	/* No such device			*/
70 #define	ENOTDIR	20	/* Not a directory			*/
71 #define	EISDIR	21	/* Is a directory			*/
72 #define	EINVAL	22	/* Invalid argument			*/
73 #define	ENFILE	23	/* File table overflow			*/
74 #define	EMFILE	24	/* Too many open files			*/
75 #define	ENOTTY	25	/* Inappropriate ioctl for device	*/
76 #define	ETXTBSY	26	/* Text file busy			*/
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 #define	EDOM	33	/* Math arg out of domain of func	*/
84 #define	ERANGE	34	/* Math result not representable	*/
85 #define	ENOMSG	35	/* No message of desired type		*/
86 #define	EIDRM	36	/* Identifier removed			*/
87 #define	ECHRNG	37	/* Channel number out of range		*/
88 #define	EL2NSYNC 38	/* Level 2 not synchronized		*/
89 #define	EL3HLT	39	/* Level 3 halted			*/
90 #define	EL3RST	40	/* Level 3 reset			*/
91 #define	ELNRNG	41	/* Link number out of range		*/
92 #define	EUNATCH 42	/* Protocol driver not attached		*/
93 #define	ENOCSI	43	/* No CSI structure available		*/
94 #define	EL2HLT	44	/* Level 2 halted			*/
95 #define	EDEADLK	45	/* Deadlock condition.			*/
96 #define	ENOLCK	46	/* No record locks available.		*/
97 #define	ECANCELED 47	/* Operation canceled			*/
98 #define	ENOTSUP	48	/* Operation not supported		*/
99 
100 /* Filesystem Quotas */
101 #define	EDQUOT	49	/* Disc quota exceeded			*/
102 
103 /* Convergent Error Returns */
104 #define	EBADE	50	/* invalid exchange			*/
105 #define	EBADR	51	/* invalid request descriptor		*/
106 #define	EXFULL	52	/* exchange full			*/
107 #define	ENOANO	53	/* no anode				*/
108 #define	EBADRQC	54	/* invalid request code			*/
109 #define	EBADSLT	55	/* invalid slot				*/
110 #define	EDEADLOCK 56	/* file locking deadlock error		*/
111 
112 #define	EBFONT	57	/* bad font file fmt			*/
113 
114 /* Interprocess Robust Locks */
115 #define	EOWNERDEAD	58	/* process died with the lock */
116 #define	ENOTRECOVERABLE	59	/* lock is not recoverable */
117 
118 /* stream problems */
119 #define	ENOSTR	60	/* Device not a stream			*/
120 #define	ENODATA	61	/* no data (for no delay io)		*/
121 #define	ETIME	62	/* timer expired			*/
122 #define	ENOSR	63	/* out of streams resources		*/
123 
124 #define	ENONET	64	/* Machine is not on the network	*/
125 #define	ENOPKG	65	/* Package not installed		*/
126 #define	EREMOTE	66	/* The object is remote			*/
127 #define	ENOLINK	67	/* the link has been severed		*/
128 #define	EADV	68	/* advertise error			*/
129 #define	ESRMNT	69	/* srmount error			*/
130 
131 #define	ECOMM	70	/* Communication error on send		*/
132 #define	EPROTO	71	/* Protocol error			*/
133 
134 /* Interprocess Robust Locks */
135 #define	ELOCKUNMAPPED	72	/* locked lock was unmapped */
136 
137 #define	ENOTACTIVE 73	/* Facility is not active		*/
138 #define	EMULTIHOP 74	/* multihop attempted			*/
139 #define	EBADMSG 77	/* trying to read unreadable message	*/
140 #define	ENAMETOOLONG 78	/* path name is too long		*/
141 #define	EOVERFLOW 79	/* value too large to be stored in data type */
142 #define	ENOTUNIQ 80	/* given log. name not unique		*/
143 #define	EBADFD	81	/* f.d. invalid for this operation	*/
144 #define	EREMCHG	82	/* Remote address changed		*/
145 
146 /* shared library problems */
147 #define	ELIBACC	83	/* Can't access a needed shared lib.	*/
148 #define	ELIBBAD	84	/* Accessing a corrupted shared lib.	*/
149 #define	ELIBSCN	85	/* .lib section in a.out corrupted.	*/
150 #define	ELIBMAX	86	/* Attempting to link in too many libs.	*/
151 #define	ELIBEXEC 87	/* Attempting to exec a shared library.	*/
152 #define	EILSEQ	88	/* Illegal byte sequence.		*/
153 #define	ENOSYS	89	/* Unsupported file system operation	*/
154 #define	ELOOP	90	/* Symbolic link loop			*/
155 #define	ERESTART 91	/* Restartable system call		*/
156 #define	ESTRPIPE 92	/* if pipe/FIFO, don't sleep in stream head */
157 #define	ENOTEMPTY 93	/* directory not empty			*/
158 #define	EUSERS	94	/* Too many users (for UFS)		*/
159 
160 /* BSD Networking Software */
161 	/* argument errors */
162 #define	ENOTSOCK	95	/* Socket operation on non-socket */
163 #define	EDESTADDRREQ	96	/* Destination address required */
164 #define	EMSGSIZE	97	/* Message too long */
165 #define	EPROTOTYPE	98	/* Protocol wrong type for socket */
166 #define	ENOPROTOOPT	99	/* Protocol not available */
167 #define	EPROTONOSUPPORT	120	/* Protocol not supported */
168 #define	ESOCKTNOSUPPORT	121	/* Socket type not supported */
169 #define	EOPNOTSUPP	122	/* Operation not supported on socket */
170 #define	EPFNOSUPPORT	123	/* Protocol family not supported */
171 #define	EAFNOSUPPORT	124	/* Address family not supported by */
172 				/* protocol family */
173 #define	EADDRINUSE	125	/* Address already in use */
174 #define	EADDRNOTAVAIL	126	/* Can't assign requested address */
175 	/* operational errors */
176 #define	ENETDOWN	127	/* Network is down */
177 #define	ENETUNREACH	128	/* Network is unreachable */
178 #define	ENETRESET	129	/* Network dropped connection because */
179 				/* of reset */
180 #define	ECONNABORTED	130	/* Software caused connection abort */
181 #define	ECONNRESET	131	/* Connection reset by peer */
182 #define	ENOBUFS		132	/* No buffer space available */
183 #define	EISCONN		133	/* Socket is already connected */
184 #define	ENOTCONN	134	/* Socket is not connected */
185 /* XENIX has 135 - 142 */
186 #define	ESHUTDOWN	143	/* Can't send after socket shutdown */
187 #define	ETOOMANYREFS	144	/* Too many references: can't splice */
188 #define	ETIMEDOUT	145	/* Connection timed out */
189 #define	ECONNREFUSED	146	/* Connection refused */
190 #define	EHOSTDOWN	147	/* Host is down */
191 #define	EHOSTUNREACH	148	/* No route to host */
192 #define	EWOULDBLOCK	EAGAIN
193 #define	EALREADY	149	/* operation already in progress */
194 #define	EINPROGRESS	150	/* operation now in progress */
195 
196 /* SUN Network File System */
197 #define	ESTALE		151	/* Stale NFS file handle */
198 
199 
200 #ifdef	__cplusplus
201 }
202 #endif
203 
204 #endif	/* _SYS_ERRNO_H */
205