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