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