/*- * Copyright (c) 1982, 1986, 1989, 1993 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. * All or some portions of this file are derived from material licensed * to the University of California by American Telephone and Telegraph * Co. or Unix System Laboratories, Inc. and are reproduced herein with * the permission of UNIX System Laboratories, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)errno.h 8.5 (Berkeley) 1/21/94 * $FreeBSD: head/sys/sys/errno.h 220335 2011-04-04 17:39:30Z avg $ */ #ifndef _SYS_ERRNO_H_ #define _SYS_ERRNO_H_ #ifndef _KERNEL #include __BEGIN_DECLS int * __error(void); __END_DECLS #define errno (* __error()) #endif #define __EPERM 1 /* Operation not permitted */ #define __ENOENT 2 /* No such file or directory */ #define __ESRCH 3 /* No such process */ #define __EINTR 4 /* Interrupted system call */ #define __EIO 5 /* Input/output error */ #define __ENXIO 6 /* Device not configured */ #define __E2BIG 7 /* Argument list too long */ #define __ENOEXEC 8 /* Exec format error */ #define __EBADF 9 /* Bad file descriptor */ #define __ECHILD 10 /* No child processes */ #define __EDEADLK 11 /* Resource deadlock avoided */ /* 11 was EAGAIN */ #define __ENOMEM 12 /* Cannot allocate memory */ #define __EACCES 13 /* Permission denied */ #define __EFAULT 14 /* Bad address */ #ifndef _POSIX_SOURCE #define __ENOTBLK 15 /* Block device required */ #endif #define __EBUSY 16 /* Device busy */ #define __EEXIST 17 /* File exists */ #define __EXDEV 18 /* Cross-device link */ #define __ENODEV 19 /* Operation not supported by device */ #define __ENOTDIR 20 /* Not a directory */ #define __EISDIR 21 /* Is a directory */ #define __EINVAL 22 /* Invalid argument */ #define __ENFILE 23 /* Too many open files in system */ #define __EMFILE 24 /* Too many open files */ #define __ENOTTY 25 /* Inappropriate ioctl for device */ #ifndef _POSIX_SOURCE #define __ETXTBSY 26 /* Text file busy */ #endif #define __EFBIG 27 /* File too large */ #define __ENOSPC 28 /* No space left on device */ #define __ESPIPE 29 /* Illegal seek */ #define __EROFS 30 /* Read-only filesystem */ #define __EMLINK 31 /* Too many links */ #define __EPIPE 32 /* Broken pipe */ /* math software */ #define __EDOM 33 /* Numerical argument out of domain */ #define __ERANGE 34 /* Result too large */ /* non-blocking and interrupt i/o */ #define __EAGAIN 35 /* Resource temporarily unavailable */ #ifndef _POSIX_SOURCE #define __EWOULDBLOCK __EAGAIN /* Operation would block */ #define __EINPROGRESS 36 /* Operation now in progress */ #define __EALREADY 37 /* Operation already in progress */ /* ipc/network software -- argument errors */ #define __ENOTSOCK 38 /* Socket operation on non-socket */ #define __EDESTADDRREQ 39 /* Destination address required */ #define __EMSGSIZE 40 /* Message too long */ #define __EPROTOTYPE 41 /* Protocol wrong type for socket */ #define __ENOPROTOOPT 42 /* Protocol not available */ #define __EPROTONOSUPPORT 43 /* Protocol not supported */ #define __ESOCKTNOSUPPORT 44 /* Socket type not supported */ #define __EOPNOTSUPP 45 /* Operation not supported */ #define __ENOTSUP __EOPNOTSUPP /* Operation not supported */ #define __EPFNOSUPPORT 46 /* Protocol family not supported */ #define __EAFNOSUPPORT 47 /* Address family not supported by protocol family */ #define __EADDRINUSE 48 /* Address already in use */ #define __EADDRNOTAVAIL 49 /* Can't assign requested address */ /* ipc/network software -- operational errors */ #define __ENETDOWN 50 /* Network is down */ #define __ENETUNREACH 51 /* Network is unreachable */ #define __ENETRESET 52 /* Network dropped connection on reset */ #define __ECONNABORTED 53 /* Software caused connection abort */ #define __ECONNRESET 54 /* Connection reset by peer */ #define __ENOBUFS 55 /* No buffer space available */ #define __EISCONN 56 /* Socket is already connected */ #define __ENOTCONN 57 /* Socket is not connected */ #define __ESHUTDOWN 58 /* Can't send after socket shutdown */ #define __ETOOMANYREFS 59 /* Too many references: can't splice */ #define __ETIMEDOUT 60 /* Operation timed out */ #define __ECONNREFUSED 61 /* Connection refused */ #define __ELOOP 62 /* Too many levels of symbolic links */ #endif /* _POSIX_SOURCE */ #define __ENAMETOOLONG 63 /* File name too long */ /* should be rearranged */ #ifndef _POSIX_SOURCE #define __EHOSTDOWN 64 /* Host is down */ #define __EHOSTUNREACH 65 /* No route to host */ #endif /* _POSIX_SOURCE */ #define __ENOTEMPTY 66 /* Directory not empty */ /* quotas & mush */ #ifndef _POSIX_SOURCE #define __EPROCLIM 67 /* Too many processes */ #define __EUSERS 68 /* Too many users */ #define __EDQUOT 69 /* Disc quota exceeded */ /* Network File System */ #define __ESTALE 70 /* Stale NFS file handle */ #define __EREMOTE 71 /* Too many levels of remote in path */ #define __EBADRPC 72 /* RPC struct is bad */ #define __ERPCMISMATCH 73 /* RPC version wrong */ #define __EPROGUNAVAIL 74 /* RPC prog. not avail */ #define __EPROGMISMATCH 75 /* Program version wrong */ #define __EPROCUNAVAIL 76 /* Bad procedure for program */ #endif /* _POSIX_SOURCE */ #define __ENOLCK 77 /* No locks available */ #define __ENOSYS 78 /* Function not implemented */ #ifndef _POSIX_SOURCE #define __EFTYPE 79 /* Inappropriate file type or format */ #define __EAUTH 80 /* Authentication error */ #define __ENEEDAUTH 81 /* Need authenticator */ #define __EIDRM 82 /* Identifier removed */ #define __ENOMSG 83 /* No message of desired type */ #define __EOVERFLOW 84 /* Value too large to be stored in data type */ #define __ECANCELED 85 /* Operation canceled */ #define __EILSEQ 86 /* Illegal byte sequence */ #define __ENOATTR 87 /* Attribute not found */ #define __EDOOFUS 88 /* Programming error */ #endif /* _POSIX_SOURCE */ #define __EBADMSG 89 /* Bad message */ #define __EMULTIHOP 90 /* Multihop attempted */ #define __ENOLINK 91 /* Link has been severed */ #define __EPROTO 92 /* Protocol error */ #ifndef _POSIX_SOURCE #define __ENOTCAPABLE 93 /* Capabilities insufficient */ #define __ECAPMODE 94 /* Not permitted in capability mode */ #endif /* _POSIX_SOURCE */ #ifndef _POSIX_SOURCE #define __ELAST 94 /* Must be equal largest errno */ #endif /* _POSIX_SOURCE */ #if (defined(_KERNEL) && defined(TRACE_ERRORS)) int __kern_trace_error(const int, const char *, const int); #define EPERM __kern_trace_error(__EPERM, __FILE__, __LINE__) #define ENOENT __kern_trace_error(__ENOENT, __FILE__, __LINE__) #define ESRCH __kern_trace_error(__ESRCH, __FILE__, __LINE__) #define EINTR __kern_trace_error(__EINTR, __FILE__, __LINE__) #define EIO __kern_trace_error(__EIO, __FILE__, __LINE__) #define ENXIO __kern_trace_error(__ENXIO, __FILE__, __LINE__) #define E2BIG __kern_trace_error(__E2BIG, __FILE__, __LINE__) #define ENOEXEC __kern_trace_error(__ENOEXEC, __FILE__, __LINE__) #define EBADF __kern_trace_error(__EBADF, __FILE__, __LINE__) #define ECHILD __kern_trace_error(__ECHILD, __FILE__, __LINE__) #define EDEADLK __kern_trace_error(__EDEADLK, __FILE__, __LINE__) #define ENOMEM __kern_trace_error(__ENOMEM, __FILE__, __LINE__) #define EACCES __kern_trace_error(__EACCES, __FILE__, __LINE__) #define EFAULT __kern_trace_error(__EFAULT, __FILE__, __LINE__) #define EBUSY __kern_trace_error(__EBUSY, __FILE__, __LINE__) #define EEXIST __kern_trace_error(__EEXIST, __FILE__, __LINE__) #define EXDEV __kern_trace_error(__EXDEV, __FILE__, __LINE__) #define ENODEV __kern_trace_error(__ENODEV, __FILE__, __LINE__) #define ENOTDIR __kern_trace_error(__ENOTDIR, __FILE__, __LINE__) #define EISDIR __kern_trace_error(__EISDIR, __FILE__, __LINE__) #define EINVAL __kern_trace_error(__EINVAL, __FILE__, __LINE__) #define ENFILE __kern_trace_error(__ENFILE, __FILE__, __LINE__) #define EMFILE __kern_trace_error(__EMFILE, __FILE__, __LINE__) #define ENOTTY __kern_trace_error(__ENOTTY, __FILE__, __LINE__) #define EFBIG __kern_trace_error(__EFBIG, __FILE__, __LINE__) #define ENOSPC __kern_trace_error(__ENOSPC, __FILE__, __LINE__) #define ESPIPE __kern_trace_error(__ESPIPE, __FILE__, __LINE__) #define EROFS __kern_trace_error(__EROFS, __FILE__, __LINE__) #define EMLINK __kern_trace_error(__EMLINK, __FILE__, __LINE__) #define EPIPE __kern_trace_error(__EPIPE, __FILE__, __LINE__) #define EDOM __kern_trace_error(__EDOM, __FILE__, __LINE__) #define ERANGE __kern_trace_error(__ERANGE, __FILE__, __LINE__) #define EAGAIN __kern_trace_error(__EAGAIN, __FILE__, __LINE__) #define ENAMETOOLONG __kern_trace_error(__ENAMETOOLONG, __FILE__, __LINE__) #define ENOTEMPTY __kern_trace_error(__ENOTEMPTY, __FILE__, __LINE__) #define ENOLCK __kern_trace_error(__ENOLCK, __FILE__, __LINE__) #define ENOSYS __kern_trace_error(__ENOSYS, __FILE__, __LINE__) #define EBADMSG __kern_trace_error(__EBADMSG, __FILE__, __LINE__) #define EMULTIHOP __kern_trace_error(__EMULTIHOP, __FILE__, __LINE__) #define ENOLINK __kern_trace_error(__ENOLINK, __FILE__, __LINE__) #define EPROTO __kern_trace_error(__EPROTO, __FILE__, __LINE__) #ifndef _POSIX_SOURCE #define ENOTBLK __kern_trace_error(__ENOTBLK, __FILE__, __LINE__) #define ETXTBSY __kern_trace_error(__ETXTBSY, __FILE__, __LINE__) #define EWOULDBLOCK __kern_trace_error(__EWOULDBLOCK, __FILE__, __LINE__) #define EINPROGRESS __kern_trace_error(__EINPROGRESS, __FILE__, __LINE__) #define EALREADY __kern_trace_error(__EALREADY, __FILE__, __LINE__) #define ENOTSOCK __kern_trace_error(__ENOTSOCK, __FILE__, __LINE__) #define EDESTADDRREQ __kern_trace_error(__EDESTADDRREQ, __FILE__, __LINE__) #define EMSGSIZE __kern_trace_error(__EMSGSIZE, __FILE__, __LINE__) #define EPROTOTYPE __kern_trace_error(__EPROTOTYPE, __FILE__, __LINE__) #define ENOPROTOOPT __kern_trace_error(__ENOPROTOOPT, __FILE__, __LINE__) #define EPROTONOSUPPORT __kern_trace_error(__EPROTONOSUPPORT, __FILE__, __LINE__) #define ESOCKTNOSUPPORT __kern_trace_error(__ESOCKTNOSUPPORT, __FILE__, __LINE__) #define EOPNOTSUPP __kern_trace_error(__EOPNOTSUPP, __FILE__, __LINE__) #define ENOTSUP __kern_trace_error(__ENOTSUP, __FILE__, __LINE__) #define EPFNOSUPPORT __kern_trace_error(__EPFNOSUPPORT, __FILE__, __LINE__) #define EAFNOSUPPORT __kern_trace_error(__EAFNOSUPPORT, __FILE__, __LINE__) #define EADDRINUSE __kern_trace_error(__EADDRINUSE, __FILE__, __LINE__) #define EADDRNOTAVAIL __kern_trace_error(__EADDRNOTAVAIL, __FILE__, __LINE__) #define ENETDOWN __kern_trace_error(__ENETDOWN, __FILE__, __LINE__) #define ENETUNREACH __kern_trace_error(__ENETUNREACH, __FILE__, __LINE__) #define ENETRESET __kern_trace_error(__ENETRESET, __FILE__, __LINE__) #define ECONNABORTED __kern_trace_error(__ECONNABORTED, __FILE__, __LINE__) #define ECONNRESET __kern_trace_error(__ECONNRESET, __FILE__, __LINE__) #define ENOBUFS __kern_trace_error(__ENOBUFS, __FILE__, __LINE__) #define EISCONN __kern_trace_error(__EISCONN, __FILE__, __LINE__) #define ENOTCONN __kern_trace_error(__ENOTCONN, __FILE__, __LINE__) #define ESHUTDOWN __kern_trace_error(__ESHUTDOWN, __FILE__, __LINE__) #define ETOOMANYREFS __kern_trace_error(__ETOOMANYREFS, __FILE__, __LINE__) #define ETIMEDOUT __kern_trace_error(__ETIMEDOUT, __FILE__, __LINE__) #define ECONNREFUSED __kern_trace_error(__ECONNREFUSED, __FILE__, __LINE__) #define ELOOP __kern_trace_error(__ELOOP, __FILE__, __LINE__) #define EHOSTDOWN __kern_trace_error(__EHOSTDOWN, __FILE__, __LINE__) #define EHOSTUNREACH __kern_trace_error(__EHOSTUNREACH, __FILE__, __LINE__) #define EPROCLIM __kern_trace_error(__EPROCLIM, __FILE__, __LINE__) #define EUSERS __kern_trace_error(__EUSERS, __FILE__, __LINE__) #define EDQUOT __kern_trace_error(__EDQUOT, __FILE__, __LINE__) #define ESTALE __kern_trace_error(__ESTALE, __FILE__, __LINE__) #define EREMOTE __kern_trace_error(__EREMOTE, __FILE__, __LINE__) #define EBADRPC __kern_trace_error(__EBADRPC, __FILE__, __LINE__) #define ERPCMISMATCH __kern_trace_error(__ERPCMISMATCH, __FILE__, __LINE__) #define EPROGUNAVAIL __kern_trace_error(__EPROGUNAVAIL, __FILE__, __LINE__) #define EPROGMISMATCH __kern_trace_error(__EPROGMISMATCH, __FILE__, __LINE__) #define EPROCUNAVAIL __kern_trace_error(__EPROCUNAVAIL, __FILE__, __LINE__) #define EFTYPE __kern_trace_error(__EFTYPE, __FILE__, __LINE__) #define EAUTH __kern_trace_error(__EAUTH, __FILE__, __LINE__) #define ENEEDAUTH __kern_trace_error(__ENEEDAUTH, __FILE__, __LINE__) #define EIDRM __kern_trace_error(__EIDRM, __FILE__, __LINE__) #define ENOMSG __kern_trace_error(__ENOMSG, __FILE__, __LINE__) #define EOVERFLOW __kern_trace_error(__EOVERFLOW, __FILE__, __LINE__) #define ECANCELED __kern_trace_error(__ECANCELED, __FILE__, __LINE__) #define EILSEQ __kern_trace_error(__EILSEQ, __FILE__, __LINE__) #define ENOATTR __kern_trace_error(__ENOATTR, __FILE__, __LINE__) #define EDOOFUS __kern_trace_error(__EDOOFUS, __FILE__, __LINE__) #define ENOTCAPABLE __kern_trace_error(__ENOTCAPABLE, __FILE__, __LINE__) #define ECAPMODE __kern_trace_error(__ECAPMODE, __FILE__, __LINE__) #define ELAST __kern_trace_error(__ELAST, __FILE__, __LINE__) #endif /* _POSIX_SOURCE */ #else /* ! (_KERNEL && TRACE_ERRORS) */ #define EPERM __EPERM #define ENOENT __ENOENT #define ESRCH __ESRCH #define EINTR __EINTR #define EIO __EIO #define ENXIO __ENXIO #define E2BIG __E2BIG #define ENOEXEC __ENOEXEC #define EBADF __EBADF #define ECHILD __ECHILD #define EDEADLK __EDEADLK #define ENOMEM __ENOMEM #define EACCES __EACCES #define EFAULT __EFAULT #define EBUSY __EBUSY #define EEXIST __EEXIST #define EXDEV __EXDEV #define ENODEV __ENODEV #define ENOTDIR __ENOTDIR #define EISDIR __EISDIR #define EINVAL __EINVAL #define ENFILE __ENFILE #define EMFILE __EMFILE #define ENOTTY __ENOTTY #define EFBIG __EFBIG #define ENOSPC __ENOSPC #define ESPIPE __ESPIPE #define EROFS __EROFS #define EMLINK __EMLINK #define EPIPE __EPIPE #define EDOM __EDOM #define ERANGE __ERANGE #define EAGAIN __EAGAIN #define ENAMETOOLONG __ENAMETOOLONG #define ENOTEMPTY __ENOTEMPTY #define ENOLCK __ENOLCK #define ENOSYS __ENOSYS #define EBADMSG __EBADMSG #define EMULTIHOP __EMULTIHOP #define ENOLINK __ENOLINK #define EPROTO __EPROTO #ifndef _POSIX_SOURCE #define ENOTBLK __ENOTBLK #define ETXTBSY __ETXTBSY #define EWOULDBLOCK __EWOULDBLOCK #define EINPROGRESS __EINPROGRESS #define EALREADY __EALREADY #define ENOTSOCK __ENOTSOCK #define EDESTADDRREQ __EDESTADDRREQ #define EMSGSIZE __EMSGSIZE #define EPROTOTYPE __EPROTOTYPE #define ENOPROTOOPT __ENOPROTOOPT #define EPROTONOSUPPORT __EPROTONOSUPPORT #define ESOCKTNOSUPPORT __ESOCKTNOSUPPORT #define EOPNOTSUPP __EOPNOTSUPP #define ENOTSUP __ENOTSUP #define EPFNOSUPPORT __EPFNOSUPPORT #define EAFNOSUPPORT __EAFNOSUPPORT #define EADDRINUSE __EADDRINUSE #define EADDRNOTAVAIL __EADDRNOTAVAIL #define ENETDOWN __ENETDOWN #define ENETUNREACH __ENETUNREACH #define ENETRESET __ENETRESET #define ECONNABORTED __ECONNABORTED #define ECONNRESET __ECONNRESET #define ENOBUFS __ENOBUFS #define EISCONN __EISCONN #define ENOTCONN __ENOTCONN #define ESHUTDOWN __ESHUTDOWN #define ETOOMANYREFS __ETOOMANYREFS #define ETIMEDOUT __ETIMEDOUT #define ECONNREFUSED __ECONNREFUSED #define ELOOP __ELOOP #define EHOSTDOWN __EHOSTDOWN #define EHOSTUNREACH __EHOSTUNREACH #define EPROCLIM __EPROCLIM #define EUSERS __EUSERS #define EDQUOT __EDQUOT #define ESTALE __ESTALE #define EREMOTE __EREMOTE #define EBADRPC __EBADRPC #define ERPCMISMATCH __ERPCMISMATCH #define EPROGUNAVAIL __EPROGUNAVAIL #define EPROGMISMATCH __EPROGMISMATCH #define EPROCUNAVAIL __EPROCUNAVAIL #define EFTYPE __EFTYPE #define EAUTH __EAUTH #define ENEEDAUTH __ENEEDAUTH #define EIDRM __EIDRM #define ENOMSG __ENOMSG #define EOVERFLOW __EOVERFLOW #define ECANCELED __ECANCELED #define EILSEQ __EILSEQ #define ENOATTR __ENOATTR #define EDOOFUS __EDOOFUS #define ENOTCAPABLE __ENOTCAPABLE #define ECAPMODE __ECAPMODE #define ELAST __ELAST #endif /* _POSIX_SOURCE */ #endif /* _KERNEL && TRACE_ERRORS */ #ifdef _KERNEL /* pseudo-errors returned inside kernel to modify return to process */ #define ERESTART (-1) /* restart syscall */ #define EJUSTRETURN (-2) /* don't modify regs, just return */ #define ENOIOCTL (-3) /* ioctl not handled by this layer */ #define EDIRIOCTL (-4) /* do direct ioctl in GEOM */ #endif #endif /* _SYS_ERRNO_H_ */