Project

General

Profile

Statistics
| Revision:

root / lab4 / .minix-src / include / sys / errno.h @ 14

History | View | Annotate | Download (10.1 KB)

1
/*        $NetBSD: errno.h,v 1.40 2013/01/02 18:51:53 dsl Exp $        */
2

    
3
/*
4
 * Copyright (c) 1982, 1986, 1989, 1993
5
 *        The Regents of the University of California.  All rights reserved.
6
 * (c) UNIX System Laboratories, Inc.
7
 * All or some portions of this file are derived from material licensed
8
 * to the University of California by American Telephone and Telegraph
9
 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
10
 * the permission of UNIX System Laboratories, Inc.
11
 *
12
 * Redistribution and use in source and binary forms, with or without
13
 * modification, are permitted provided that the following conditions
14
 * are met:
15
 * 1. Redistributions of source code must retain the above copyright
16
 *    notice, this list of conditions and the following disclaimer.
17
 * 2. Redistributions in binary form must reproduce the above copyright
18
 *    notice, this list of conditions and the following disclaimer in the
19
 *    documentation and/or other materials provided with the distribution.
20
 * 3. Neither the name of the University nor the names of its contributors
21
 *    may be used to endorse or promote products derived from this software
22
 *    without specific prior written permission.
23
 *
24
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34
 * SUCH DAMAGE.
35
 *
36
 *        @(#)errno.h        8.5 (Berkeley) 1/21/94
37
 */
38

    
39
#ifndef _SYS_ERRNO_H_
40
#define _SYS_ERRNO_H_
41

    
42
#define        EPERM                (_SIGN 1 )                /* Operation not permitted */
43
#define        ENOENT                (_SIGN 2 )                /* No such file or directory */
44
#define        ESRCH                (_SIGN 3 )                /* No such process */
45
#define        EINTR                (_SIGN 4 )                /* Interrupted system call */
46
#define        EIO                (_SIGN 5 )                /* Input/output error */
47
#define        ENXIO                (_SIGN 6 )                /* Device not configured */
48
#define        E2BIG                (_SIGN 7 )                /* Argument list too long */
49
#define        ENOEXEC                (_SIGN 8 )                /* Exec format error */
50
#define        EBADF                (_SIGN 9 )                /* Bad file descriptor */
51
#define        ECHILD                (_SIGN 10 )                /* No child processes */
52
#define        EDEADLK                (_SIGN 11 )                /* Resource deadlock avoided */
53
                                        /* 11 was EAGAIN */
