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