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