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