[OpenIndiana-discuss] nonblocking i/o problem

Jeff Woolsey jlw at jlw.com
Wed Apr 5 08:16:49 UTC 2017


Based on an assurance
[https://wiki.illumos.org/display/illumos/illumos+FAQs, Is illumos
compatible with Solaris/OpenSolaris?] that OI-hipster was upward
binary-compatible with S10 and that any discrepancies were to be
reported, and some S10 exploits becoming more widely known, I upgraded
from Solaris S10XU8 to OI-hipster-2016.10.   There was some teething,
and one thing I still haven't resolved is an S10 binary that works right
in S10 and wrong in OI regarding non-blocking reads of stdin.  It
happens to be my main project, of course...

truss, in short, says:

Solaris X86 S10U8

fcntl(0, F_GETFL)                               = 2
fcntl(0, F_SETFL, FWRITE|FNONBLOCK)             = 0
read(0, 0xFFFFFD7FFF0C0028, 4096)               Err#11 EAGAIN
fcntl(0, F_SETFL, FWRITE|FOFFMAX)               = 0

Openindiana-hipster 2016.10

fcntl(0, F_GETFL)                               = 8194
fcntl(0, F_SETFL, FWRITE|FOFFMAX|FNONBLOCK)     = 0
read(0, 0xFFFFFD7FFF0C0028, 4096)               = 0
fcntl(0, F_SETFL, FWRITE|FOFFMAX)               = 0


Does anybody know why the behavior is different, and how to get the
former under OI.  I expect there is some library difference somewhere.  
I've been poking at tcsetattr to tweak this, and the best I can do is
see 4 characters get queued up before the program gets them (S10U8 does
that with different termios flags, too).   read() returning 0 instead of
EAGAIN is interpreted as EOF and the program quits, rather clumsily.

-- 
Jeff Woolsey {{woolsey,jlw}@jlw,first.last@{gmail,jlw}}.com
Nature abhors straight antennas, clean lenses, and empty storage.
"Delete! Delete! OK!" -Dr. Bronner on disk space management
Card-sorting, Joel.  -Crow on solitaire




More information about the openindiana-discuss mailing list