xref: /original-bsd/sys/sys/errno.h (revision 60749750)
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  * %sccs.include.redist.c%
11  *
12  *	@(#)errno.h	8.5 (Berkeley) 01/21/94
13  */
14 
15 #ifndef KERNEL
16 extern int errno;			/* global error number */
17 #endif
18 
19 #define	EPERM		1		/* Operation not permitted */
20 #define	ENOENT		2		/* No such file or directory */
21 #define	ESRCH		3		/* No such process */
22 #define	EINTR		4		/* Interrupted system call */
23 #define	EIO		5		/* Input/output error */
24 #define	ENXIO		6		/* Device not configured */
25 #define	E2BIG		7		/* Argument list too long */
26 #define	ENOEXEC		8		/* Exec format error */
27 #define	EBADF		9		/* Bad file descriptor */
28 #define	ECHILD		10		/* No child processes */
29 #define	EDEADLK		11		/* Resource deadlock avoided */
30 					/* 11 was EAGAIN */
31 #define	ENOMEM		12		/* Cannot allocate memory */
32 #define	EACCES		13		/* Permission denied */
33 #define	EFAULT		14		/* Bad address */
34 #ifndef _POSIX_SOURCE
35 #define	ENOTBLK		15		/* Block device required */
36 #endif
37 #define	EBUSY		16		/* Device busy */
38 #define	EEXIST		17		/* File exists */
39 #define	EXDEV		18		/* Cross-device link */
40 #define	ENODEV		19		/* Operation not supported by device */
41 #define	ENOTDIR		20		/* Not a directory */
42 #define	EISDIR		21		/* Is a directory */
43 #define	EINVAL		22		/* Invalid argument */
44 #define	ENFILE		23		/* Too many open files in system */
45 #define	EMFILE		24		/* Too many open files */
46 #define	ENOTTY		25		/* Inappropriate ioctl for device */
47 #ifndef _POSIX_SOURCE
48 #define	ETXTBSY		26		/* Text file busy */
49 #endif
50 #define	EFBIG		27		/* File too large */
51 #define	ENOSPC		28		/* No space left on device */
52 #define	ESPIPE		29		/* Illegal seek */
53 #define	EROFS		30		/* Read-only file system */
54 #define	EMLINK		31		/* Too many links */
55 #define	EPIPE		32		/* Broken pipe */
56 
57 /* math software */
58 #define	EDOM		33		/* Numerical argument out of domain */
59 #define	ERANGE		34		/* Result too large */
60 
61 /* non-blocking and interrupt i/o */
62 #define	EAGAIN		35		/* Resource temporarily unavailable */
63 #ifndef _POSIX_SOURCE
64 #define	EWOULDBLOCK	EAGAIN		/* Operation would block */
65 #define	EINPROGRESS	36		/* Operation now in progress */
66 #define	EALREADY	37		/* Operation already in progress */
67 
68 /* ipc/network software -- argument errors */
69 #define	ENOTSOCK	38		/* Socket operation on non-socket */
70 #define	EDESTADDRREQ	39		/* Destination address required */
71 #define	EMSGSIZE	40		/* Message too long */
72 #define	EPROTOTYPE	41		/* Protocol wrong type for socket */
73 #define	ENOPROTOOPT	42		/* Protocol not available */
74 #define	EPROTONOSUPPORT	43		/* Protocol not supported */
75 #define	ESOCKTNOSUPPORT	44		/* Socket type not supported */
76 #define	EOPNOTSUPP	45		/* Operation not supported */
77 #define	EPFNOSUPPORT	46		/* Protocol family not supported */
78 #define	EAFNOSUPPORT	47		/* Address family not supported by protocol family */
79 #define	EADDRINUSE	48		/* Address already in use */
80 #define	EADDRNOTAVAIL	49		/* Can't assign requested address */
81 
82 /* ipc/network software -- operational errors */
83 #define	ENETDOWN	50		/* Network is down */
84 #define	ENETUNREACH	51		/* Network is unreachable */
85 #define	ENETRESET	52		/* Network dropped connection on reset */
86 #define	ECONNABORTED	53		/* Software caused connection abort */
87 #define	ECONNRESET	54		/* Connection reset by peer */
88 #define	ENOBUFS		55		/* No buffer space available */
89 #define	EISCONN		56		/* Socket is already connected */
90 #define	ENOTCONN	57		/* Socket is not connected */
91 #define	ESHUTDOWN	58		/* Can't send after socket shutdown */
92 #define	ETOOMANYREFS	59		/* Too many references: can't splice */
93 #define	ETIMEDOUT	60		/* Operation timed out */
94 #define	ECONNREFUSED	61		/* Connection refused */
95 
96 #define	ELOOP		62		/* Too many levels of symbolic links */
97 #endif /* _POSIX_SOURCE */
98 #define	ENAMETOOLONG	63		/* File name too long */
99 
100 /* should be rearranged */
101 #ifndef _POSIX_SOURCE
102 #define	EHOSTDOWN	64		/* Host is down */
103 #define	EHOSTUNREACH	65		/* No route to host */
104 #endif /* _POSIX_SOURCE */
105 #define	ENOTEMPTY	66		/* Directory not empty */
106 
107 /* quotas & mush */
108 #ifndef _POSIX_SOURCE
109 #define	EPROCLIM	67		/* Too many processes */
110 #define	EUSERS		68		/* Too many users */
111 #define	EDQUOT		69		/* Disc quota exceeded */
112 
113 /* Network File System */
114 #define	ESTALE		70		/* Stale NFS file handle */
115 #define	EREMOTE		71		/* Too many levels of remote in path */
116 #define	EBADRPC		72		/* RPC struct is bad */
117 #define	ERPCMISMATCH	73		/* RPC version wrong */
118 #define	EPROGUNAVAIL	74		/* RPC prog. not avail */
119 #define	EPROGMISMATCH	75		/* Program version wrong */
120 #define	EPROCUNAVAIL	76		/* Bad procedure for program */
121 #endif /* _POSIX_SOURCE */
122 
123 #define	ENOLCK		77		/* No locks available */
124 #define	ENOSYS		78		/* Function not implemented */
125 
126 #ifndef _POSIX_SOURCE
127 #define	EFTYPE		79		/* Inappropriate file type or format */
128 #define	EAUTH		80		/* Authentication error */
129 #define	ENEEDAUTH	81		/* Need authenticator */
130 #define	ELAST		81		/* Must be equal largest errno */
131 #endif /* _POSIX_SOURCE */
132 
133 #ifdef KERNEL
134 /* pseudo-errors returned inside kernel to modify return to process */
135 #define	ERESTART	-1		/* restart syscall */
136 #define	EJUSTRETURN	-2		/* don't modify regs, just return */
137 #endif
138