diff --git a/net/usrsock/usrsock_ioctl.c b/net/usrsock/usrsock_ioctl.c index f77c563fd4d28..000c1f596d561 100644 --- a/net/usrsock/usrsock_ioctl.c +++ b/net/usrsock/usrsock_ioctl.c @@ -32,6 +32,7 @@ #include #include +#include #include #include #ifdef CONFIG_NETDEV_WIRELESS_IOCTL @@ -174,6 +175,25 @@ int usrsock_ioctl(FAR struct socket *psock, int cmd, FAR void *arg, int ret; + if (cmd == FIONBIO) + { + int nonblock = *((FAR int *)arg); + + net_lock(); + + if (nonblock) + { + conn->sconn.s_flags |= _SF_NONBLOCK; + } + else + { + conn->sconn.s_flags &= ~_SF_NONBLOCK; + } + + net_unlock(); + return OK; + } + net_lock(); if (conn->state == USRSOCK_CONN_STATE_UNINITIALIZED ||