Question
O_NONBLOCK is defined twice and does not work with lwIP
The define O_NONBLOCK exists twice.
Once in:
...\ST\STM32CubeIDE_1.6.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_2.0.0.202105311346\tools\arm-none-eabi\include\sys\_default_fcntl.h:
#define _FNONBLOCK 0x4000 /* non blocking I/O (POSIX style) */
....
#define O_NONBLOCK _FNONBLOCKand at in:
<ProjectFolder>\Middlewares\Third_Party\LwIP\src\include\lwip\sockets.h:
#ifndef O_NONBLOCK
#define O_NONBLOCK 1 /* nonblocking I/O */
#endifNow a call like this fails:
fcntl(socket_handle, F_SETFL, fcntl(socket_handle, F_GETFL, 0) | O_NONBLOCK);as the define in _default_fcntl.h is not compatible with lwIP.
Please remove this define in _default_fcntl.h
