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