1 /*-
2  * Copyright (c) 2020 STMicroelectronics. All rights reserved.
3  *
4  * Copyright (c) 1982, 1986, 1989, 1993
5  *	The Regents of the University of California.  All rights reserved.
6  * (c) UNIX System Laboratories, Inc.
7  * Copyright 2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
8  *
9  * SPDX-License-Identifier: BSD-3-Clause
10  */
11 
12 #ifndef __METAL_ARMCC_ERRNO__H__
13 #define __METAL_ARMCC_ERRNO__H__
14 
15 #include <errno.h>
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 #define LIBMETAL_ERR_BASE  100
22 
23 #ifndef EPERM
24 #define	EPERM	(LIBMETAL_ERR_BASE + 1)  /* Operation not permitted */
25 #endif
26 
27 #ifndef ENOENT
28 #define	ENOENT	(LIBMETAL_ERR_BASE + 2)  /* No such file or directory */
29 #endif
30 
31 #ifndef ESRCH
32 #define	ESRCH	(LIBMETAL_ERR_BASE + 3)  /* No such process */
33 #endif
34 
35 #ifndef EINTR
36 #define	EINTR	(LIBMETAL_ERR_BASE + 4)  /* Interrupted system call */
37 #endif
38 
39 #ifndef EIO
40 #define	EIO	(LIBMETAL_ERR_BASE + 5)  /* Input/output error */
41 #endif
42 
43 #ifndef ENXIO
44 #define	ENXIO	(LIBMETAL_ERR_BASE + 6)  /* Device not configured */
45 #endif
46 
47 #ifndef E2BIG
48 #define	E2BIG	(LIBMETAL_ERR_BASE + 7)  /* Argument list too long */
49 #endif
50 
51 #ifndef ENOEXEC
52 #define	ENOEXEC	(LIBMETAL_ERR_BASE + 8)  /* Exec format error */
53 #endif
54 
55 #ifndef EBADF
56 #define	EBADF	(LIBMETAL_ERR_BASE + 9)  /* Bad file descriptor */
57 #endif
58 
59 #ifndef ECHILD
60 #define	ECHILD	(LIBMETAL_ERR_BASE + 10) /* No child processes */
61 #endif
62 
63 #ifndef EDEADLK
64 #define	EDEADLK	(LIBMETAL_ERR_BASE + 11) /* Resource deadlock avoided */
65 #endif
66 
67 #ifndef EACCES
68 #define	EACCES	(LIBMETAL_ERR_BASE + 13) /* Permission denied */
69 #endif
70 
71 #ifndef EFAULT
72 #define	EFAULT	(LIBMETAL_ERR_BASE + 14) /* Bad address */
73 #endif
74 
75 #ifndef ENOTBLK
76 #define	ENOTBLK	(LIBMETAL_ERR_BASE + 15) /* Block device required */
77 #endif
78 
79 #ifndef EBUSY
80 #define	EBUSY	(LIBMETAL_ERR_BASE + 16) /* Device busy */
81 #endif
82 
83 #ifndef EEXIST
84 #define	EEXIST	(LIBMETAL_ERR_BASE + 17) /* File exists */
85 #endif
86 
87 #ifndef EXDEV
88 #define	EXDEV	(LIBMETAL_ERR_BASE + 18) /* Cross-device link */
89 #endif
90 
91 #ifndef ENODEV
92 #define	ENODEV	(LIBMETAL_ERR_BASE + 19) /* Operation not supported by device */
93 #endif
94 
95 #ifndef ENOTDIR
96 #define	ENOTDIR	(LIBMETAL_ERR_BASE + 20) /* Not a directory */
97 #endif
98 
99 #ifndef EISDIR
100 #define	EISDIR	(LIBMETAL_ERR_BASE + 21) /* Is a directory */
101 #endif
102 
103 #ifndef ENFILE
104 #define	ENFILE	(LIBMETAL_ERR_BASE + 23) /* Too many open files in system */
105 #endif
106 
107 #ifndef EMFILE
108 #define	EMFILE	(LIBMETAL_ERR_BASE + 24) /* Too many open files */
109 #endif
110 
111 #ifndef ENOTTY
112 #define	ENOTTY	(LIBMETAL_ERR_BASE + 25) /* Inappropriate ioctl for device */
113 #endif
114 
115 #ifndef ETXTBSY
116 #define	ETXTBSY	(LIBMETAL_ERR_BASE + 26) /* Text file busy */
117 #endif
118 
119 #ifndef EFBIG
120 #define	EFBIG	(LIBMETAL_ERR_BASE + 27) /* File too large */
121 #endif
122 
123 #ifndef ENOSPC
124 #define	ENOSPC	(LIBMETAL_ERR_BASE + 28) /* No space left on device */
125 #endif
126 
127 #ifndef ESPIPE
128 #define	ESPIPE	(LIBMETAL_ERR_BASE + 29) /* Illegal seek */
129 #endif
130 
131 #ifndef EROFS
132 #define	EROFS	(LIBMETAL_ERR_BASE + 30) /* Read-only filesystem */
133 #endif
134 
135 #ifndef EMLINK
136 #define	EMLINK	(LIBMETAL_ERR_BASE + 31) /* Too many links */
137 #endif
138 
139 #ifndef EPIPE
140 #define	EPIPE	(LIBMETAL_ERR_BASE + 32) /* Broken pipe */
141 #endif
142 
143 #ifndef EAGAIN
144 #define	EAGAIN	(LIBMETAL_ERR_BASE + 35) /* Resource temporarily unavailable */
145 #endif
146 
147 #ifdef __cplusplus
148 }
149 #endif
150 
151 #endif /* __METAL_ARMCC_ERRNO__H__ */
152