Dennis Windisch wrote: > As mentioned before, I want to create a non-blocking RT-socket. > > I used therefore a negative timeout in ioctl_rt: ioctl_rt return no error, > but when I want to receive from the socket, the recv_rt function always > return as received length "-11". Using perror, I get "illegal seek". > When I set a positive timeout, even only 1 ns, then all works fine.
All fine here: -11 means -EAGAIN - no data available. [Note that RTDM returns the error code directly rather than setting errno, which perror checks. Only under Xenomai's POSIX skin, the strictly conforming behaviour is implemented. The reason is that some RT-environments do not support errno for RT-thread.] > > How do I set recv_rt in "non-blocking" mode? (Or have I encountered a bug in > the non-blocking mode)? > I've already tried setting the flags (where are they documented?) of recv_rt > to "RT_SOCK_NONBLOCK" or "RT_SO_NONBLOCK" (found in some old threads), but > this arises a compiler error. This is conforming again: MSG_DONTWAIT passed as flag to rt_dev_recv* will have the non-blocking effect specifically for this call. Jan
signature.asc
Description: OpenPGP digital signature