errno.h revision 104602
1179595Sbenno/* 2179595Sbenno * Copyright (c) 1982, 1986, 1989, 1993 3179595Sbenno * The Regents of the University of California. All rights reserved. 4179595Sbenno * (c) UNIX System Laboratories, Inc. 5179595Sbenno * All or some portions of this file are derived from material licensed 6179595Sbenno * to the University of California by American Telephone and Telegraph 7179595Sbenno * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8179595Sbenno * the permission of UNIX System Laboratories, Inc. 9179595Sbenno * 10179595Sbenno * Redistribution and use in source and binary forms, with or without 11179595Sbenno * modification, are permitted provided that the following conditions 12179595Sbenno * are met: 13179595Sbenno * 1. Redistributions of source code must retain the above copyright 14179595Sbenno * notice, this list of conditions and the following disclaimer. 15179595Sbenno * 2. Redistributions in binary form must reproduce the above copyright 16179595Sbenno * notice, this list of conditions and the following disclaimer in the 17179595Sbenno * documentation and/or other materials provided with the distribution. 18179595Sbenno * 3. All advertising materials mentioning features or use of this software 19179595Sbenno * must display the following acknowledgement: 20179595Sbenno * This product includes software developed by the University of 21179595Sbenno * California, Berkeley and its contributors. 22179595Sbenno * 4. Neither the name of the University nor the names of its contributors 23179595Sbenno * may be used to endorse or promote products derived from this software 24179595Sbenno * without specific prior written permission. 25179595Sbenno * 26179595Sbenno * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 27179595Sbenno * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 28179595Sbenno * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 29179595Sbenno * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 30179595Sbenno * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 31179595Sbenno * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32179595Sbenno * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33179595Sbenno * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34179595Sbenno * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35179595Sbenno * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36179595Sbenno * SUCH DAMAGE. 37179595Sbenno * 38179595Sbenno * @(#)errno.h 8.5 (Berkeley) 1/21/94 39179595Sbenno * $FreeBSD: head/sys/sys/errno.h 104602 2002-10-07 06:25:26Z phk $ 40179595Sbenno */ 41179595Sbenno 42179595Sbenno#ifndef _SYS_ERRNO_H_ 43179595Sbenno#define _SYS_ERRNO_H_ 44179595Sbenno 45179595Sbenno#ifndef _KERNEL 46179595Sbenno#include <sys/cdefs.h> 47179595Sbenno__BEGIN_DECLS 48179595Sbennoint * __error(void); 49179595Sbenno__END_DECLS 50179595Sbenno#define errno (* __error()) 51179595Sbenno#endif 52179595Sbenno 53179595Sbenno#define EPERM 1 /* Operation not permitted */ 54179595Sbenno#define ENOENT 2 /* No such file or directory */ 55179595Sbenno#define ESRCH 3 /* No such process */ 56179595Sbenno#define EINTR 4 /* Interrupted system call */ 57179595Sbenno#define EIO 5 /* Input/output error */ 58179595Sbenno#define ENXIO 6 /* Device not configured */ 59179595Sbenno#define E2BIG 7 /* Argument list too long */ 60179595Sbenno#define ENOEXEC 8 /* Exec format error */ 61179595Sbenno#define EBADF 9 /* Bad file descriptor */ 62179595Sbenno#define ECHILD 10 /* No child processes */ 63179595Sbenno#define EDEADLK 11 /* Resource deadlock avoided */ 64179595Sbenno /* 11 was EAGAIN */ 65179595Sbenno#define ENOMEM 12 /* Cannot allocate memory */ 66179595Sbenno#define EACCES 13 /* Permission denied */ 67179595Sbenno#define EFAULT 14 /* Bad address */ 68179595Sbenno#ifndef _POSIX_SOURCE 69179595Sbenno#define ENOTBLK 15 /* Block device required */ 70179595Sbenno#endif 71179595Sbenno#define EBUSY 16 /* Device busy */ 72179595Sbenno#define EEXIST 17 /* File exists */ 73179595Sbenno#define EXDEV 18 /* Cross-device link */ 74179595Sbenno#define ENODEV 19 /* Operation not supported by device */ 75179595Sbenno#define ENOTDIR 20 /* Not a directory */ 76179595Sbenno#define EISDIR 21 /* Is a directory */ 77179595Sbenno#define EINVAL 22 /* Invalid argument */ 78179595Sbenno#define ENFILE 23 /* Too many open files in system */ 79179595Sbenno#define EMFILE 24 /* Too many open files */ 80179595Sbenno#define ENOTTY 25 /* Inappropriate ioctl for device */ 81179595Sbenno#ifndef _POSIX_SOURCE 82179595Sbenno#define ETXTBSY 26 /* Text file busy */ 83179595Sbenno#endif 84179595Sbenno#define EFBIG 27 /* File too large */ 85179595Sbenno#define ENOSPC 28 /* No space left on device */ 86179595Sbenno#define ESPIPE 29 /* Illegal seek */ 87179595Sbenno#define EROFS 30 /* Read-only filesystem */ 88179595Sbenno#define EMLINK 31 /* Too many links */ 89179595Sbenno#define EPIPE 32 /* Broken pipe */ 90179595Sbenno 91179595Sbenno/* math software */ 92179595Sbenno#define EDOM 33 /* Numerical argument out of domain */ 93179595Sbenno#define ERANGE 34 /* Result too large */ 94179595Sbenno 95179595Sbenno/* non-blocking and interrupt i/o */ 96179595Sbenno#define EAGAIN 35 /* Resource temporarily unavailable */ 97179595Sbenno#ifndef _POSIX_SOURCE 98179595Sbenno#define EWOULDBLOCK EAGAIN /* Operation would block */ 99179595Sbenno#define EINPROGRESS 36 /* Operation now in progress */ 100179595Sbenno#define EALREADY 37 /* Operation already in progress */ 101179595Sbenno 102179595Sbenno/* ipc/network software -- argument errors */ 103179595Sbenno#define ENOTSOCK 38 /* Socket operation on non-socket */ 104179595Sbenno#define EDESTADDRREQ 39 /* Destination address required */ 105179595Sbenno#define EMSGSIZE 40 /* Message too long */ 106179595Sbenno#define EPROTOTYPE 41 /* Protocol wrong type for socket */ 107179595Sbenno#define ENOPROTOOPT 42 /* Protocol not available */ 108179595Sbenno#define EPROTONOSUPPORT 43 /* Protocol not supported */ 109179595Sbenno#define ESOCKTNOSUPPORT 44 /* Socket type not supported */ 110179595Sbenno#define EOPNOTSUPP 45 /* Operation not supported */ 111179595Sbenno#define ENOTSUP EOPNOTSUPP /* Operation not supported */ 112179595Sbenno#define EPFNOSUPPORT 46 /* Protocol family not supported */ 113179595Sbenno#define EAFNOSUPPORT 47 /* Address family not supported by protocol family */ 114179595Sbenno#define EADDRINUSE 48 /* Address already in use */ 115179595Sbenno#define EADDRNOTAVAIL 49 /* Can't assign requested address */ 116179595Sbenno 117179595Sbenno/* ipc/network software -- operational errors */ 118179595Sbenno#define ENETDOWN 50 /* Network is down */ 119179595Sbenno#define ENETUNREACH 51 /* Network is unreachable */ 120179595Sbenno#define ENETRESET 52 /* Network dropped connection on reset */ 121179595Sbenno#define ECONNABORTED 53 /* Software caused connection abort */ 122179595Sbenno#define ECONNRESET 54 /* Connection reset by peer */ 123179595Sbenno#define ENOBUFS 55 /* No buffer space available */ 124179595Sbenno#define EISCONN 56 /* Socket is already connected */ 125179595Sbenno#define ENOTCONN 57 /* Socket is not connected */ 126179595Sbenno#define ESHUTDOWN 58 /* Can't send after socket shutdown */ 127179595Sbenno#define ETOOMANYREFS 59 /* Too many references: can't splice */ 128179595Sbenno#define ETIMEDOUT 60 /* Operation timed out */ 129179595Sbenno#define ECONNREFUSED 61 /* Connection refused */ 130179595Sbenno 131193847Smarcel#define ELOOP 62 /* Too many levels of symbolic links */ 132179595Sbenno#endif /* _POSIX_SOURCE */ 133179595Sbenno#define ENAMETOOLONG 63 /* File name too long */ 134179595Sbenno 135179595Sbenno/* should be rearranged */ 136179595Sbenno#ifndef _POSIX_SOURCE 137179595Sbenno#define EHOSTDOWN 64 /* Host is down */ 138179595Sbenno#define EHOSTUNREACH 65 /* No route to host */ 139179595Sbenno#endif /* _POSIX_SOURCE */ 140179595Sbenno#define ENOTEMPTY 66 /* Directory not empty */ 141179595Sbenno 142179595Sbenno/* quotas & mush */ 143179595Sbenno#ifndef _POSIX_SOURCE 144179595Sbenno#define EPROCLIM 67 /* Too many processes */ 145179595Sbenno#define EUSERS 68 /* Too many users */ 146179595Sbenno#define EDQUOT 69 /* Disc quota exceeded */ 147179595Sbenno 148179595Sbenno/* Network File System */ 149179595Sbenno#define ESTALE 70 /* Stale NFS file handle */ 150179595Sbenno#define EREMOTE 71 /* Too many levels of remote in path */ 151179595Sbenno#define EBADRPC 72 /* RPC struct is bad */ 152179595Sbenno#define ERPCMISMATCH 73 /* RPC version wrong */ 153179595Sbenno#define EPROGUNAVAIL 74 /* RPC prog. not avail */ 154179595Sbenno#define EPROGMISMATCH 75 /* Program version wrong */ 155179595Sbenno#define EPROCUNAVAIL 76 /* Bad procedure for program */ 156179595Sbenno#endif /* _POSIX_SOURCE */ 157179595Sbenno 158179595Sbenno#define ENOLCK 77 /* No locks available */ 159179595Sbenno#define ENOSYS 78 /* Function not implemented */ 160179595Sbenno 161179595Sbenno#ifndef _POSIX_SOURCE 162179595Sbenno#define EFTYPE 79 /* Inappropriate file type or format */ 163179595Sbenno#define EAUTH 80 /* Authentication error */ 164179595Sbenno#define ENEEDAUTH 81 /* Need authenticator */ 165179595Sbenno#define EIDRM 82 /* Identifier removed */ 166179595Sbenno#define ENOMSG 83 /* No message of desired type */ 167179595Sbenno#define EOVERFLOW 84 /* Value too large to be stored in data type */ 168179595Sbenno#define ECANCELED 85 /* Operation canceled */ 169179595Sbenno#define EILSEQ 86 /* Illegal byte sequence */ 170179595Sbenno#define ENOATTR 87 /* Attribute not found */ 171179595Sbenno 172179595Sbenno#define EDOOFUS 88 /* Programming error */ 173179595Sbenno 174179595Sbenno#define ELAST 88 /* Must be equal largest errno */ 175179595Sbenno 176179595Sbenno#endif /* _POSIX_SOURCE */ 177179595Sbenno 178179595Sbenno#ifdef _KERNEL 179179595Sbenno/* pseudo-errors returned inside kernel to modify return to process */ 180179595Sbenno#define ERESTART (-1) /* restart syscall */ 181179595Sbenno#define EJUSTRETURN (-2) /* don't modify regs, just return */ 182179595Sbenno#define ENOIOCTL (-3) /* ioctl not handled by this layer */ 183179595Sbenno#define EDIRIOCTL (-4) /* do direct ioctl in GEOM */ 184179595Sbenno#endif 185179595Sbenno 186179595Sbenno#endif 187179595Sbenno