errno.h revision 1541
116132Swpaul/* 216132Swpaul * Copyright (c) 1982, 1986, 1989, 1993 316132Swpaul * The Regents of the University of California. All rights reserved. 416132Swpaul * (c) UNIX System Laboratories, Inc. 516132Swpaul * All or some portions of this file are derived from material licensed 616132Swpaul * to the University of California by American Telephone and Telegraph 716132Swpaul * Co. or Unix System Laboratories, Inc. and are reproduced herein with 816132Swpaul * the permission of UNIX System Laboratories, Inc. 916132Swpaul * 1016132Swpaul * Redistribution and use in source and binary forms, with or without 1116132Swpaul * modification, are permitted provided that the following conditions 1216132Swpaul * are met: 1316132Swpaul * 1. Redistributions of source code must retain the above copyright 1416132Swpaul * notice, this list of conditions and the following disclaimer. 1516132Swpaul * 2. Redistributions in binary form must reproduce the above copyright 1616132Swpaul * notice, this list of conditions and the following disclaimer in the 1716132Swpaul * documentation and/or other materials provided with the distribution. 1816132Swpaul * 3. All advertising materials mentioning features or use of this software 1916132Swpaul * must display the following acknowledgement: 2016132Swpaul * This product includes software developed by the University of 2116132Swpaul * California, Berkeley and its contributors. 2216132Swpaul * 4. Neither the name of the University nor the names of its contributors 2316132Swpaul * may be used to endorse or promote products derived from this software 2416132Swpaul * without specific prior written permission. 2516132Swpaul * 2616132Swpaul * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 2716132Swpaul * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2816132Swpaul * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2916132Swpaul * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 3016132Swpaul * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 3116132Swpaul * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 3216132Swpaul * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33114626Sobrien * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34114626Sobrien * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 3531626Scharnier * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3631626Scharnier * SUCH DAMAGE. 3719181Swpaul * 3819181Swpaul * @(#)errno.h 8.5 (Berkeley) 1/21/94 3916132Swpaul */ 4031626Scharnier 4116132Swpaul#ifndef KERNEL 4216132Swpaulextern int errno; /* global error number */ 4316132Swpaul#endif 4416132Swpaul 4516132Swpaul#define EPERM 1 /* Operation not permitted */ 4616132Swpaul#define ENOENT 2 /* No such file or directory */ 4731626Scharnier#define ESRCH 3 /* No such process */ 4816132Swpaul#define EINTR 4 /* Interrupted system call */ 4916132Swpaul#define EIO 5 /* Input/output error */ 5016132Swpaul#define ENXIO 6 /* Device not configured */ 5116132Swpaul#define E2BIG 7 /* Argument list too long */ 5290298Sdes#define ENOEXEC 8 /* Exec format error */ 5390298Sdes#define EBADF 9 /* Bad file descriptor */ 5416132Swpaul#define ECHILD 10 /* No child processes */ 5590297Sdes#define EDEADLK 11 /* Resource deadlock avoided */ 5616132Swpaul /* 11 was EAGAIN */ 5716132Swpaul#define ENOMEM 12 /* Cannot allocate memory */ 5816132Swpaul#define EACCES 13 /* Permission denied */ 5916132Swpaul#define EFAULT 14 /* Bad address */ 6016132Swpaul#ifndef _POSIX_SOURCE 6116132Swpaul#define ENOTBLK 15 /* Block device required */ 6216132Swpaul#endif 6316132Swpaul#define EBUSY 16 /* Device busy */ 6416132Swpaul#define EEXIST 17 /* File exists */ 65121538Speter#define EXDEV 18 /* Cross-device link */ 6616132Swpaul#define ENODEV 19 /* Operation not supported by device */ 6790297Sdes#define ENOTDIR 20 /* Not a directory */ 6816132Swpaul#define EISDIR 21 /* Is a directory */ 6916132Swpaul#define EINVAL 22 /* Invalid argument */ 7016132Swpaul#define ENFILE 23 /* Too many open files in system */ 7116132Swpaul#define EMFILE 24 /* Too many open files */ 7216132Swpaul#define ENOTTY 25 /* Inappropriate ioctl for device */ 7316132Swpaul#ifndef _POSIX_SOURCE 7416132Swpaul#define ETXTBSY 26 /* Text file busy */ 7516132Swpaul#endif 7616132Swpaul#define EFBIG 27 /* File too large */ 7716132Swpaul#define ENOSPC 28 /* No space left on device */ 7816132Swpaul#define ESPIPE 29 /* Illegal seek */ 7916132Swpaul#define EROFS 30 /* Read-only file system */ 8016132Swpaul#define EMLINK 31 /* Too many links */ 8116132Swpaul#define EPIPE 32 /* Broken pipe */ 8216132Swpaul 8316958Swpaul/* math software */ 8416958Swpaul#define EDOM 33 /* Numerical argument out of domain */ 8516958Swpaul#define ERANGE 34 /* Result too large */ 8616958Swpaul 8716958Swpaul/* non-blocking and interrupt i/o */ 8816958Swpaul#define EAGAIN 35 /* Resource temporarily unavailable */ 8916958Swpaul#ifndef _POSIX_SOURCE 9016958Swpaul#define EWOULDBLOCK EAGAIN /* Operation would block */ 9116132Swpaul#define EINPROGRESS 36 /* Operation now in progress */ 9216132Swpaul#define EALREADY 37 /* Operation already in progress */ 9316132Swpaul 9416132Swpaul/* ipc/network software -- argument errors */ 9516132Swpaul#define ENOTSOCK 38 /* Socket operation on non-socket */ 9616132Swpaul#define EDESTADDRREQ 39 /* Destination address required */ 9716132Swpaul#define EMSGSIZE 40 /* Message too long */ 9816132Swpaul#define EPROTOTYPE 41 /* Protocol wrong type for socket */ 9916132Swpaul#define ENOPROTOOPT 42 /* Protocol not available */ 10016132Swpaul#define EPROTONOSUPPORT 43 /* Protocol not supported */ 10116132Swpaul#define ESOCKTNOSUPPORT 44 /* Socket type not supported */ 10290298Sdes#define EOPNOTSUPP 45 /* Operation not supported */ 10390298Sdes#define EPFNOSUPPORT 46 /* Protocol family not supported */ 10416132Swpaul#define EAFNOSUPPORT 47 /* Address family not supported by protocol family */ 10516132Swpaul#define EADDRINUSE 48 /* Address already in use */ 10616132Swpaul#define EADDRNOTAVAIL 49 /* Can't assign requested address */ 10716132Swpaul 10816132Swpaul/* ipc/network software -- operational errors */ 10916132Swpaul#define ENETDOWN 50 /* Network is down */ 11016132Swpaul#define ENETUNREACH 51 /* Network is unreachable */ 11116132Swpaul#define ENETRESET 52 /* Network dropped connection on reset */ 11216132Swpaul#define ECONNABORTED 53 /* Software caused connection abort */ 11316958Swpaul#define ECONNRESET 54 /* Connection reset by peer */ 11416958Swpaul#define ENOBUFS 55 /* No buffer space available */ 11516958Swpaul#define EISCONN 56 /* Socket is already connected */ 11616958Swpaul#define ENOTCONN 57 /* Socket is not connected */ 11716958Swpaul#define ESHUTDOWN 58 /* Can't send after socket shutdown */ 11816958Swpaul#define ETOOMANYREFS 59 /* Too many references: can't splice */ 11916132Swpaul#define ETIMEDOUT 60 /* Operation timed out */ 12016132Swpaul#define ECONNREFUSED 61 /* Connection refused */ 12116132Swpaul 12216132Swpaul#define ELOOP 62 /* Too many levels of symbolic links */ 12316132Swpaul#endif /* _POSIX_SOURCE */ 12416132Swpaul#define ENAMETOOLONG 63 /* File name too long */ 12516132Swpaul 12616132Swpaul/* should be rearranged */ 12716132Swpaul#ifndef _POSIX_SOURCE 12816132Swpaul#define EHOSTDOWN 64 /* Host is down */ 12916132Swpaul#define EHOSTUNREACH 65 /* No route to host */ 13016132Swpaul#endif /* _POSIX_SOURCE */ 13116132Swpaul#define ENOTEMPTY 66 /* Directory not empty */ 132121538Speter 133121538Speter/* quotas & mush */ 134121538Speter#ifndef _POSIX_SOURCE 135121538Speter#define EPROCLIM 67 /* Too many processes */ 13616132Swpaul#define EUSERS 68 /* Too many users */ 13716132Swpaul#define EDQUOT 69 /* Disc quota exceeded */ 13816132Swpaul 13916132Swpaul/* Network File System */ 14016132Swpaul#define ESTALE 70 /* Stale NFS file handle */ 14116132Swpaul#define EREMOTE 71 /* Too many levels of remote in path */ 14216132Swpaul#define EBADRPC 72 /* RPC struct is bad */ 14316132Swpaul#define ERPCMISMATCH 73 /* RPC version wrong */ 14416132Swpaul#define EPROGUNAVAIL 74 /* RPC prog. not avail */ 145#define EPROGMISMATCH 75 /* Program version wrong */ 146#define EPROCUNAVAIL 76 /* Bad procedure for program */ 147#endif /* _POSIX_SOURCE */ 148 149#define ENOLCK 77 /* No locks available */ 150#define ENOSYS 78 /* Function not implemented */ 151 152#ifndef _POSIX_SOURCE 153#define EFTYPE 79 /* Inappropriate file type or format */ 154#define EAUTH 80 /* Authentication error */ 155#define ENEEDAUTH 81 /* Need authenticator */ 156#define ELAST 81 /* Must be equal largest errno */ 157#endif /* _POSIX_SOURCE */ 158 159#ifdef KERNEL 160/* pseudo-errors returned inside kernel to modify return to process */ 161#define ERESTART -1 /* restart syscall */ 162#define EJUSTRETURN -2 /* don't modify regs, just return */ 163#endif 164