System calls cannot be interrupted: am I missing something in the configuration when compiling my OpenWrt image?

Hello,
While writing C programs using sockets, and crosscompiling them for OpenWrt, I noticed that, in OpenWrt, all the systems calls seems to be uninterruptable, while in standard Linux (for instance in Ubuntu 18.06) they are normally interruptable when a signal is received.

For instance, I have a thread which is waiting for data with a blocking recvfrom(). In standard Linux, when a signal is received, the recvfrom() exists with return value -1 and errno set to EINTR (interrupted system call), which is the expected behaviour.
In OpenWrt instead, this calls seems to wait indefinitely until some data is received (or a timeout occurs), no matter how many signals are received by the process in between.

Do you know why is this happening? Is there a specific kernel configuration or compilation flag related to this?

Thank you very much in advance!

1 Like