xref: /illumos-gate/usr/src/uts/common/sys/errno.h (revision b4203d75)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
57c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
67c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
77c478bd9Sstevel@tonic-gate  * with the License.
87c478bd9Sstevel@tonic-gate  *
97c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
117c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
127c478bd9Sstevel@tonic-gate  * and limitations under the License.
137c478bd9Sstevel@tonic-gate  *
147c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
157c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
177c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
187c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
197c478bd9Sstevel@tonic-gate  *
207c478bd9Sstevel@tonic-gate  * CDDL HEADER END
217c478bd9Sstevel@tonic-gate  */
227c478bd9Sstevel@tonic-gate /*
237c478bd9Sstevel@tonic-gate  * Copyright 2000 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
257c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate /*	Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T	*/
28*b4203d75SMarcel Telka /*	  All Rights Reserved	*/
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate /*
317c478bd9Sstevel@tonic-gate  * University Copyright- Copyright (c) 1982, 1986, 1988
327c478bd9Sstevel@tonic-gate  * The Regents of the University of California
337c478bd9Sstevel@tonic-gate  * All Rights Reserved
347c478bd9Sstevel@tonic-gate  *
357c478bd9Sstevel@tonic-gate  * University Acknowledgment- Portions of this document are derived from
367c478bd9Sstevel@tonic-gate  * software developed by the University of California, Berkeley, and its
377c478bd9Sstevel@tonic-gate  * contributors.
387c478bd9Sstevel@tonic-gate  */
397c478bd9Sstevel@tonic-gate 
407c478bd9Sstevel@tonic-gate #ifndef _SYS_ERRNO_H
417c478bd9Sstevel@tonic-gate #define	_SYS_ERRNO_H
427c478bd9Sstevel@tonic-gate 
437c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
447c478bd9Sstevel@tonic-gate extern "C" {
457c478bd9Sstevel@tonic-gate #endif
467c478bd9Sstevel@tonic-gate 
477c478bd9Sstevel@tonic-gate /*
487c478bd9Sstevel@tonic-gate  * Error codes
497c478bd9Sstevel@tonic-gate  */
507c478bd9Sstevel@tonic-gate 
517c478bd9Sstevel@tonic-gate #define	EPERM	1	/* Not super-user			*/
527c478bd9Sstevel@tonic-gate #define	ENOENT	2	/* No such file or directory		*/
537c478bd9Sstevel@tonic-gate #define	ESRCH	3	/* No such process			*/
547c478bd9Sstevel@tonic-gate #define	EINTR	4	/* interrupted system call		*/
557c478bd9Sstevel@tonic-gate #define	EIO	5	/* I/O error				*/
567c478bd9Sstevel@tonic-gate #define	ENXIO	6	/* No such device or address		*/
577c478bd9Sstevel@tonic-gate #define	E2BIG	7	/* Arg list too long			*/
587c478bd9Sstevel@tonic-gate #define	ENOEXEC	8	/* Exec format error			*/
597c478bd9Sstevel@tonic-gate #define	EBADF	9	/* Bad file number			*/
607c478bd9Sstevel@tonic-gate #define	ECHILD	10	/* No children				*/
617c478bd9Sstevel@tonic-gate #define	EAGAIN	11	/* Resource temporarily unavailable	*/
627c478bd9Sstevel@tonic-gate #define	ENOMEM	12	/* Not enough core			*/
637c478bd9Sstevel@tonic-gate #define	EACCES	13	/* Permission denied			*/
647c478bd9Sstevel@tonic-gate #define	EFAULT	14	/* Bad address				*/
657c478bd9Sstevel@tonic-gate #define	ENOTBLK	15	/* Block device required		*/
667c478bd9Sstevel@tonic-gate #define	EBUSY	16	/* Mount device busy			*/
677c478bd9Sstevel@tonic-gate #define	EEXIST	17	/* File exists				*/
687c478bd9Sstevel@tonic-gate #define	EXDEV	18	/* Cross-device link			*/
697c478bd9Sstevel@tonic-gate #define	ENODEV	19	/* No such device			*/
707c478bd9Sstevel@tonic-gate #define	ENOTDIR	20	/* Not a directory			*/
717c478bd9Sstevel@tonic-gate #define	EISDIR	21	/* Is a directory			*/
727c478bd9Sstevel@tonic-gate #define	EINVAL	22	/* Invalid argument			*/
737c478bd9Sstevel@tonic-gate #define	ENFILE	23	/* File table overflow			*/
747c478bd9Sstevel@tonic-gate #define	EMFILE	24	/* Too many open files			*/
757c478bd9Sstevel@tonic-gate #define	ENOTTY	25	/* Inappropriate ioctl for device	*/
767c478bd9Sstevel@tonic-gate #define	ETXTBSY	26	/* Text file busy			*/
777c478bd9Sstevel@tonic-gate #define	EFBIG	27	/* File too large			*/
787c478bd9Sstevel@tonic-gate #define	ENOSPC	28	/* No space left on device		*/
797c478bd9Sstevel@tonic-gate #define	ESPIPE	29	/* Illegal seek				*/
807c478bd9Sstevel@tonic-gate #define	EROFS	30	/* Read only file system		*/
817c478bd9Sstevel@tonic-gate #define	EMLINK	31	/* Too many links			*/
827c478bd9Sstevel@tonic-gate #define	EPIPE	32	/* Broken pipe				*/
837c478bd9Sstevel@tonic-gate #define	EDOM	33	/* Math arg out of domain of func	*/
847c478bd9Sstevel@tonic-gate #define	ERANGE	34	/* Math result not representable	*/
857c478bd9Sstevel@tonic-gate #define	ENOMSG	35	/* No message of desired type		*/
867c478bd9Sstevel@tonic-gate #define	EIDRM	36	/* Identifier removed			*/
877c478bd9Sstevel@tonic-gate #define	ECHRNG	37	/* Channel number out of range		*/
887c478bd9Sstevel@tonic-gate #define	EL2NSYNC 38	/* Level 2 not synchronized		*/
897c478bd9Sstevel@tonic-gate #define	EL3HLT	39	/* Level 3 halted			*/
907c478bd9Sstevel@tonic-gate #define	EL3RST	40	/* Level 3 reset			*/
917c478bd9Sstevel@tonic-gate #define	ELNRNG	41	/* Link number out of range		*/
927c478bd9Sstevel@tonic-gate #define	EUNATCH 42	/* Protocol driver not attached		*/
937c478bd9Sstevel@tonic-gate #define	ENOCSI	43	/* No CSI structure available		*/
947c478bd9Sstevel@tonic-gate #define	EL2HLT	44	/* Level 2 halted			*/
957c478bd9Sstevel@tonic-gate #define	EDEADLK	45	/* Deadlock condition.			*/
967c478bd9Sstevel@tonic-gate #define	ENOLCK	46	/* No record locks available.		*/
977c478bd9Sstevel@tonic-gate #define	ECANCELED 47	/* Operation canceled			*/
987c478bd9Sstevel@tonic-gate #define	ENOTSUP	48	/* Operation not supported		*/
997c478bd9Sstevel@tonic-gate 
1007c478bd9Sstevel@tonic-gate /* Filesystem Quotas */
1017c478bd9Sstevel@tonic-gate #define	EDQUOT	49	/* Disc quota exceeded			*/
1027c478bd9Sstevel@tonic-gate 
1037c478bd9Sstevel@tonic-gate /* Convergent Error Returns */
1047c478bd9Sstevel@tonic-gate #define	EBADE	50	/* invalid exchange			*/
1057c478bd9Sstevel@tonic-gate #define	EBADR	51	/* invalid request descriptor		*/
1067c478bd9Sstevel@tonic-gate #define	EXFULL	52	/* exchange full			*/
1077c478bd9Sstevel@tonic-gate #define	ENOANO	53	/* no anode				*/
1087c478bd9Sstevel@tonic-gate #define	EBADRQC	54	/* invalid request code			*/
1097c478bd9Sstevel@tonic-gate #define	EBADSLT	55	/* invalid slot				*/
1107c478bd9Sstevel@tonic-gate #define	EDEADLOCK 56	/* file locking deadlock error		*/
1117c478bd9Sstevel@tonic-gate 
1127c478bd9Sstevel@tonic-gate #define	EBFONT	57	/* bad font file fmt			*/
1137c478bd9Sstevel@tonic-gate 
1147c478bd9Sstevel@tonic-gate /* Interprocess Robust Locks */
1157c478bd9Sstevel@tonic-gate #define	EOWNERDEAD	58	/* process died with the lock */
1167c478bd9Sstevel@tonic-gate #define	ENOTRECOVERABLE	59	/* lock is not recoverable */
1177c478bd9Sstevel@tonic-gate 
1187c478bd9Sstevel@tonic-gate /* stream problems */
1197c478bd9Sstevel@tonic-gate #define	ENOSTR	60	/* Device not a stream			*/
1207c478bd9Sstevel@tonic-gate #define	ENODATA	61	/* no data (for no delay io)		*/
1217c478bd9Sstevel@tonic-gate #define	ETIME	62	/* timer expired			*/
1227c478bd9Sstevel@tonic-gate #define	ENOSR	63	/* out of streams resources		*/
1237c478bd9Sstevel@tonic-gate 
1247c478bd9Sstevel@tonic-gate #define	ENONET	64	/* Machine is not on the network	*/
1257c478bd9Sstevel@tonic-gate #define	ENOPKG	65	/* Package not installed		*/
1267c478bd9Sstevel@tonic-gate #define	EREMOTE	66	/* The object is remote			*/
1277c478bd9Sstevel@tonic-gate #define	ENOLINK	67	/* the link has been severed		*/
1287c478bd9Sstevel@tonic-gate #define	EADV	68	/* advertise error			*/
1297c478bd9Sstevel@tonic-gate #define	ESRMNT	69	/* srmount error			*/
1307c478bd9Sstevel@tonic-gate 
1317c478bd9Sstevel@tonic-gate #define	ECOMM	70	/* Communication error on send		*/
1327c478bd9Sstevel@tonic-gate #define	EPROTO	71	/* Protocol error			*/
1337c478bd9Sstevel@tonic-gate 
1347c478bd9Sstevel@tonic-gate /* Interprocess Robust Locks */
1357c478bd9Sstevel@tonic-gate #define	ELOCKUNMAPPED	72	/* locked lock was unmapped */
1367c478bd9Sstevel@tonic-gate 
1377c478bd9Sstevel@tonic-gate #define	ENOTACTIVE 73	/* Facility is not active		*/
1387c478bd9Sstevel@tonic-gate #define	EMULTIHOP 74	/* multihop attempted			*/
1397c478bd9Sstevel@tonic-gate #define	EBADMSG 77	/* trying to read unreadable message	*/
1407c478bd9Sstevel@tonic-gate #define	ENAMETOOLONG 78	/* path name is too long		*/
1417c478bd9Sstevel@tonic-gate #define	EOVERFLOW 79	/* value too large to be stored in data type */
1427c478bd9Sstevel@tonic-gate #define	ENOTUNIQ 80	/* given log. name not unique		*/
1437c478bd9Sstevel@tonic-gate #define	EBADFD	81	/* f.d. invalid for this operation	*/
1447c478bd9Sstevel@tonic-gate #define	EREMCHG	82	/* Remote address changed		*/
1457c478bd9Sstevel@tonic-gate 
1467c478bd9Sstevel@tonic-gate /* shared library problems */
1477c478bd9Sstevel@tonic-gate #define	ELIBACC	83	/* Can't access a needed shared lib.	*/
1487c478bd9Sstevel@tonic-gate #define	ELIBBAD	84	/* Accessing a corrupted shared lib.	*/
1497c478bd9Sstevel@tonic-gate #define	ELIBSCN	85	/* .lib section in a.out corrupted.	*/
1507c478bd9Sstevel@tonic-gate #define	ELIBMAX	86	/* Attempting to link in too many libs.	*/
1517c478bd9Sstevel@tonic-gate #define	ELIBEXEC 87	/* Attempting to exec a shared library.	*/
1527c478bd9Sstevel@tonic-gate #define	EILSEQ	88	/* Illegal byte sequence.		*/
1537c478bd9Sstevel@tonic-gate #define	ENOSYS	89	/* Unsupported file system operation	*/
1547c478bd9Sstevel@tonic-gate #define	ELOOP	90	/* Symbolic link loop			*/
1557c478bd9Sstevel@tonic-gate #define	ERESTART 91	/* Restartable system call		*/
1567c478bd9Sstevel@tonic-gate #define	ESTRPIPE 92	/* if pipe/FIFO, don't sleep in stream head */
1577c478bd9Sstevel@tonic-gate #define	ENOTEMPTY 93	/* directory not empty			*/
1587c478bd9Sstevel@tonic-gate #define	EUSERS	94	/* Too many users (for UFS)		*/
1597c478bd9Sstevel@tonic-gate 
1607c478bd9Sstevel@tonic-gate /* BSD Networking Software */
1617c478bd9Sstevel@tonic-gate 	/* argument errors */
1627c478bd9Sstevel@tonic-gate #define	ENOTSOCK	95	/* Socket operation on non-socket */
1637c478bd9Sstevel@tonic-gate #define	EDESTADDRREQ	96	/* Destination address required */
1647c478bd9Sstevel@tonic-gate #define	EMSGSIZE	97	/* Message too long */
1657c478bd9Sstevel@tonic-gate #define	EPROTOTYPE	98	/* Protocol wrong type for socket */
1667c478bd9Sstevel@tonic-gate #define	ENOPROTOOPT	99	/* Protocol not available */
1677c478bd9Sstevel@tonic-gate #define	EPROTONOSUPPORT	120	/* Protocol not supported */
1687c478bd9Sstevel@tonic-gate #define	ESOCKTNOSUPPORT	121	/* Socket type not supported */
1697c478bd9Sstevel@tonic-gate #define	EOPNOTSUPP	122	/* Operation not supported on socket */
1707c478bd9Sstevel@tonic-gate #define	EPFNOSUPPORT	123	/* Protocol family not supported */
1717c478bd9Sstevel@tonic-gate #define	EAFNOSUPPORT	124	/* Address family not supported by */
1727c478bd9Sstevel@tonic-gate 				/* protocol family */
1737c478bd9Sstevel@tonic-gate #define	EADDRINUSE	125	/* Address already in use */
1747c478bd9Sstevel@tonic-gate #define	EADDRNOTAVAIL	126	/* Can't assign requested address */
1757c478bd9Sstevel@tonic-gate 	/* operational errors */
1767c478bd9Sstevel@tonic-gate #define	ENETDOWN	127	/* Network is down */
1777c478bd9Sstevel@tonic-gate #define	ENETUNREACH	128	/* Network is unreachable */
1787c478bd9Sstevel@tonic-gate #define	ENETRESET	129	/* Network dropped connection because */
1797c478bd9Sstevel@tonic-gate 				/* of reset */
1807c478bd9Sstevel@tonic-gate #define	ECONNABORTED	130	/* Software caused connection abort */
1817c478bd9Sstevel@tonic-gate #define	ECONNRESET	131	/* Connection reset by peer */
1827c478bd9Sstevel@tonic-gate #define	ENOBUFS		132	/* No buffer space available */
1837c478bd9Sstevel@tonic-gate #define	EISCONN		133	/* Socket is already connected */
1847c478bd9Sstevel@tonic-gate #define	ENOTCONN	134	/* Socket is not connected */
1857c478bd9Sstevel@tonic-gate /* XENIX has 135 - 142 */
1867c478bd9Sstevel@tonic-gate #define	ESHUTDOWN	143	/* Can't send after socket shutdown */
1877c478bd9Sstevel@tonic-gate #define	ETOOMANYREFS	144	/* Too many references: can't splice */
1887c478bd9Sstevel@tonic-gate #define	ETIMEDOUT	145	/* Connection timed out */
1897c478bd9Sstevel@tonic-gate #define	ECONNREFUSED	146	/* Connection refused */
1907c478bd9Sstevel@tonic-gate #define	EHOSTDOWN	147	/* Host is down */
1917c478bd9Sstevel@tonic-gate #define	EHOSTUNREACH	148	/* No route to host */
1927c478bd9Sstevel@tonic-gate #define	EWOULDBLOCK	EAGAIN
1937c478bd9Sstevel@tonic-gate #define	EALREADY	149	/* operation already in progress */
1947c478bd9Sstevel@tonic-gate #define	EINPROGRESS	150	/* operation now in progress */
1957c478bd9Sstevel@tonic-gate 
1967c478bd9Sstevel@tonic-gate /* SUN Network File System */
1977c478bd9Sstevel@tonic-gate #define	ESTALE		151	/* Stale NFS file handle */
1987c478bd9Sstevel@tonic-gate 
1997c478bd9Sstevel@tonic-gate 
2007c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
2017c478bd9Sstevel@tonic-gate }
2027c478bd9Sstevel@tonic-gate #endif
2037c478bd9Sstevel@tonic-gate 
2047c478bd9Sstevel@tonic-gate #endif	/* _SYS_ERRNO_H */
205