54
#define        ENOMEM                (_SIGN 12 )                /* Cannot allocate memory */
55
#define        EACCES                (_SIGN 13 )                /* Permission denied */
56
#define        EFAULT                (_SIGN 14 )                /* Bad address */
57
#define        ENOTBLK                (_SIGN 15 )                /* Block device required */
58
#define        EBUSY                (_SIGN 16 )                /* Device busy */
59
#define        EEXIST                (_SIGN 17 )                /* File exists */
60
#define        EXDEV                (_SIGN 18 )                /* Cross-device link */
61
#define        ENODEV                (_SIGN 19 )                /* Operation not supported by device */
62
#define        ENOTDIR                (_SIGN 20 )                /* Not a directory */
63
#define        EISDIR                (_SIGN 21 )                /* Is a directory */
64
#define        EINVAL                (_SIGN 22 )                /* Invalid argument */
65
#define        ENFILE                (_SIGN 23 )                /* Too many open files in system */
66
#define        EMFILE                (_SIGN 24 )                /* Too many open files */
67
#define        ENOTTY                (_SIGN 25 )                /* Inappropriate ioctl for device */
68
#define        ETXTBSY                (_SIGN 26 )                /* Text file busy */
69
#define        EFBIG                (_SIGN 27 )                /* File too large */
70
#define        ENOSPC                (_SIGN 28 )                /* No space left on device */
71
#define        ESPIPE                (_SIGN 29 )                /* Illegal seek */
72
#define        EROFS                (_SIGN 30 )                /* Read-only file system */
73
#define        EMLINK                (_SIGN 31 )                /* Too many links */
74
#define        EPIPE                (_SIGN 32 )                /* Broken pipe */
75

    
76
/* math software */
77
#define        EDOM                (_SIGN 33 )                /* Numerical argument out of domain */
78
#define        ERANGE                (_SIGN 34 )                /* Result too large or too small */
79

    
80
/* non-blocking and interrupt i/o */
81
#define        EAGAIN                (_SIGN 35 )                /* Resource temporarily unavailable */
82
#define        EWOULDBLOCK        EAGAIN                /* Operation would block */
83
#define        EINPROGRESS        (_SIGN 36 )                /* Operation now in progress */
84
#define        EALREADY        (_SIGN 37 )                /* Operation already in progress */
85

    
86
/* ipc/network software -- argument errors */
87
#define        ENOTSOCK        (_SIGN 38 )                /* Socket operation on non-socket */
88
#define        EDESTADDRREQ        (_SIGN 39 )                /* Destination address required */
89
#define        EMSGSIZE        (_SIGN 40 )                /* Message too long */
90
#define        EPROTOTYPE        (_SIGN 41 )                /* Protocol wrong type for socket */
91
#define        ENOPROTOOPT        (_SIGN 42 )                /* Protocol option not available */
92
#define        EPROTONOSUPPORT        (_SIGN 43 )                /* Protocol not supported */
93
#define        ESOCKTNOSUPPORT        (_SIGN 44 )                /* Socket type not supported */
94
#define        EOPNOTSUPP        (_SIGN 45 )                /* Operation not supported */
95
#define        EPFNOSUPPORT        (_SIGN 46 )                /* Protocol family not supported */
96
#define        EAFNOSUPPORT        (_SIGN 47 )                /* Address family not supported by protocol family */
97
#define        EADDRINUSE        (_SIGN 48 )                /* Address already in use */
98
#define        EADDRNOTAVAIL        (_SIGN 49 )                /* Can't assign requested address */
99

    
100
/* ipc/network software -- operational errors */
101
#define        ENETDOWN        (_SIGN 50 )                /* Network is down */
102
#define        ENETUNREACH        (_SIGN 51 )                /* Network is unreachable */
103
#define        ENETRESET        (_SIGN 52 )                /* Network dropped connection on reset */
104
#define        ECONNABORTED        (_SIGN 53 )                /* Software caused connection abort */
105
#define        ECONNRESET        (_SIGN 54 )                /* Connection reset by peer */
106
#define        ENOBUFS                (_SIGN 55 )                /* No buffer space available */
107
#define        EISCONN                (_SIGN 56 )                /* Socket is already connected */
108
#define        ENOTCONN        (_SIGN 57 )                /* Socket is not connected */
109
#define        ESHUTDOWN        (_SIGN 58 )                /* Can't send after socket shutdown */
110
#define        ETOOMANYREFS        (_SIGN 59 )                /* Too many references: can't splice */
111
#define        ETIMEDOUT        (_SIGN 60 )                /* Operation timed out */
112
#define        ECONNREFUSED        (_SIGN 61 )                /* Connection refused */
113

    
114
#define        ELOOP                (_SIGN 62 )                /* Too many levels of symbolic links */
115
#define        ENAMETOOLONG        (_SIGN 63 )                /* File name too long */
116

    
117
/* should be rearranged */
118
#define        EHOSTDOWN        (_SIGN 64 )                /* Host is down */
119
#define        EHOSTUNREACH        (_SIGN 65 )                /* No route to host */
120
#define        ENOTEMPTY        (_SIGN 66 )                /* Directory not empty */
121

    
122
/* quotas & mush */
123
#define        EPROCLIM        (_SIGN 67 )                /* Too many processes */
124
#define        EUSERS                (_SIGN 68 )                /* Too many users */
125
#define        EDQUOT                (_SIGN 69 )                /* Disc quota exceeded */
126

    
127
/* Network File System */
128
#define        ESTALE                (_SIGN 70 )                /* Stale NFS file handle */
129
#define        EREMOTE                (_SIGN 71 )                /* Too many levels of remote in path */
130
#define        EBADRPC                (_SIGN 72 )                /* RPC struct is bad */
131
#define        ERPCMISMATCH        (_SIGN 73 )                /* RPC version wrong */
132
#define        EPROGUNAVAIL        (_SIGN 74 )                /* RPC prog. not avail */
133
#define        EPROGMISMATCH        (_SIGN 75 )                /* Program version wrong */
134
#define        EPROCUNAVAIL        (_SIGN 76 )                /* Bad procedure for program */
135

    
136
#define        ENOLCK                (_SIGN 77 )                /* No locks available */
137
#define        ENOSYS                (_SIGN 78 )                /* Function not implemented */
138

    
139
#define        EFTYPE                (_SIGN 79 )                /* Inappropriate file type or format */
140
#define        EAUTH                (_SIGN 80 )                /* Authentication error */
141
#define        ENEEDAUTH        (_SIGN 81 )                /* Need authenticator */
142

    
143
/* SystemV IPC */
144
#define        EIDRM                (_SIGN 82 )                /* Identifier removed */
145
#define        ENOMSG                (_SIGN 83 )                /* No message of desired type */
146
#define        EOVERFLOW        (_SIGN 84 )                /* Value too large to be stored in data type */
147

    
148
/* Wide/multibyte-character handling, ISO/IEC 9899/AMD1:1995 */
149
#define        EILSEQ                (_SIGN 85 )                /* Illegal byte sequence */
150

    
151
/* From IEEE Std 1003.1-2001 */
152
/* Base, Realtime, Threads or Thread Priority Scheduling option errors */
153
#define ENOTSUP                (_SIGN 86 )                /* Not supported */
154

    
155
/* Realtime option errors */
156
#define ECANCELED        (_SIGN 87 )                /* Operation canceled */
157

    
158
/* Realtime, XSI STREAMS option errors */
159
#define EBADMSG                (_SIGN 88 )                /* Bad or Corrupt message */
160

    
161
/* XSI STREAMS option errors  */
162
#define ENODATA                (_SIGN 89 )                /* No message available */
163
#define ENOSR                (_SIGN 90 )                /* No STREAM resources */
164
#define ENOSTR                (_SIGN 91 )                /* Not a STREAM */
165
#define ETIME                (_SIGN 92 )                /* STREAM ioctl timeout */
166

    
167
/* File system extended attribute errors */
168
#define        ENOATTR                (_SIGN 93 )                /* Attribute not found */
169

    
170
/* Realtime, XSI STREAMS option errors */
171
#define        EMULTIHOP        (_SIGN 94 )                /* Multihop attempted */ 
172
#define        ENOLINK                (_SIGN 95 )                /* Link has been severed */
173
#define        EPROTO                (_SIGN 96 )                /* Protocol error */
174

    
175
#define        ELAST                (_SIGN 96 )                /* Must equal largest errno */
176

    
177
#if defined(_KERNEL) || defined(_KMEMUSER)
178
/* pseudo-errors returned inside kernel to modify return to process */
179
#define        EJUSTRETURN        -2                /* don't modify regs, just return */
180
#define        ERESTART        -3                /* restart syscall */
181
#define        EPASSTHROUGH        -4                /* ioctl not handled by this layer */
182
#define        EDUPFD                -5                /* Dup given fd */
183
#define        EMOVEFD                -6                /* Move given fd */
184
#endif
185

    
186
#if defined(__minix)
187
/* Now define _SIGN as "" or "-" depending on _SYSTEM. */
188
#ifdef _SYSTEM
189
#   define _SIGN         -
190
#   define OK            0
191
#else
192
#   define _SIGN         
193
#endif
194

    
195
/* minix-specific error codes */
196
#define ERESTART     (_SIGN 200 )  /* service restarted */
197
#define ENOTREADY    (_SIGN 201 )  /* source or destination is not ready */
198
#define EDEADSRCDST  (_SIGN 202 )  /* source or destination is not alive */
199
#define EDONTREPLY   (_SIGN 203 )  /* pseudo-code: don't send a reply */
200
#define EGENERIC     (_SIGN 204 )  /* generic error */
201
#define EPACKSIZE    (_SIGN 205 )  /* invalid packet size for some protocol */
202
#define EURG         (_SIGN 206 )  /* urgent data present */
203
#define ENOURG       (_SIGN 207 )  /* no urgent data present */
204
#define ELOCKED      (_SIGN 208 )  /* can't send message due to deadlock */
205
#define EBADCALL     (_SIGN 209 )  /* illegal system call number */
206
#define ECALLDENIED  (_SIGN 210 )  /* no permission for system call */
207
#define ETRAPDENIED  (_SIGN 211 )  /* IPC trap not allowed */
208
#define EBADREQUEST  (_SIGN 212 )  /* destination cannot handle request */
209
#define EBADMODE     (_SIGN 213 )  /* badmode in ioctl */
210
#define ENOCONN      (_SIGN 214 )  /* no such connection */
211
#define EDEADEPT     (_SIGN 215 )  /* specified endpoint is not alive */
212
#define EBADEPT      (_SIGN 216 )  /* specified endpoint is bad */
213
#define EBADCPU      (_SIGN 217 )  /* requested CPU does not work */
214

    
215
#endif /* defined(__minix) */
216

    
217
#endif /* !_SYS_ERRNO_H_ */