error: 'pdFREERTOS_ERRNO_EINTR' undeclared (first use in this function)

sachingole wrote on Wednesday, April 26, 2017:

Dear all,

I am porting FreeRTOS+TCP for my custome hardware, I have take source from FreeRTOS+TCP. Currently working on NetworkInterface. Its about to finish.

After that when my compilation continues it have error.
error: ‘pdFREERTOS_ERRNO_EINTR’ undeclared (first use in this function)

FreeRTOS version 8.2.3 and FreeRTOS-Plus-TCP as lab download.

Please let me know any info about fixing this error.

heinbali01 wrote on Wednesday, April 26, 2017:

Hello Sachin,

After that when my compilation continues it have error.
error: ‘pdFREERTOS_ERRNO_EINTR’ undeclared (first use in this function)

The FreeRTOS ERRNO numbers are defined in two places:

● source/include/projdefs.h
● FreeRTOS-Plus-TCP/include/FreeRTOS_errno_TCP.h

Eventually the FreeRTOS ERRNO defines should be placed in projdefs.h only. But in order to avoid missing declarations, a copy is also placed in FreeRTOS_errno_TCP.h.

ERRNO_EINTR was one of the latest ERRNO’s to be added, and it might be that it is not found in the projdefs.h of 8.2.3. and earlier.

You can simply add it:

 #define pdFREERTOS_ERRNO_NONE          0  /* No errors */
 #define pdFREERTOS_ERRNO_ENOENT        2  /* No such file or directory */
+#define pdFREERTOS_ERRNO_EINTR         4  /* Interrupted system call */
 #define pdFREERTOS_ERRNO_EIO           5  /* I/O error */

ERRNO_EINTR was introduced to support the interruption of blocking API’s recvfrom(), recv(), and select().

#if( ipconfigSUPPORT_SIGNALS != 0 )
    /* Send a signal to the task which reads from this socket. */
    BaseType_t FreeRTOS_SignalSocket( Socket_t xSocket )
    {
    }
#endif /* ipconfigSUPPORT_SIGNALS */

In case an API was interrupted from outside, it will return -pdFREERTOS_ERRNO_EINTR.

sachingole wrote on Wednesday, April 26, 2017:

Thanks for information. Compilation continued, This error got fixed.