1f0bf889imp/*-
24736ccfpfg * SPDX-License-Identifier: BSD-3-Clause
34736ccfpfg *
48fb65cergrimes * Copyright (c) 1982, 1986, 1989, 1993
58fb65cergrimes *	The Regents of the University of California.  All rights reserved.
68fb65cergrimes * (c) UNIX System Laboratories, Inc.
78fb65cergrimes * All or some portions of this file are derived from material licensed
88fb65cergrimes * to the University of California by American Telephone and Telegraph
98fb65cergrimes * Co. or Unix System Laboratories, Inc. and are reproduced herein with
108fb65cergrimes * the permission of UNIX System Laboratories, Inc.
118fb65cergrimes *
128fb65cergrimes * Redistribution and use in source and binary forms, with or without
138fb65cergrimes * modification, are permitted provided that the following conditions
148fb65cergrimes * are met:
158fb65cergrimes * 1. Redistributions of source code must retain the above copyright
168fb65cergrimes *    notice, this list of conditions and the following disclaimer.
178fb65cergrimes * 2. Redistributions in binary form must reproduce the above copyright
188fb65cergrimes *    notice, this list of conditions and the following disclaimer in the
198fb65cergrimes *    documentation and/or other materials provided with the distribution.
207e6cabdimp * 3. Neither the name of the University nor the names of its contributors
218fb65cergrimes *    may be used to endorse or promote products derived from this software
228fb65cergrimes *    without specific prior written permission.
238fb65cergrimes *
248fb65cergrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
258fb65cergrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
268fb65cergrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
278fb65cergrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
288fb65cergrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
298fb65cergrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
308fb65cergrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
318fb65cergrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
328fb65cergrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
338fb65cergrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
348fb65cergrimes * SUCH DAMAGE.
358fb65cergrimes *
368fb65cergrimes *	@(#)errno.h	8.5 (Berkeley) 1/21/94
373b842d3peter * $FreeBSD$
388fb65cergrimes */
398fb65cergrimes
401f5dfa1paul#ifndef _SYS_ERRNO_H_
411f5dfa1paul#define _SYS_ERRNO_H_
421f5dfa1paul
43ff37b2bimp#if !defined(_KERNEL) && !defined(_STANDALONE)
441c4eb4apeter#include <sys/cdefs.h>
451c4eb4apeter__BEGIN_DECLS
463b2d03balfredint *	__error(void);
471c4eb4apeter__END_DECLS
48619b731julian#define	errno		(* __error())
49619b731julian#endif
508fb65cergrimes
518fb65cergrimes#define	EPERM		1		/* Operation not permitted */
528fb65cergrimes#define	ENOENT		2		/* No such file or directory */
538fb65cergrimes#define	ESRCH		3		/* No such process */
548fb65cergrimes#define	EINTR		4		/* Interrupted system call */
558fb65cergrimes#define	EIO		5		/* Input/output error */
568fb65cergrimes#define	ENXIO		6		/* Device not configured */
578fb65cergrimes#define	E2BIG		7		/* Argument list too long */
588fb65cergrimes#define	ENOEXEC		8		/* Exec format error */
598fb65cergrimes#define	EBADF		9		/* Bad file descriptor */
608fb65cergrimes#define	ECHILD		10		/* No child processes */
618fb65cergrimes#define	EDEADLK		11		/* Resource deadlock avoided */
628fb65cergrimes					/* 11 was EAGAIN */
638fb65cergrimes#define	ENOMEM		12		/* Cannot allocate memory */
648fb65cergrimes#define	EACCES		13		/* Permission denied */
658fb65cergrimes#define	EFAULT		14		/* Bad address */
668fb65cergrimes#ifndef _POSIX_SOURCE
678fb65cergrimes#define	ENOTBLK		15		/* Block device required */
688fb65cergrimes#endif
698fb65cergrimes#define	EBUSY		16		/* Device busy */
708fb65cergrimes#define	EEXIST		17		/* File exists */
718fb65cergrimes#define	EXDEV		18		/* Cross-device link */
728fb65cergrimes#define	ENODEV		19		/* Operation not supported by device */
738fb65cergrimes#define	ENOTDIR		20		/* Not a directory */
748fb65cergrimes#define	EISDIR		21		/* Is a directory */
758fb65cergrimes#define	EINVAL		22		/* Invalid argument */
768fb65cergrimes#define	ENFILE		23		/* Too many open files in system */
778fb65cergrimes#define	EMFILE		24		/* Too many open files */
788fb65cergrimes#define	ENOTTY		25		/* Inappropriate ioctl for device */
798fb65cergrimes#ifndef _POSIX_SOURCE
808fb65cergrimes#define	ETXTBSY		26		/* Text file busy */
818fb65cergrimes#endif
828fb65cergrimes#define	EFBIG		27		/* File too large */
838fb65cergrimes#define	ENOSPC		28		/* No space left on device */
848fb65cergrimes#define	ESPIPE		29		/* Illegal seek */
8528d4289trhodes#define	EROFS		30		/* Read-only filesystem */
868fb65cergrimes#define	EMLINK		31		/* Too many links */
878fb65cergrimes#define	EPIPE		32		/* Broken pipe */
888fb65cergrimes
898fb65cergrimes/* math software */
908fb65cergrimes#define	EDOM		33		/* Numerical argument out of domain */
918fb65cergrimes#define	ERANGE		34		/* Result too large */
928fb65cergrimes
938fb65cergrimes/* non-blocking and interrupt i/o */
948fb65cergrimes#define	EAGAIN		35		/* Resource temporarily unavailable */
958fb65cergrimes#ifndef _POSIX_SOURCE
968fb65cergrimes#define	EWOULDBLOCK	EAGAIN		/* Operation would block */
978fb65cergrimes#define	EINPROGRESS	36		/* Operation now in progress */
988fb65cergrimes#define	EALREADY	37		/* Operation already in progress */
998fb65cergrimes
1008fb65cergrimes/* ipc/network software -- argument errors */
1018fb65cergrimes#define	ENOTSOCK	38		/* Socket operation on non-socket */
1028fb65cergrimes#define	EDESTADDRREQ	39		/* Destination address required */
1038fb65cergrimes#define	EMSGSIZE	40		/* Message too long */
1048fb65cergrimes#define	EPROTOTYPE	41		/* Protocol wrong type for socket */
1058fb65cergrimes#define	ENOPROTOOPT	42		/* Protocol not available */
1068fb65cergrimes#define	EPROTONOSUPPORT	43		/* Protocol not supported */
1078fb65cergrimes#define	ESOCKTNOSUPPORT	44		/* Socket type not supported */
1088fb65cergrimes#define	EOPNOTSUPP	45		/* Operation not supported */
109c25aa48keramida#define	ENOTSUP		EOPNOTSUPP	/* Operation not supported */
1108fb65cergrimes#define	EPFNOSUPPORT	46		/* Protocol family not supported */
1118fb65cergrimes#define	EAFNOSUPPORT	47		/* Address family not supported by protocol family */
1128fb65cergrimes#define	EADDRINUSE	48		/* Address already in use */
1138fb65cergrimes#define	EADDRNOTAVAIL	49		/* Can't assign requested address */
1148fb65cergrimes
1158fb65cergrimes/* ipc/network software -- operational errors */
1168fb65cergrimes#define	ENETDOWN	50		/* Network is down */
1178fb65cergrimes#define	ENETUNREACH	51		/* Network is unreachable */
1188fb65cergrimes#define	ENETRESET	52		/* Network dropped connection on reset */
1198fb65cergrimes#define	ECONNABORTED	53		/* Software caused connection abort */
1208fb65cergrimes#define	ECONNRESET	54		/* Connection reset by peer */
1218fb65cergrimes#define	ENOBUFS		55		/* No buffer space available */
1228fb65cergrimes#define	EISCONN		56		/* Socket is already connected */
1238fb65cergrimes#define	ENOTCONN	57		/* Socket is not connected */
1248fb65cergrimes#define	ESHUTDOWN	58		/* Can't send after socket shutdown */
1258fb65cergrimes#define	ETOOMANYREFS	59		/* Too many references: can't splice */
1268fb65cergrimes#define	ETIMEDOUT	60		/* Operation timed out */
1278fb65cergrimes#define	ECONNREFUSED	61		/* Connection refused */
1288fb65cergrimes
1298fb65cergrimes#define	ELOOP		62		/* Too many levels of symbolic links */
1308fb65cergrimes#endif /* _POSIX_SOURCE */
1318fb65cergrimes#define	ENAMETOOLONG	63		/* File name too long */
1328fb65cergrimes
1338fb65cergrimes/* should be rearranged */
1348fb65cergrimes#ifndef _POSIX_SOURCE
1358fb65cergrimes#define	EHOSTDOWN	64		/* Host is down */
1368fb65cergrimes#define	EHOSTUNREACH	65		/* No route to host */
1378fb65cergrimes#endif /* _POSIX_SOURCE */
1388fb65cergrimes#define	ENOTEMPTY	66		/* Directory not empty */
1398fb65cergrimes
1408fb65cergrimes/* quotas & mush */
1418fb65cergrimes#ifndef _POSIX_SOURCE
1428fb65cergrimes#define	EPROCLIM	67		/* Too many processes */
1438fb65cergrimes#define	EUSERS		68		/* Too many users */
1448fb65cergrimes#define	EDQUOT		69		/* Disc quota exceeded */
1458fb65cergrimes
1468fb65cergrimes/* Network File System */
1478fb65cergrimes#define	ESTALE		70		/* Stale NFS file handle */
1488fb65cergrimes#define	EREMOTE		71		/* Too many levels of remote in path */
1498fb65cergrimes#define	EBADRPC		72		/* RPC struct is bad */
1508fb65cergrimes#define	ERPCMISMATCH	73		/* RPC version wrong */
1518fb65cergrimes#define	EPROGUNAVAIL	74		/* RPC prog. not avail */
1528fb65cergrimes#define	EPROGMISMATCH	75		/* Program version wrong */
1538fb65cergrimes#define	EPROCUNAVAIL	76		/* Bad procedure for program */
1548fb65cergrimes#endif /* _POSIX_SOURCE */
1558fb65cergrimes
1568fb65cergrimes#define	ENOLCK		77		/* No locks available */
1578fb65cergrimes#define	ENOSYS		78		/* Function not implemented */
1588fb65cergrimes
1598fb65cergrimes#ifndef _POSIX_SOURCE
1608fb65cergrimes#define	EFTYPE		79		/* Inappropriate file type or format */
1618fb65cergrimes#define	EAUTH		80		/* Authentication error */
1628fb65cergrimes#define	ENEEDAUTH	81		/* Need authenticator */
1637212f6adt#define	EIDRM		82		/* Identifier removed */
1647212f6adt#define	ENOMSG		83		/* No message of desired type */
1655bbdd11phk#define	EOVERFLOW	84		/* Value too large to be stored in data type */
1667212f6adt#define	ECANCELED	85		/* Operation canceled */
1677212f6adt#define	EILSEQ		86		/* Illegal byte sequence */
168965906fgreen#define	ENOATTR		87		/* Attribute not found */
169ffef759ache
170b354a8cavg#define	EDOOFUS		88		/* Programming error */
1711e73b68das#endif /* _POSIX_SOURCE */
172ade75a9phk
1731e73b68das#define	EBADMSG		89		/* Bad message */
1741e73b68das#define	EMULTIHOP	90		/* Multihop attempted */
1751e73b68das#define	ENOLINK		91		/* Link has been severed */
1761e73b68das#define	EPROTO		92		/* Protocol error */
17785c11ddphk
1781e73b68das#ifndef _POSIX_SOURCE
179466473brwatson#define	ENOTCAPABLE	93		/* Capabilities insufficient */
180b354a8cavg#define	ECAPMODE	94		/* Not permitted in capability mode */
181bf7b6b6pluknet#define	ENOTRECOVERABLE	95		/* State not recoverable */
182bf7b6b6pluknet#define	EOWNERDEAD	96		/* Previous owner died */
18372a21bamckusick#define	EINTEGRITY	97		/* Integrity check failed */
184466473brwatson#endif /* _POSIX_SOURCE */
185466473brwatson
186466473brwatson#ifndef _POSIX_SOURCE
18772a21bamckusick#define	ELAST		97		/* Must be equal largest errno */
1888fb65cergrimes#endif /* _POSIX_SOURCE */
1898fb65cergrimes
1901c4c9a5jhb#if defined(_KERNEL) || defined(_WANT_KERNEL_ERRNO)
1918fb65cergrimes/* pseudo-errors returned inside kernel to modify return to process */
1921a4a2c1bde#define	ERESTART	(-1)		/* restart syscall */
1931a4a2c1bde#define	EJUSTRETURN	(-2)		/* don't modify regs, just return */
1941a4a2c1bde#define	ENOIOCTL	(-3)		/* ioctl not handled by this layer */
19505568a1phk#define	EDIRIOCTL	(-4)		/* do direct ioctl in GEOM */
196faec271trasz#define	ERELOOKUP	(-5)		/* retry the directory lookup */
1978fb65cergrimes#endif
1981f5dfa1paul
199f6b29b3kib#ifndef _KERNEL
2004774ca6kib#if __EXT1_VISIBLE
2014774ca6kib/* ISO/IEC 9899:2011 K.3.2.2 */
2024774ca6kib#ifndef _ERRNO_T_DEFINED
2034774ca6kib#define _ERRNO_T_DEFINED
2044774ca6kibtypedef int errno_t;
2054774ca6kib#endif
2064774ca6kib#endif /* __EXT1_VISIBLE */
207f6b29b3kib#endif
2084774ca6kib
2091f5dfa1paul#endif
210