1139825Simp/*- 21541Srgrimes * Copyright (c) 1982, 1986, 1989, 1993 31541Srgrimes * The Regents of the University of California. All rights reserved. 41541Srgrimes * (c) UNIX System Laboratories, Inc. 51541Srgrimes * All or some portions of this file are derived from material licensed 61541Srgrimes * to the University of California by American Telephone and Telegraph 71541Srgrimes * Co. or Unix System Laboratories, Inc. and are reproduced herein with 81541Srgrimes * the permission of UNIX System Laboratories, Inc. 91541Srgrimes * 101541Srgrimes * Redistribution and use in source and binary forms, with or without 111541Srgrimes * modification, are permitted provided that the following conditions 121541Srgrimes * are met: 131541Srgrimes * 1. Redistributions of source code must retain the above copyright 141541Srgrimes * notice, this list of conditions and the following disclaimer. 151541Srgrimes * 2. Redistributions in binary form must reproduce the above copyright 161541Srgrimes * notice, this list of conditions and the following disclaimer in the 171541Srgrimes * documentation and/or other materials provided with the distribution. 181541Srgrimes * 4. Neither the name of the University nor the names of its contributors 191541Srgrimes * may be used to endorse or promote products derived from this software 201541Srgrimes * without specific prior written permission. 211541Srgrimes * 221541Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 231541Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 241541Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 251541Srgrimes * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 261541Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 271541Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 281541Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 291541Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 301541Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 311541Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 321541Srgrimes * SUCH DAMAGE. 331541Srgrimes * 341541Srgrimes * @(#)errno.h 8.5 (Berkeley) 1/21/94 3550477Speter * $FreeBSD$ 361541Srgrimes */ 371541Srgrimes 382165Spaul#ifndef _SYS_ERRNO_H_ 392165Spaul#define _SYS_ERRNO_H_ 402165Spaul 4155205Speter#ifndef _KERNEL 4217649Speter#include <sys/cdefs.h> 4317649Speter__BEGIN_DECLS 4492719Salfredint * __error(void); 4517649Speter__END_DECLS 4613545Sjulian#define errno (* __error()) 471541Srgrimes#endif 481541Srgrimes 491541Srgrimes#define EPERM 1 /* Operation not permitted */ 501541Srgrimes#define ENOENT 2 /* No such file or directory */ 511541Srgrimes#define ESRCH 3 /* No such process */ 521541Srgrimes#define EINTR 4 /* Interrupted system call */ 531541Srgrimes#define EIO 5 /* Input/output error */ 541541Srgrimes#define ENXIO 6 /* Device not configured */ 551541Srgrimes#define E2BIG 7 /* Argument list too long */ 561541Srgrimes#define ENOEXEC 8 /* Exec format error */ 571541Srgrimes#define EBADF 9 /* Bad file descriptor */ 581541Srgrimes#define ECHILD 10 /* No child processes */ 591541Srgrimes#define EDEADLK 11 /* Resource deadlock avoided */ 601541Srgrimes /* 11 was EAGAIN */ 611541Srgrimes#define ENOMEM 12 /* Cannot allocate memory */ 621541Srgrimes#define EACCES 13 /* Permission denied */ 631541Srgrimes#define EFAULT 14 /* Bad address */ 641541Srgrimes#ifndef _POSIX_SOURCE 651541Srgrimes#define ENOTBLK 15 /* Block device required */ 661541Srgrimes#endif 671541Srgrimes#define EBUSY 16 /* Device busy */ 681541Srgrimes#define EEXIST 17 /* File exists */ 691541Srgrimes#define EXDEV 18 /* Cross-device link */ 701541Srgrimes#define ENODEV 19 /* Operation not supported by device */ 711541Srgrimes#define ENOTDIR 20 /* Not a directory */ 721541Srgrimes#define EISDIR 21 /* Is a directory */ 731541Srgrimes#define EINVAL 22 /* Invalid argument */ 741541Srgrimes#define ENFILE 23 /* Too many open files in system */ 751541Srgrimes#define EMFILE 24 /* Too many open files */ 761541Srgrimes#define ENOTTY 25 /* Inappropriate ioctl for device */ 771541Srgrimes#ifndef _POSIX_SOURCE 781541Srgrimes#define ETXTBSY 26 /* Text file busy */ 791541Srgrimes#endif 801541Srgrimes#define EFBIG 27 /* File too large */ 811541Srgrimes#define ENOSPC 28 /* No space left on device */ 821541Srgrimes#define ESPIPE 29 /* Illegal seek */ 8396755Strhodes#define EROFS 30 /* Read-only filesystem */ 841541Srgrimes#define EMLINK 31 /* Too many links */ 851541Srgrimes#define EPIPE 32 /* Broken pipe */ 861541Srgrimes 871541Srgrimes/* math software */ 881541Srgrimes#define EDOM 33 /* Numerical argument out of domain */ 891541Srgrimes#define ERANGE 34 /* Result too large */ 901541Srgrimes 911541Srgrimes/* non-blocking and interrupt i/o */ 921541Srgrimes#define EAGAIN 35 /* Resource temporarily unavailable */ 931541Srgrimes#ifndef _POSIX_SOURCE 941541Srgrimes#define EWOULDBLOCK EAGAIN /* Operation would block */ 951541Srgrimes#define EINPROGRESS 36 /* Operation now in progress */ 961541Srgrimes#define EALREADY 37 /* Operation already in progress */ 971541Srgrimes 981541Srgrimes/* ipc/network software -- argument errors */ 991541Srgrimes#define ENOTSOCK 38 /* Socket operation on non-socket */ 1001541Srgrimes#define EDESTADDRREQ 39 /* Destination address required */ 1011541Srgrimes#define EMSGSIZE 40 /* Message too long */ 1021541Srgrimes#define EPROTOTYPE 41 /* Protocol wrong type for socket */ 1031541Srgrimes#define ENOPROTOOPT 42 /* Protocol not available */ 1041541Srgrimes#define EPROTONOSUPPORT 43 /* Protocol not supported */ 1051541Srgrimes#define ESOCKTNOSUPPORT 44 /* Socket type not supported */ 1061541Srgrimes#define EOPNOTSUPP 45 /* Operation not supported */ 10789642Skeramida#define ENOTSUP EOPNOTSUPP /* Operation not supported */ 1081541Srgrimes#define EPFNOSUPPORT 46 /* Protocol family not supported */ 1091541Srgrimes#define EAFNOSUPPORT 47 /* Address family not supported by protocol family */ 1101541Srgrimes#define EADDRINUSE 48 /* Address already in use */ 1111541Srgrimes#define EADDRNOTAVAIL 49 /* Can't assign requested address */ 1121541Srgrimes 1131541Srgrimes/* ipc/network software -- operational errors */ 1141541Srgrimes#define ENETDOWN 50 /* Network is down */ 1151541Srgrimes#define ENETUNREACH 51 /* Network is unreachable */ 1161541Srgrimes#define ENETRESET 52 /* Network dropped connection on reset */ 1171541Srgrimes#define ECONNABORTED 53 /* Software caused connection abort */ 1181541Srgrimes#define ECONNRESET 54 /* Connection reset by peer */ 1191541Srgrimes#define ENOBUFS 55 /* No buffer space available */ 1201541Srgrimes#define EISCONN 56 /* Socket is already connected */ 1211541Srgrimes#define ENOTCONN 57 /* Socket is not connected */ 1221541Srgrimes#define ESHUTDOWN 58 /* Can't send after socket shutdown */ 1231541Srgrimes#define ETOOMANYREFS 59 /* Too many references: can't splice */ 1241541Srgrimes#define ETIMEDOUT 60 /* Operation timed out */ 1251541Srgrimes#define ECONNREFUSED 61 /* Connection refused */ 1261541Srgrimes 1271541Srgrimes#define ELOOP 62 /* Too many levels of symbolic links */ 1281541Srgrimes#endif /* _POSIX_SOURCE */ 1291541Srgrimes#define ENAMETOOLONG 63 /* File name too long */ 1301541Srgrimes 1311541Srgrimes/* should be rearranged */ 1321541Srgrimes#ifndef _POSIX_SOURCE 1331541Srgrimes#define EHOSTDOWN 64 /* Host is down */ 1341541Srgrimes#define EHOSTUNREACH 65 /* No route to host */ 1351541Srgrimes#endif /* _POSIX_SOURCE */ 1361541Srgrimes#define ENOTEMPTY 66 /* Directory not empty */ 1371541Srgrimes 1381541Srgrimes/* quotas & mush */ 1391541Srgrimes#ifndef _POSIX_SOURCE 1401541Srgrimes#define EPROCLIM 67 /* Too many processes */ 1411541Srgrimes#define EUSERS 68 /* Too many users */ 1421541Srgrimes#define EDQUOT 69 /* Disc quota exceeded */ 1431541Srgrimes 1441541Srgrimes/* Network File System */ 1451541Srgrimes#define ESTALE 70 /* Stale NFS file handle */ 1461541Srgrimes#define EREMOTE 71 /* Too many levels of remote in path */ 1471541Srgrimes#define EBADRPC 72 /* RPC struct is bad */ 1481541Srgrimes#define ERPCMISMATCH 73 /* RPC version wrong */ 1491541Srgrimes#define EPROGUNAVAIL 74 /* RPC prog. not avail */ 1501541Srgrimes#define EPROGMISMATCH 75 /* Program version wrong */ 1511541Srgrimes#define EPROCUNAVAIL 76 /* Bad procedure for program */ 1521541Srgrimes#endif /* _POSIX_SOURCE */ 1531541Srgrimes 1541541Srgrimes#define ENOLCK 77 /* No locks available */ 1551541Srgrimes#define ENOSYS 78 /* Function not implemented */ 1561541Srgrimes 1571541Srgrimes#ifndef _POSIX_SOURCE 1581541Srgrimes#define EFTYPE 79 /* Inappropriate file type or format */ 1591541Srgrimes#define EAUTH 80 /* Authentication error */ 1601541Srgrimes#define ENEEDAUTH 81 /* Need authenticator */ 16141796Sdt#define EIDRM 82 /* Identifier removed */ 16241796Sdt#define ENOMSG 83 /* No message of desired type */ 16346017Sphk#define EOVERFLOW 84 /* Value too large to be stored in data type */ 16441796Sdt#define ECANCELED 85 /* Operation canceled */ 16541796Sdt#define EILSEQ 86 /* Illegal byte sequence */ 16691814Sgreen#define ENOATTR 87 /* Attribute not found */ 16782431Sache 168220335Savg#define EDOOFUS 88 /* Programming error */ 169144530Sdas#endif /* _POSIX_SOURCE */ 170101567Sphk 171144530Sdas#define EBADMSG 89 /* Bad message */ 172144530Sdas#define EMULTIHOP 90 /* Multihop attempted */ 173144530Sdas#define ENOLINK 91 /* Link has been severed */ 174144530Sdas#define EPROTO 92 /* Protocol error */ 175101587Sphk 176144530Sdas#ifndef _POSIX_SOURCE 177197841Srwatson#define ENOTCAPABLE 93 /* Capabilities insufficient */ 178220335Savg#define ECAPMODE 94 /* Not permitted in capability mode */ 179250250Spluknet#define ENOTRECOVERABLE 95 /* State not recoverable */ 180250250Spluknet#define EOWNERDEAD 96 /* Previous owner died */ 1811541Srgrimes#endif /* _POSIX_SOURCE */ 1821541Srgrimes 183197841Srwatson#ifndef _POSIX_SOURCE 184250250Spluknet#define ELAST 96 /* Must be equal largest errno */ 185197841Srwatson#endif /* _POSIX_SOURCE */ 186197841Srwatson 18755205Speter#ifdef _KERNEL 1881541Srgrimes/* pseudo-errors returned inside kernel to modify return to process */ 18931575Sbde#define ERESTART (-1) /* restart syscall */ 19031575Sbde#define EJUSTRETURN (-2) /* don't modify regs, just return */ 19131575Sbde#define ENOIOCTL (-3) /* ioctl not handled by this layer */ 192104602Sphk#define EDIRIOCTL (-4) /* do direct ioctl in GEOM */ 1931541Srgrimes#endif 1942165Spaul 1952165Spaul#endif 196