trn problem

Jaeson Jong jjong at nysnet.nys.GOV
Fri Mar 29 00:05:55 AEST 1991


We recently installed trn on our machine and experienced some
trouble runing it on some type of devices. We really appreciate
any help to determine the cause. Here's our story:

We installed trn on our AT&T 3B2 1000 runing system V release 3.2.
It works perfectly on tty terminal or xterm. However, when it is
executed from a window over the local area network, it hangs at the first
prompt ( xxx unread article(s) in xxxxxxx--read now? [+ynq] )
We use AT&T 730 MTG terminals over an AT&T starLAN IEEE 802.3 (Ethernet)
implementation. The OSI network protocol is implemented.

After spending some time on source codes, I found the followings;

* The the "read()" system call in the "circfill()" function, defined in 
  "term.c", returns -1 when it is executed on a starLAN window.

* Which makes "nextin" and the return value of "circfill()" -1.

* Which also makes macro function "input_pending()"  true.

	#define input_pending() ( nextin!=nextout || circfill() )

* Which makes the while loop in "eat_typeahead()" keep calling
  "read_tty()" infinitely.

	  while ( input_pending() )
	     read_tty ( buf, sizeof (buf) );

* Since "nextin" is -1, "nextin" and "nextout" never get a chance
  to be equal.

I temporary solved this problem by modifying

* int
  circfill()
  {
     register int Howmany = read ( devtty, circlebuf+nextin, 1 );

     if ( Howmany ) {
        .
        .

:

  int
  circfill()
  {
     register int Howmany = read ( devtty, circlebuf+nextin, 1 );

     if ( Howmany > 0 ) {
        .
        .



* #define input_pending() ( nextin!=nextout || circfill() )

to;

  #define input_pending() ( nextin!=nextout || circfill() > 0 )


My question is;

Has anybody out there had the same experience?
Does anybody know why the read() system call returns -1 over /dev/slan 
 (the local area network terminal driver) while returning 0 on other tty's.


Jaeson Jong				jjong at nysnet.uunet.uu.net
New York State				uunet!nysnet!jjong
Office of General Services
Strategic Systems Laboratory



More information about the Comp.unix.questions mailing list