1 /*
2  * Copyright (c) 1984-1999, 2012 Wind River Systems, Inc.
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 /*
8  * Copyright (c) 1982, 1986 Regents of the University of California.
9  * All rights reserved.  The Berkeley software License Agreement
10  * specifies the terms and conditions for redistribution.
11  *
12  *	@(#)errno.h	7.1 (Berkeley) 6/4/86
13  */
14 
15 /**
16  * @file
17  * @brief System error numbers
18  */
19 
20 #ifndef ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_ERRNO_H_
21 #define ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_ERRNO_H_
22 
23 /**
24  * @brief System error numbers
25  *        Error codes returned by functions.
26  *        Includes a list of those defined by IEEE Std 1003.1-2017.
27  * @defgroup system_errno Error numbers
28  * @{
29  */
30 
31 #include <zephyr/sys/errno_private.h>
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 #define errno (*z_errno())
38 
39 #define EPERM 1         /**< Not owner */
40 #define ENOENT 2        /**< No such file or directory */
41 #define ESRCH 3         /**< No such context */
42 #define EINTR 4         /**< Interrupted system call */
43 #define EIO 5           /**< I/O error */
44 #define ENXIO 6         /**< No such device or address */
45 #define E2BIG 7         /**< Arg list too long */
46 #define ENOEXEC 8       /**< Exec format error */
47 #define EBADF 9         /**< Bad file number */
48 #define ECHILD 10       /**< No children */
49 #define EAGAIN 11       /**< No more contexts */
50 #define ENOMEM 12       /**< Not enough core */
51 #define EACCES 13       /**< Permission denied */
52 #define EFAULT 14       /**< Bad address */
53 #define ENOTBLK 15      /**< Block device required */
54 #define EBUSY 16        /**< Mount device busy */
55 #define EEXIST 17       /**< File exists */
56 #define EXDEV 18        /**< Cross-device link */
57 #define ENODEV 19       /**< No such device */
58 #define ENOTDIR 20      /**< Not a directory */
59 #define EISDIR 21       /**< Is a directory */
60 #define EINVAL 22       /**< Invalid argument */
61 #define ENFILE 23       /**< File table overflow */
62 #define EMFILE 24       /**< Too many open files */
63 #define ENOTTY 25       /**< Not a typewriter */
64 #define ETXTBSY 26      /**< Text file busy */
65 #define EFBIG 27        /**< File too large */
66 #define ENOSPC 28       /**< No space left on device */
67 #define ESPIPE 29       /**< Illegal seek */
68 #define EROFS 30        /**< Read-only file system */
69 #define EMLINK 31       /**< Too many links */
70 #define EPIPE 32        /**< Broken pipe */
71 #define EDOM 33         /**< Argument too large */
72 #define ERANGE 34       /**< Result too large */
73 #define ENOMSG 35       /**< Unexpected message type */
74 #define EDEADLK 45      /**< Resource deadlock avoided */
75 #define ENOLCK 46       /**< No locks available */
76 #define ENOSTR 60       /**< STREAMS device required */
77 #define ENODATA 61      /**< Missing expected message data */
78 #define ETIME 62        /**< STREAMS timeout occurred */
79 #define ENOSR 63        /**< Insufficient memory */
80 #define EPROTO 71       /**< Generic STREAMS error */
81 #define EBADMSG 77      /**< Invalid STREAMS message */
82 #define ENOSYS 88       /**< Function not implemented */
83 #define ENOTEMPTY 90    /**< Directory not empty */
84 #define ENAMETOOLONG 91 /**< File name too long */
85 #define ELOOP 92        /**< Too many levels of symbolic links */
86 #define EOPNOTSUPP 95   /**< Operation not supported on socket */
87 #define EPFNOSUPPORT 96 /**< Protocol family not supported */
88 #define ECONNRESET 104   /**< Connection reset by peer */
89 #define ENOBUFS 105      /**< No buffer space available */
90 #define EAFNOSUPPORT 106 /**< Addr family not supported */
91 #define EPROTOTYPE 107   /**< Protocol wrong type for socket */
92 #define ENOTSOCK 108     /**< Socket operation on non-socket */
93 #define ENOPROTOOPT 109  /**< Protocol not available */
94 #define ESHUTDOWN 110    /**< Can't send after socket shutdown */
95 #define ECONNREFUSED 111 /**< Connection refused */
96 #define EADDRINUSE 112   /**< Address already in use */
97 #define ECONNABORTED 113 /**< Software caused connection abort */
98 #define ENETUNREACH 114  /**< Network is unreachable */
99 #define ENETDOWN 115     /**< Network is down */
100 #define ETIMEDOUT 116    /**< Connection timed out */
101 #define EHOSTDOWN 117    /**< Host is down */
102 #define EHOSTUNREACH 118 /**< No route to host */
103 #define EINPROGRESS 119  /**< Operation now in progress */
104 #define EALREADY 120     /**< Operation already in progress */
105 #define EDESTADDRREQ 121 /**< Destination address required */
106 #define EMSGSIZE 122        /**< Message size */
107 #define EPROTONOSUPPORT 123 /**< Protocol not supported */
108 #define ESOCKTNOSUPPORT 124 /**< Socket type not supported */
109 #define EADDRNOTAVAIL 125   /**< Can't assign requested address */
110 #define ENETRESET 126       /**< Network dropped connection on reset */
111 #define EISCONN 127         /**< Socket is already connected */
112 #define ENOTCONN 128        /**< Socket is not connected */
113 #define ETOOMANYREFS 129    /**< Too many references: can't splice */
114 #define ENOTSUP 134         /**< Unsupported value */
115 #define EILSEQ 138          /**< Illegal byte sequence */
116 #define EOVERFLOW 139       /**< Value overflow */
117 #define ECANCELED 140       /**< Operation canceled */
118 
119 #define EWOULDBLOCK EAGAIN /**< Operation would block */
120 
121 /**
122  * @}
123  */
124 
125 #ifdef __cplusplus
126 }
127 #endif
128 
129 #endif /* ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_ERRNO_H_ */
130