|
| 1 | +// Copyright SCI Semiconductor and CHERIoT Contributors. |
| 2 | +// SPDX-License-Identifier: MIT |
| 3 | + |
| 4 | +#pragma once |
| 5 | + |
| 6 | +#include <errno.h> |
| 7 | + |
| 8 | +/** |
| 9 | + * This header defines errno values used by FreeRTOS+TCP. |
| 10 | + * |
| 11 | + * In the FreeRTOS core tree, this is included in `projdefs.h`. |
| 12 | + * |
| 13 | + * We modified it here to use the same errno codes are the CHERIoT core when |
| 14 | + * possible. |
| 15 | + */ |
| 16 | + |
| 17 | +#define pdFREERTOS_ERRNO_NONE 0 // No errors |
| 18 | +#define pdFREERTOS_ERRNO_ENOENT ENOENT // No such file or directory |
| 19 | +#define pdFREERTOS_ERRNO_EINTR EINTR // Interrupted system call |
| 20 | +#define pdFREERTOS_ERRNO_EIO EIO // I/O error |
| 21 | +#define pdFREERTOS_ERRNO_ENXIO ENXIO // No such device or address |
| 22 | +#define pdFREERTOS_ERRNO_EBADF EBADF // Bad file number |
| 23 | +#define pdFREERTOS_ERRNO_EAGAIN EAGAIN // No more processes |
| 24 | +#define pdFREERTOS_ERRNO_EWOULDBLOCK EWOULDBLOCK // Operation would block |
| 25 | +#define pdFREERTOS_ERRNO_ENOMEM ENOMEM // Not enough memory |
| 26 | +#define pdFREERTOS_ERRNO_EACCES EACCES // Permission denied |
| 27 | +#define pdFREERTOS_ERRNO_EFAULT EFAULT // Bad address |
| 28 | +#define pdFREERTOS_ERRNO_EBUSY EBUSY // Mount device busy |
| 29 | +#define pdFREERTOS_ERRNO_EEXIST EEXIST // File exists |
| 30 | +#define pdFREERTOS_ERRNO_EXDEV EXDEV // Cross-device link |
| 31 | +#define pdFREERTOS_ERRNO_ENODEV ENODEV // No such device |
| 32 | +#define pdFREERTOS_ERRNO_ENOTDIR ENOTDIR // Not a directory |
| 33 | +#define pdFREERTOS_ERRNO_EISDIR EISDIR // Is a directory |
| 34 | +#define pdFREERTOS_ERRNO_EINVAL EINVAL // Invalid argument |
| 35 | +#define pdFREERTOS_ERRNO_ENOSPC ENOSPC // No space left on device |
| 36 | +#define pdFREERTOS_ERRNO_ESPIPE ESPIPE // Illegal seek |
| 37 | +#define pdFREERTOS_ERRNO_EROFS EROFS // Read only file system |
| 38 | +#define pdFREERTOS_ERRNO_EUNATCH EUNATCH // Protocol driver not attached |
| 39 | +#define pdFREERTOS_ERRNO_EBADE EBADE // Invalid exchange |
| 40 | +#define pdFREERTOS_ERRNO_EFTYPE EFTYPE // Inappropriate file type or format |
| 41 | +#define pdFREERTOS_ERRNO_ENOTEMPTY ENOTEMPTY // Directory not empty |
| 42 | +#define pdFREERTOS_ERRNO_ENAMETOOLONG ENAMETOOLONG // File or path name too long |
| 43 | +#define pdFREERTOS_ERRNO_EOPNOTSUPP EOPNOTSUPP // Operation not supported on transport endpoint |
| 44 | +#define pdFREERTOS_ERRNO_EAFNOSUPPORT EAFNOSUPPORT // Address family not supported by protocol |
| 45 | +#define pdFREERTOS_ERRNO_ENOBUFS ENOBUFS // No buffer space available |
| 46 | +#define pdFREERTOS_ERRNO_ENOPROTOOPT ENOPROTOOPT // Protocol not available |
| 47 | +#define pdFREERTOS_ERRNO_EADDRINUSE EADDRINUSE // Address already in use |
| 48 | +#define pdFREERTOS_ERRNO_ETIMEDOUT ETIMEDOUT // Connection timed out |
| 49 | +#define pdFREERTOS_ERRNO_EINPROGRESS EINPROGRESS // Connection already in progress |
| 50 | +#define pdFREERTOS_ERRNO_EALREADY EALREADY // Socket already connected |
| 51 | +#define pdFREERTOS_ERRNO_EADDRNOTAVAIL EADDRNOTAVAIL // Address not available |
| 52 | +#define pdFREERTOS_ERRNO_EISCONN EISCONN // Socket is already connected |
| 53 | +#define pdFREERTOS_ERRNO_ENOTCONN ENOTCONN // Socket is not connected |
| 54 | +#define pdFREERTOS_ERRNO_ENOMEDIUM ENOMEDIUM // No medium inserted |
| 55 | +#define pdFREERTOS_ERRNO_EILSEQ EILSEQ // An invalid UTF-16 sequence was encountered |
| 56 | +#define pdFREERTOS_ERRNO_ECANCELED ECANCELED // Operation canceled |
| 57 | + |
| 58 | +/** |
| 59 | + * These errno codes are non-standard, assign them a code outside our errno |
| 60 | + * range. |
| 61 | + */ |
| 62 | + |
| 63 | +#define pdFREERTOS_ERRNO_ENMFILE (__ELASTERROR + 1) // No more files |
0 commit comments