SunOS 4.0, wgetch(), select(), and MCP problems

Tom Perrine tep at tots.logicon.com
Tue Mar 19 03:28:00 AEST 1991


Help. The subject says it all :-)

A nearby friend has a Sun-3/180, running SunOS 4.0 :-(, which is hanging
users who use wgetch() and/or select() on terminals which are connected to
an MCP tty port.

The symptoms:

1. wgetch(stdscr,5000) always returns NULL or -1, no matter what
   characters are typed. Using the debugger shows that this library call uses
   select(). This happens if the user is at a ttyh (MCP) or ttyp (rlogin).

2. Emacs (which uses select) frequently hangs when being restarted from
   the SUSPENDed state (^Z,fg), and the process cannot be killed, even though
   its priority is non-negative. Ps shows that the process is in select().
   This only happens at a "real" tty (MCP). Rlogin shells never have this
   problem.

I know that there were many problems with 4.0 and ttys, but we avoided
those problems by skipping from 3.5 to 4.1.1. Unfortunately, my friend
cannot upgrade (the wonders of Gov't contracts!).

Does anyone know of any patches that could help with these problems?

The following program works fine on a 4/40 (IPC) running SunOS 4.1.1, but
demonstrates the problem on the 3/180 under SunOS 4.0.

main()
{
#include <curses.h>

   int ch;

   initscr();
   wtimeout(stdscr,5000);

   while(1){
      ch = wgetch(stdscr);
      wprintw(stdscr,"ch = %d\n", ch);
      if ( ch == 'q' ){
	 endwin();
	 exit(1);
      }
   }
}

Any info, vague recollections, or hints will be greatly appreciated!

Tom Perrine (tep)                       |Internet: tep at tots.Logicon.COM
Logicon - T&TSD                         | UUCP: sun!suntan!tots!tep
P.O. Box 85158                          |GENIE: T.PERRINE
San Diego CA 92138                      |Voice: +1 619 455 1330
"Harried: with preschoolers"            |  FAX: +1 619 552 0729



More information about the Comp.sys.sun mailing list