Controling blocking of read() with c_cc[VTIME]??

Jay D. Allen (jay@fork.com)
Thu, 24 Aug 1995 21:21:51 -0700


I'm having some trouble making read() honor my setup. If I have
a NONBLOCKing fd set up:
t.c_cc[VMIN]=0;
t.c_cc[VTIME]=10;
Shouldn't the read() block for at least 10/10ths of a second? Instead
it immediately returns a -1, with the very cute "TRYAGAIN" errno set!?!

My workaround is to test errno on return from read(), and if "TRYAGAIN",
I sleep(1), and "try again". This seems like an expensive way to do it.

Comments or suggestions would be appreciated.
==================================================================
* Jay D. Allen Fork Company *
* jay@fork.com contract systems support and consulting *
* Portland Oregon, USA *
==================================================================