1199767fToomas Soome/*-
2199767fToomas Soome * Copyright (c) 1982, 1986, 1989, 1993
3199767fToomas Soome *	The Regents of the University of California.  All rights reserved.
4199767fToomas Soome * (c) UNIX System Laboratories, Inc.
5199767fToomas Soome * All or some portions of this file are derived from material licensed
6199767fToomas Soome * to the University of California by American Telephone and Telegraph
7199767fToomas Soome * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8199767fToomas Soome * the permission of UNIX System Laboratories, Inc.
9199767fToomas Soome *
10199767fToomas Soome * Redistribution and use in source and binary forms, with or without
11199767fToomas Soome * modification, are permitted provided that the following conditions
12199767fToomas Soome * are met:
13199767fToomas Soome * 1. Redistributions of source code must retain the above copyright
14199767fToomas Soome *    notice, this list of conditions and the following disclaimer.
15199767fToomas Soome * 2. Redistributions in binary form must reproduce the above copyright
16199767fToomas Soome *    notice, this list of conditions and the following disclaimer in the
17199767fToomas Soome *    documentation and/or other materials provided with the distribution.
18199767fToomas Soome * 4. Neither the name of the University nor the names of its contributors
19199767fToomas Soome *    may be used to endorse or promote products derived from this software
20199767fToomas Soome *    without specific prior written permission.
21199767fToomas Soome *
22199767fToomas Soome * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23199767fToomas Soome * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24199767fToomas Soome * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25199767fToomas Soome * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26199767fToomas Soome * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27199767fToomas Soome * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28199767fToomas Soome * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29199767fToomas Soome * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30199767fToomas Soome * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31199767fToomas Soome * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32199767fToomas Soome * SUCH DAMAGE.
33199767fToomas Soome *
34199767fToomas Soome *	@(#)errno.h	8.5 (Berkeley) 1/21/94
35199767fToomas Soome * $FreeBSD$
36199767fToomas Soome */
37199767fToomas Soome
38199767fToomas Soome#ifndef _SYS_ERRNO_H_
39199767fToomas Soome#define _SYS_ERRNO_H_
40199767fToomas Soome
4168d7704Toomas Soome#if !defined(_KERNEL) && !defined(_STANDALONE)
42199767fToomas Soome#include <sys/cdefs.h>
43199767fToomas Soome__BEGIN_DECLS
44199767fToomas Soomeint *	__error(void);
45199767fToomas Soome__END_DECLS
46199767fToomas Soome#define	errno		(* __error())
47199767fToomas Soome#endif
48199767fToomas Soome
49199767fToomas Soome#define	EPERM		1		/* Operation not permitted */
50199767fToomas Soome#define	ENOENT		2		/* No such file or directory */
51199767fToomas Soome#define	ESRCH		3		/* No such process */
52199767fToomas Soome#define	EINTR		4		/* Interrupted system call */
53199767fToomas Soome#define	EIO		5		/* Input/output error */
54199767fToomas Soome#define	ENXIO		6		/* Device not configured */
55199767fToomas Soome#define	E2BIG		7		/* Argument list too long */
56199767fToomas Soome#define	ENOEXEC		8		/* Exec format error */
57199767fToomas Soome#define	EBADF		9		/* Bad file descriptor */
58199767fToomas Soome#define	ECHILD		10		/* No child processes */
59199767fToomas Soome#define	EDEADLK		11		/* Resource deadlock avoided */
60199767fToomas Soome					/* 11 was EAGAIN */
61199767fToomas Soome#define	ENOMEM		12		/* Cannot allocate memory */
62199767fToomas Soome#define	EACCES		13		/* Permission denied */
63199767fToomas Soome#define	EFAULT		14		/* Bad address */
64199767fToomas Soome#ifndef _POSIX_SOURCE
65199767fToomas Soome#define	ENOTBLK		15		/* Block device required */
66199767fToomas Soome#endif
67199767fToomas Soome#define	EBUSY		16		/* Device busy */
68199767fToomas Soome#define	EEXIST		17		/* File exists */
69199767fToomas Soome#define	EXDEV		18		/* Cross-device link */
70199767fToomas Soome#define	ENODEV		19		/* Operation not supported by device */
71199767fToomas Soome#define	ENOTDIR		20		/* Not a directory */
72199767fToomas Soome#define	EISDIR		21		/* Is a directory */
73199767fToomas Soome#define	EINVAL		22		/* Invalid argument */
74199767fToomas Soome#define	ENFILE		23		/* Too many open files in system */
75199767fToomas Soome#define	EMFILE		24		/* Too many open files */
76199767fToomas Soome#define	ENOTTY		25		/* Inappropriate ioctl for device */
77199767fToomas Soome#ifndef _POSIX_SOURCE
78199767fToomas Soome#define	ETXTBSY		26		/* Text file busy */
79199767fToomas Soome#endif
80199767fToomas Soome#define	EFBIG		27		/* File too large */
81199767fToomas Soome#define	ENOSPC		28		/* No space left on device */
82199767fToomas Soome#define	ESPIPE		29		/* Illegal seek */
83199767fToomas Soome#define	EROFS		30		/* Read-only filesystem */
84199767fToomas Soome#define	EMLINK		31		/* Too many links */
85199767fToomas Soome#define	EPIPE		32		/* Broken pipe */
86199767fToomas Soome
87199767fToomas Soome/* math software */
88199767fToomas Soome#define	EDOM		33		/* Numerical argument out of domain */
89199767fToomas Soome#define	ERANGE		34		/* Result too large */
90199767fToomas Soome
91199767fToomas Soome/* non-blocking and interrupt i/o */
92199767fToomas Soome#define	EAGAIN		35		/* Resource temporarily unavailable */
93199767fToomas Soome#ifndef _POSIX_SOURCE
94199767fToomas Soome#define	EWOULDBLOCK	EAGAIN		/* Operation would block */
95199767fToomas Soome#define	EINPROGRESS	36		/* Operation now in progress */
96199767fToomas Soome#define	EALREADY	37		/* Operation already in progress */
97199767fToomas Soome
98199767fToomas Soome/* ipc/network software -- argument errors */
99199767fToomas Soome#define	ENOTSOCK	38		/* Socket operation on non-socket */
100199767fToomas Soome#define	EDESTADDRREQ	39		/* Destination address required */
101199767fToomas Soome#define	EMSGSIZE	40		/* Message too long */
102199767fToomas Soome#define	EPROTOTYPE	41		/* Protocol wrong type for socket */
103199767fToomas Soome#define	ENOPROTOOPT	42		/* Protocol not available */
104199767fToomas Soome#define	EPROTONOSUPPORT	43		/* Protocol not supported */
105199767fToomas Soome#define	ESOCKTNOSUPPORT	44		/* Socket type not supported */
106199767fToomas Soome#define	EOPNOTSUPP	45		/* Operation not supported */
107199767fToomas Soome#define	ENOTSUP		EOPNOTSUPP	/* Operation not supported */
108199767fToomas Soome#define	EPFNOSUPPORT	46		/* Protocol family not supported */
109199767fToomas Soome#define	EAFNOSUPPORT	47		/* Address family not supported by protocol family */
110199767fToomas Soome#define	EADDRINUSE	48		/* Address already in use */
111199767fToomas Soome#define	EADDRNOTAVAIL	49		/* Can't assign requested address */
112199767fToomas Soome
113199767fToomas Soome/* ipc/network software -- operational errors */
114199767fToomas Soome#define	ENETDOWN	50		/* Network is down */
115199767fToomas Soome#define	ENETUNREACH	51		/* Network is unreachable */
116199767fToomas Soome#define	ENETRESET	52		/* Network dropped connection on reset */
117199767fToomas Soome#define	ECONNABORTED	53		/* Software caused connection abort */
118199767fToomas Soome#define	ECONNRESET	54		/* Connection reset by peer */
119199767fToomas Soome#define	ENOBUFS		55		/* No buffer space available */
120199767fToomas Soome#define	EISCONN		56		/* Socket is already connected */
121199767fToomas Soome#define	ENOTCONN	57		/* Socket is not connected */
122199767fToomas Soome#define	ESHUTDOWN	58		/* Can't send after socket shutdown */
123199767fToomas Soome#define	ETOOMANYREFS	59		/* Too many references: can't splice */
124199767fToomas Soome#define	ETIMEDOUT	60		/* Operation timed out */
125199767fToomas Soome#define	ECONNREFUSED	61		/* Connection refused */
126199767fToomas Soome
127199767fToomas Soome#define	ELOOP		62		/* Too many levels of symbolic links */
128199767fToomas Soome#endif /* _POSIX_SOURCE */
129199767fToomas Soome#define	ENAMETOOLONG	63		/* File name too long */
130199767fToomas Soome
131199767fToomas Soome/* should be rearranged */
132199767fToomas Soome#ifndef _POSIX_SOURCE
133199767fToomas Soome#define	EHOSTDOWN	64		/* Host is down */
134199767fToomas Soome#define	EHOSTUNREACH	65		/* No route to host */
135199767fToomas Soome#endif /* _POSIX_SOURCE */
136199767fToomas Soome#define	ENOTEMPTY	66		/* Directory not empty */
137199767fToomas Soome
138199767fToomas Soome/* quotas & mush */
139199767fToomas Soome#ifndef _POSIX_SOURCE
140199767fToomas Soome#define	EPROCLIM	67		/* Too many processes */
141199767fToomas Soome#define	EUSERS		68		/* Too many users */
142199767fToomas Soome#define	EDQUOT		69		/* Disc quota exceeded */
143199767fToomas Soome
144199767fToomas Soome/* Network File System */
145199767fToomas Soome#define	ESTALE		70		/* Stale NFS file handle */
146199767fToomas Soome#define	EREMOTE		71		/* Too many levels of remote in path */
147199767fToomas Soome#define	EBADRPC		72		/* RPC struct is bad */
148199767fToomas Soome#define	ERPCMISMATCH	73		/* RPC version wrong */
149199767fToomas Soome#define	EPROGUNAVAIL	74		/* RPC prog. not avail */
150199767fToomas Soome#define	EPROGMISMATCH	75		/* Program version wrong */
151199767fToomas Soome#define	EPROCUNAVAIL	76		/* Bad procedure for program */
152199767fToomas Soome#endif /* _POSIX_SOURCE */
153199767fToomas Soome
154199767fToomas Soome#define	ENOLCK		77		/* No locks available */
155199767fToomas Soome#define	ENOSYS		78		/* Function not implemented */
156199767fToomas Soome
157199767fToomas Soome#ifndef _POSIX_SOURCE
158199767fToomas Soome#define	EFTYPE		79		/* Inappropriate file type or format */
159199767fToomas Soome#define	EAUTH		80		/* Authentication error */
160199767fToomas Soome#define	ENEEDAUTH	81		/* Need authenticator */
161199767fToomas Soome#define	EIDRM		82		/* Identifier removed */
162199767fToomas Soome#define	ENOMSG		83		/* No message of desired type */
163199767fToomas Soome#define	EOVERFLOW	84		/* Value too large to be stored in data type */
164199767fToomas Soome#define	ECANCELED	85		/* Operation canceled */
165199767fToomas Soome#define	EILSEQ		86		/* Illegal byte sequence */
166199767fToomas Soome#define	ENOATTR		87		/* Attribute not found */
167199767fToomas Soome
168199767fToomas Soome#define	EDOOFUS		88		/* Programming error */
169199767fToomas Soome#endif /* _POSIX_SOURCE */
170199767fToomas Soome
171199767fToomas Soome#define	EBADMSG		89		/* Bad message */
172199767fToomas Soome#define	EMULTIHOP	90		/* Multihop attempted */
173199767fToomas Soome#define	ENOLINK		91		/* Link has been severed */
174199767fToomas Soome#define	EPROTO		92		/* Protocol error */
175199767fToomas Soome
176199767fToomas Soome#ifndef _POSIX_SOURCE
177199767fToomas Soome#define	ENOTCAPABLE	93		/* Capabilities insufficient */
178199767fToomas Soome#define	ECAPMODE	94		/* Not permitted in capability mode */
179199767fToomas Soome#define	ENOTRECOVERABLE	95		/* State not recoverable */
180199767fToomas Soome#define	EOWNERDEAD	96		/* Previous owner died */
181199767fToomas Soome#endif /* _POSIX_SOURCE */
182199767fToomas Soome
183199767fToomas Soome#ifndef _POSIX_SOURCE
184199767fToomas Soome#define	ELAST		96		/* Must be equal largest errno */
185199767fToomas Soome#endif /* _POSIX_SOURCE */
186199767fToomas Soome
187199767fToomas Soome#ifdef _KERNEL
188199767fToomas Soome/* pseudo-errors returned inside kernel to modify return to process */
189199767fToomas Soome#define	ERESTART	(-1)		/* restart syscall */
190199767fToomas Soome#define	EJUSTRETURN	(-2)		/* don't modify regs, just return */
191199767fToomas Soome#define	ENOIOCTL	(-3)		/* ioctl not handled by this layer */
192199767fToomas Soome#define	EDIRIOCTL	(-4)		/* do direct ioctl in GEOM */
193199767fToomas Soome#endif
194199767fToomas Soome
195199767fToomas Soome#endif
196