1 /* $OpenBSD: errno.h,v 1.25 2017年09月05日 03:06:26 jsg Exp $ */ 2 /* $NetBSD: errno.h,v 1.10 1996年01月20日 01:33:53 jtc Exp $ */ 3 4 /* 5 * Copyright (c) 1982, 1986, 1989, 1993 6 * The Regents of the University of California. All rights reserved. 7 * (c) UNIX System Laboratories, Inc. 8 * All or some portions of this file are derived from material licensed 9 * to the University of California by American Telephone and Telegraph 10 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 11 * the permission of UNIX System Laboratories, Inc. 12 * 13 * Redistribution and use in source and binary forms, with or without 14 * modification, are permitted provided that the following conditions 15 * are met: 16 * 1. Redistributions of source code must retain the above copyright 17 * notice, this list of conditions and the following disclaimer. 18 * 2. Redistributions in binary form must reproduce the above copyright 19 * notice, this list of conditions and the following disclaimer in the 20 * documentation and/or other materials provided with the distribution. 21 * 3. Neither the name of the University nor the names of its contributors 22 * may be used to endorse or promote products derived from this software 23 * without specific prior written permission. 24 * 25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 * 37 * @(#)errno.h 8.5 (Berkeley) 1/21/94 38 */ 39 40#include <sys/cdefs.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#if __BSD_VISIBLE 58#define ENOTBLK 15 /* Block device required */ 59#endif 60#define EBUSY 16 /* Device busy */ 61#define EEXIST 17 /* File exists */ 62#define EXDEV 18 /* Cross-device link */ 63#define ENODEV 19 /* Operation not supported by device */ 64#define ENOTDIR 20 /* Not a directory */ 65#define EISDIR 21 /* Is a directory */ 66#define EINVAL 22 /* Invalid argument */ 67#define ENFILE 23 /* Too many open files in system */ 68#define EMFILE 24 /* Too many open files */ 69#define ENOTTY 25 /* Inappropriate ioctl for device */ 70#define ETXTBSY 26 /* Text file busy */ 71#define EFBIG 27 /* File too large */ 72#define ENOSPC 28 /* No space left on device */ 73#define ESPIPE 29 /* Illegal seek */ 74#define EROFS 30 /* Read-only file system */ 75#define EMLINK 31 /* Too many links */ 76#define EPIPE 32 /* Broken pipe */ 77 78 /* math software */ 79#define EDOM 33 /* Numerical argument out of domain */ 80#define ERANGE 34 /* Result too large */ 81 82 /* non-blocking and interrupt i/o */ 83#define EAGAIN 35 /* Resource temporarily unavailable */ 84#define EWOULDBLOCK EAGAIN /* Operation would block */ 85#define EINPROGRESS 36 /* Operation now in progress */ 86#define EALREADY 37 /* Operation already in progress */ 87 88 /* ipc/network software -- argument errors */ 89#define ENOTSOCK 38 /* Socket operation on non-socket */ 90#define EDESTADDRREQ 39 /* Destination address required */ 91#define EMSGSIZE 40 /* Message too long */ 92#define EPROTOTYPE 41 /* Protocol wrong type for socket */ 93#define ENOPROTOOPT 42 /* Protocol not available */ 94#define EPROTONOSUPPORT 43 /* Protocol not supported */ 95#if __BSD_VISIBLE 96#define ESOCKTNOSUPPORT 44 /* Socket type not supported */ 97#endif 98#define EOPNOTSUPP 45 /* Operation not supported */ 99#if __BSD_VISIBLE 100#define EPFNOSUPPORT 46 /* Protocol family not supported */ 101#endif 102#define EAFNOSUPPORT 47 /* Address family not supported by protocol family */ 103#define EADDRINUSE 48 /* Address already in use */ 104#define EADDRNOTAVAIL 49 /* Can't assign requested address */ 105 106 /* ipc/network software -- operational errors */ 107#define ENETDOWN 50 /* Network is down */ 108#define ENETUNREACH 51 /* Network is unreachable */ 109#define ENETRESET 52 /* Network dropped connection on reset */ 110#define ECONNABORTED 53 /* Software caused connection abort */ 111#define ECONNRESET 54 /* Connection reset by peer */ 112#define ENOBUFS 55 /* No buffer space available */ 113#define EISCONN 56 /* Socket is already connected */ 114#define ENOTCONN 57 /* Socket is not connected */ 115#if __BSD_VISIBLE 116#define ESHUTDOWN 58 /* Can't send after socket shutdown */ 117#define ETOOMANYREFS 59 /* Too many references: can't splice */ 118#endif /* __BSD_VISIBLE */ 119#define ETIMEDOUT 60 /* Operation timed out */ 120#define ECONNREFUSED 61 /* Connection refused */ 121 122#define ELOOP 62 /* Too many levels of symbolic links */ 123#define ENAMETOOLONG 63 /* File name too long */ 124 125 /* should be rearranged */ 126#if __BSD_VISIBLE 127#define EHOSTDOWN 64 /* Host is down */ 128#endif /* __BSD_VISIBLE */ 129#define EHOSTUNREACH 65 /* No route to host */ 130#define ENOTEMPTY 66 /* Directory not empty */ 131 132 /* quotas & mush */ 133#if __BSD_VISIBLE 134#define EPROCLIM 67 /* Too many processes */ 135#define EUSERS 68 /* Too many users */ 136#endif /* __BSD_VISIBLE */ 137#define EDQUOT 69 /* Disk quota exceeded */ 138 139 /* Network File System */ 140#define ESTALE 70 /* Stale NFS file handle */ 141#if __BSD_VISIBLE 142#define EREMOTE 71 /* Too many levels of remote in path */ 143#define EBADRPC 72 /* RPC struct is bad */ 144#define ERPCMISMATCH 73 /* RPC version wrong */ 145#define EPROGUNAVAIL 74 /* RPC program not available */ 146#define EPROGMISMATCH 75 /* Program version wrong */ 147#define EPROCUNAVAIL 76 /* Bad procedure for program */ 148#endif /* __BSD_VISIBLE */ 149 150#define ENOLCK 77 /* No locks available */ 151#define ENOSYS 78 /* Function not implemented */ 152 153#if __BSD_VISIBLE 154#define EFTYPE 79 /* Inappropriate file type or format */ 155#define EAUTH 80 /* Authentication error */ 156#define ENEEDAUTH 81 /* Need authenticator */ 157#define EIPSEC 82 /* IPsec processing failure */ 158#define ENOATTR 83 /* Attribute not found */ 159#endif /* __BSD_VISIBLE */ 160#define EILSEQ 84 /* Illegal byte sequence */ 161#if __BSD_VISIBLE 162#define ENOMEDIUM 85 /* No medium found */ 163#define EMEDIUMTYPE 86 /* Wrong medium type */ 164#endif /* __BSD_VISIBLE */ 165#define EOVERFLOW 87 /* Value too large to be stored in data type */ 166#define ECANCELED 88 /* Operation canceled */ 167#define EIDRM 89 /* Identifier removed */ 168#define ENOMSG 90 /* No message of desired type */ 169#define ENOTSUP 91 /* Not supported */ 170#define EBADMSG 92 /* Bad message */ 171#define ENOTRECOVERABLE 93 /* State not recoverable */ 172#define EOWNERDEAD 94 /* Previous owner died */ 173#define EPROTO 95 /* Protocol error */ 174#if __BSD_VISIBLE 175#define ELAST 95 /* Must be equal largest errno */ 176#endif /* __BSD_VISIBLE */ 177 178#ifdef _KERNEL 179 /* pseudo-errors returned inside kernel to modify return to process */ 180#define ERESTART -1 /* restart syscall */ 181#define EJUSTRETURN -2 /* don't modify regs, just return */ 182#endif 183