Skip to content

Commit eede0c8

Browse files
committed
Add a FreeRTOS_errno.h header.
This header defines errno values used by FreeRTOS+TCP. This used to be called `FreeRTOS_errno_TCP.h` and part of the FreeRTOS+TCP tree, until it was removed because integrated in the FreeRTOS core, which we do not use. We therefore re-introduce it here in the compatibility layer. Signed-off-by: Hugo Lefeuvre <[email protected]>
1 parent 83b39b4 commit eede0c8

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
// Copyright SCI Semiconductor and CHERIoT Contributors.
2+
// SPDX-License-Identifier: MIT
3+
4+
#pragma once
5+
6+
/**
7+
* This header defines errno values used by FreeRTOS+TCP.
8+
*
9+
* In the FreeRTOS core tree, this is included in `projdefs.h`.
10+
*
11+
* TODO It would be nice to modify this to link to CHERIoT's own errno codes.
12+
*/
13+
14+
#define pdFREERTOS_ERRNO_NONE 0 /* No errors */
15+
#define pdFREERTOS_ERRNO_ENOENT 2 /* No such file or directory */
16+
#define pdFREERTOS_ERRNO_EINTR 4 /* Interrupted system call */
17+
#define pdFREERTOS_ERRNO_EIO 5 /* I/O error */
18+
#define pdFREERTOS_ERRNO_ENXIO 6 /* No such device or address */
19+
#define pdFREERTOS_ERRNO_EBADF 9 /* Bad file number */
20+
#define pdFREERTOS_ERRNO_EAGAIN 11 /* No more processes */
21+
#define pdFREERTOS_ERRNO_EWOULDBLOCK 11 /* Operation would block */
22+
#define pdFREERTOS_ERRNO_ENOMEM 12 /* Not enough memory */
23+
#define pdFREERTOS_ERRNO_EACCES 13 /* Permission denied */
24+
#define pdFREERTOS_ERRNO_EFAULT 14 /* Bad address */
25+
#define pdFREERTOS_ERRNO_EBUSY 16 /* Mount device busy */
26+
#define pdFREERTOS_ERRNO_EEXIST 17 /* File exists */
27+
#define pdFREERTOS_ERRNO_EXDEV 18 /* Cross-device link */
28+
#define pdFREERTOS_ERRNO_ENODEV 19 /* No such device */
29+
#define pdFREERTOS_ERRNO_ENOTDIR 20 /* Not a directory */
30+
#define pdFREERTOS_ERRNO_EISDIR 21 /* Is a directory */
31+
#define pdFREERTOS_ERRNO_EINVAL 22 /* Invalid argument */
32+
#define pdFREERTOS_ERRNO_ENOSPC 28 /* No space left on device */
33+
#define pdFREERTOS_ERRNO_ESPIPE 29 /* Illegal seek */
34+
#define pdFREERTOS_ERRNO_EROFS 30 /* Read only file system */
35+
#define pdFREERTOS_ERRNO_EUNATCH 42 /* Protocol driver not attached */
36+
#define pdFREERTOS_ERRNO_EBADE 50 /* Invalid exchange */
37+
#define pdFREERTOS_ERRNO_EFTYPE 79 /* Inappropriate file type or format */
38+
#define pdFREERTOS_ERRNO_ENMFILE 89 /* No more files */
39+
#define pdFREERTOS_ERRNO_ENOTEMPTY 90 /* Directory not empty */
40+
#define pdFREERTOS_ERRNO_ENAMETOOLONG 91 /* File or path name too long */
41+
#define pdFREERTOS_ERRNO_EOPNOTSUPP 95 /* Operation not supported on transport endpoint */
42+
#define pdFREERTOS_ERRNO_EAFNOSUPPORT 97 /* Address family not supported by protocol */
43+
#define pdFREERTOS_ERRNO_ENOBUFS 105 /* No buffer space available */
44+
#define pdFREERTOS_ERRNO_ENOPROTOOPT 109 /* Protocol not available */
45+
#define pdFREERTOS_ERRNO_EADDRINUSE 112 /* Address already in use */
46+
#define pdFREERTOS_ERRNO_ETIMEDOUT 116 /* Connection timed out */
47+
#define pdFREERTOS_ERRNO_EINPROGRESS 119 /* Connection already in progress */
48+
#define pdFREERTOS_ERRNO_EALREADY 120 /* Socket already connected */
49+
#define pdFREERTOS_ERRNO_EADDRNOTAVAIL 125 /* Address not available */
50+
#define pdFREERTOS_ERRNO_EISCONN 127 /* Socket is already connected */
51+
#define pdFREERTOS_ERRNO_ENOTCONN 128 /* Socket is not connected */
52+
#define pdFREERTOS_ERRNO_ENOMEDIUM 135 /* No medium inserted */
53+
#define pdFREERTOS_ERRNO_EILSEQ 138 /* An invalid UTF-16 sequence was encountered. */
54+
#define pdFREERTOS_ERRNO_ECANCELED 140 /* Operation canceled. */

0 commit comments

Comments
 (0)