🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.mail.mush
Article #895

curs_io.c: Use rdchk in Xenix

#895
From: Ronald Khoo
Date: Tue, 30 May 1989 17:46
60 lines
2593 bytes
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
Technical Details
Message-ID: <10802@ibmpcug.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!mcvax!ukc!pyrltd!slxsys!ibmpcug!ronald

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!mcvax!ukc!pyrltd!slxsys!ibmpcug!ronald
From: ronald@ibmpcug.co.uk (Ronald Khoo)
Newsgroups: comp.mail.mush
Subject: curs_io.c: Use rdchk in Xenix
Keywords: rdchk FIONREAD map map!
Message-ID: <10802@ibmpcug.UUCP>
Date: 30 May 89 17:46:22 GMT
Sender: ronald@ibmpcug.UUCP
Organization: The IBM PC User Group, UK.
Lines: 60
To: Mush Users List <mush-users@garp.mit.edu>
X-Mailer: You joking? Straight from vi to the MTA, please!