🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.sequent
2 messages
2 total messages Started by P.McGuinness Thu, 25 Apr 1991 17:59
curses and stdio buffering
#547
Author: P.McGuinness
Date: Thu, 25 Apr 1991 17:59
45 lines
2019 bytes
We (several of us at CERL) are porting code from a pyramid to a sequent,
and we have had problems with curses. Apparently, when we switch in and
out of curses, the terminal modes are not reset correctly when endwin() is
called, as claimed in curses(3x) documentation.

More fundamentally, when curses goes through initscr(), .. endwin()
and then on to stdio-type output, stdio buffering changes. 
On the sequent, it drops the _IOLBF flag (apparently going
to full buffering).

I have included some test code that demonstates the problem,
and the output we get.  Has anyone else observed these problems?
Any ideas as to why this is happening?  Is it a sequent bug?
Am I missing something here? Inquiring (and debugging) minds want to know.

We have had other stdio-type problems, some related to curses,
some not. They seem to suggest something to do with stdio buffering
is amiss.

	Patrick McGuinness,  working at USA-CERL.
	pjm@osiris.cso.uiuc.edu

------
#include <stdio.h>
#include <curses.h>
main()
{
	printf(" Starts out fine\n");
	fprintf(stderr,"iob[1]._flag %d\n",stdout->_flag);
	initscr();
		/* curses stuff deleted */
	endwin();
	fprintf(stderr,"iob[1]._flag %d\n",stdout->_flag);
	printf("stdout: This is printed after the fact\n");
	fprintf(stderr,"Stderr: prints out\n");
}

-------
It has this output:

Starts out fine
iob[1]._flag 74
iob[1]._flag 10
Stderr: prints out
stdout: This is printed after the fact
Re: curses and stdio buffering
#549
Author: P.McGuinness
Date: Fri, 26 Apr 1991 02:54
8 lines
725 bytes
 

One somewhat important addendum to the original article ....
we are using DYNIX/ptx V1.2.3.

Patrick McGuinness
pjm@osiris.cso.uiuc.edu
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads