[comp.mail.mush] curs_io.c: Use rdchk in Xenix

ronald@ibmpcug.co.uk (Ronald Khoo) (05/31/89)

As I was passing by curs_io.c today, I noticed that the FIONREAD call
only wants to know if there's anything to read..  and xenix users (like
me) using pre 2.3 Xenix could just as well use rdchk()...  which makes
things a lot nicer if one is map'ping.  (Not that I do).

Of course when I get my 2.3 dist next month, I'll have select() and then
it'll all be academic, won't it?  (Can any one with SCO 2.3 verify that
their select() actually works?)  None the less, diffs follow for those
interested.  Might be a good idea to make it #ifdef HAS_RDCHK or summat
though.  (I don't know how many systems do).

On another tack...  Are there any moves about to unify the mush-users list &
comp.mail.mush?  I think I don't get the mush list anymore since the 
euro-relay closed down.  Then again, I suppose Dan and Bart do seem to
cc their list replies to the newsgroup, so I suppose it don't matter :-)

*** curs_io.c_dist	Tue May 30 18:09:35 1989
--- curs_io.c	Tue May 30 18:21:42 1989
***************
*** 369,374 ****
--- 369,378 ----
  	if (mac_pending()
  #ifdef FIONREAD
  	    || !ioctl(0, FIONREAD, &n) && n > 0
+ #else
+ #ifdef M_XENIX
+ 	    || rdchk(0) > 0
+ #endif /* M_XENIX */
  #endif /* FIONREAD */
  					       )
  	    *p++ = m_getchar();
***************
*** 400,405 ****
--- 404,414 ----
  	    (void) sleep(1);
  	    (void) ioctl(0, FIONREAD, &n);
  #else
+ #ifdef M_XENIX
+ 	    (void) sleep(1);
+ 	    n = rdchk(0);
+ #else
+ 
  	    /* system has neither select() nor FIONREAD, so just set n
  	     * and force the user to either complete the map or fail it
  	     * without a timeout.  Chars won't echo till he does one or
***************
*** 406,411 ****
--- 415,421 ----
  	     * the other.
  	     */
  	    n = 1;
+ #endif /* M_XENIX  */
  #endif /* FIONREAD */
  #endif /* SELECT */
  	    if (n > 0)

-- 
Ronald Khoo @ The IBM PC User Group, PO Box 360, Harrow HA1 4LQ
Phone:	+44 -1- 863 1191			Domain:	ronald@ibmpcug.CO.UK
Path:	...!ukc!slxsys!ibmpcug!ronald    	Fax:    +44 -1- 863 6095