Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Updated Mar 2025

Reference: errno values

Standard API errno Values

[FreeRTOS-Plus-FAT Standard API Reference]

The FreeRTOS-Plus-FAT file system's standard API uses the same errno values as used by the standard C library. File related functions in standard C library return 0 for pass, and -1 for fail. If -1 is returned then the reason for the failure is stored in a variable called errno, which must be inspected separately.

Similarly, FreeRTOS-Plus-FAT's standard API returns 0 for and -1 for fail, and maintains an errno variable for each RTOS task. A task can retrieve its errno value by calling stdioGET_ERRNO(). The error codes returned by stdioGET_ERRNO() are defined in <projdefs.h> files and are listed below.

ValueConstantDescription
0pdFREERTOS_ERRNO_NONENo such file or directory
2pdFREERTOS_ERRNO_ENOENTNo such file or directory
5pdFREERTOS_ERRNO_EIOI/O error
6pdFREERTOS_ERRNO_ENXIONo such device or address
9pdFREERTOS_ERRNO_EBADFBad file number
11pdFREERTOS_ERRNO_EAGAINNo more processes
11pdFREERTOS_ERRNO_EWOULDBLOCKOperation would block
12pdFREERTOS_ERRNO_ENOMEMNot enough core
13pdFREERTOS_ERRNO_EACCESPermission denied
14pdFREERTOS_ERRNO_EFAULTBad address
16pdFREERTOS_ERRNO_EBUSYMount device busy
17pdFREERTOS_ERRNO_EEXISTFile exists
18pdFREERTOS_ERRNO_EXDEVCross-device link
19pdFREERTOS_ERRNO_ENODEVNo such device
20pdFREERTOS_ERRNO_ENOTDIRNot a directory
21pdFREERTOS_ERRNO_EISDIRIs a directory
22pdFREERTOS_ERRNO_EINVALInvalid argument
28pdFREERTOS_ERRNO_ENOSPCNo space left on device
29pdFREERTOS_ERRNO_ESPIPEIllegal seek
30pdFREERTOS_ERRNO_EROFSRead only file system
42pdFREERTOS_ERRNO_EUNATCHProtocol driver not attached
50pdFREERTOS_ERRNO_EBADEInvalid exchange
79pdFREERTOS_ERRNO_EFTYPEInappropriate file type or format
89pdFREERTOS_ERRNO_ENMFILENo more files
90pdFREERTOS_ERRNO_ENOTEMPTYDirectory not empty
91pdFREERTOS_ERRNO_ENAMETOOLONGFile or path name too long
95pdFREERTOS_ERRNO_EOPNOTSUPPOperation not supported on transport endpoint
105pdFREERTOS_ERRNO_ENOBUFSNo buffer space available
109pdFREERTOS_ERRNO_ENOPROTOOPTProtocol not available
112pdFREERTOS_ERRNO_EADDRINUSEAddress already in use
116pdFREERTOS_ERRNO_ETIMEDOUTConnection timed out
119pdFREERTOS_ERRNO_EINPROGRESSConnection already in progress
120pdFREERTOS_ERRNO_EALREADYSocket already connected
125pdFREERTOS_ERRNO_EADDRNOTAVAILAddress not available
127pdFREERTOS_ERRNO_EISCONNSocket is already connected
128pdFREERTOS_ERRNO_ENOTCONNSocket is not connected
135pdFREERTOS_ERRNO_ENOMEDIUMNo medium inserted
138pdFREERTOS_ERRNO_EILSEQAn invalid UTF-16 sequence was encountered
140pdFREERTOS_ERRNO_ECANCELEDOperation cancelled

Native API errno Values


[FreeRTOS-Plus-FAT Native API Reference]

The file system's native API has a more sophisticated error code system, and returns error codes directly from its API functions. Error codes used by native APIs are defined in <ff_error.h>.