In the old design, the driver/socket needed to return -ENOTTY to activate
the default action(in file_vioctl) even if they handle O_NONBLOCK
internally. This approach confuses many people and introduces the error you
hit several times.
So https://github.com/apache/incubator-nuttx/pull/6976 fixes this problem:
the default action is activated when driver/socket return either OK or
-ENOTTY.
I suggest you cherry-pick this patch to enter the final solution.

On Fri, Nov 4, 2022 at 3:00 AM Jernej Turnsek <jernej.turn...@gmail.com>
wrote:

> I think I have a fix to this problem. If I change the initialization
> value of the variable ret in function local_ioctl (file local_sockif.c)
> from OK to -ENOTTY (like the fix in netdev_ioctl), it starts to work in my
> case. I think it should not be a problem for other cases. What do you
> think?
>
> On Thu, Nov 3, 2022 at 7:04 PM Xiang Xiao <xiaoxiang781...@gmail.com>
> wrote:
>
> > Does your branch contain this patch?
> > https://github.com/apache/incubator-nuttx/pull/5933
> >
> > On Fri, Nov 4, 2022 at 1:11 AM Jernej Turnsek <jernej.turn...@gmail.com>
> > wrote:
> >
> > > Hi,
> > >
> > > I am trying to set O_NONBLOCK flag with the help of fcntl on Local
> Socket
> > > structure (AF_UNIX) and I am not getting the non blocking
> functionality.
> > If
> > > setting the SOCK_NONBLOCK flag while creating the socket, it is working
> > > fine. I am using some Linux based code, where this functionality is
> > > working. Is this a bug?
> > >
> > > Regards,
> > > Jernej
> > >
> >
>

Reply via email to