Subject: Re: SCO Unix compatibility
To: Lucio de Re <lucio@proxima.alt.za>
From: Klaus Klein <kleink@layla.inka.de>
List: tech-userlevel
Date: 05/10/1997 13:51:26
On Sat, 10 May 1997 08:18:27 +0200
 Lucio de Re <lucio@proxima.alt.za> wrote:

> > > The problem?  When ICANON is turned off and timeout is used
> > > to return from a read(2), SCO Unix, or, more accurately, the
> > > curses library, does not expect an error return.  Errno is set
> > > to EAGAIN and, presumably, the called function returns -1
> > > instead of zero [...]
> 
> > This sounds a bit familiar to me (a certain POSIX.1 fix comes
> > to my mind). Which NetBSD release do you use?
> 
> I started with 1.1 then tried it with 1.2.  I haven't tried 1.2.1 yet.

Could try out this patch and tell us if it works for you?


-klaus


Index: tty.c
===================================================================
RCS file: /cvsroot/src/sys/kern/tty.c,v
retrieving revision 1.81
retrieving revision 1.82
diff -c -r1.81 -r1.82
*** tty.c	1997/04/03 14:24:45	1.81
--- tty.c	1997/04/04 15:10:34	1.82
***************
*** 1353,1358 ****
--- 1353,1361 ----
  		error = ttysleep(tp, &tp->t_rawq, TTIPRI | PCATCH,
  		    carrier ? ttyin : ttopen, slp);
  		splx(s);
+ 		/* VMIN == 0: any quantity read satisfies */
+ 		if (cc[VMIN] == 0 && error == EWOULDBLOCK)
+ 			return (0);
  		if (error && error != EWOULDBLOCK)
  			return (error);
  		goto loop;