On 2018-09-02 20:09, Mark Pizzolato wrote:
On Saturday, September 1, 2018 at 7:31 PM, Mark Abene wrote:
Yes. Depending on context, one would use either of FNDELAY,
O_NDELAY, or O_NONBLOCK, for clarity.
In reality, they all mean the same thing. See
/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h to see why
that is.  In the case of android, try O_NONBLOCK, or try using
ioctl instead of fcntl (FNDELAY doesn't exist on android, so use
one of the other names).

Thanks for that pointer.  Implied there is that the FNDELAY comes
from some desire for BSD compatibility which it seems reasonable
for Android not to be too worried about.

Not only that, FNDELAY is supposed to be kernel internal only. Apparently there was some version who accidentally exposed it, and to be compatible, it's been defined/exposed since, but no code should really ever use this.

Linux seems to think it should be mapped to O_NDELAY, while looking at NetBSD, it is mapped to O_NONBLOCK. I think it's wise to totally remove any reference to FNDELAY. It is never the correct value.

One could then argue what the different is between O_NDELAY and O_NONBLOCK, but that's a different story.

The recent change (adding FNDELAY) was added to accommodate
a different Linux platform which didn't honor the termio setting of
VMIN=0 and VTIME=0 settings which define non blocking I/O.

How about instead using O_* macros, which are the ones intended to be used here...
You must have dug around some to even find FNDELAY...

  Johnny

--
Johnny Billquist                  || "I'm on a bus
                                  ||  on a psychedelic trip
email: b...@softjar.se             ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol
_______________________________________________
Simh mailing list
Simh@trailing-edge.com
http://mailman.trailing-edge.com/mailman/listinfo/simh

Reply via email to