Xref: utzoo comp.sys.hp:4371 comp.lang.c:26086 Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!cernvax!chx400!forty2!mecazh!paul From: paul@mecazh.UUCP (Paul Breslaw) Newsgroups: comp.sys.hp,comp.lang.c Subject: Unbuffered Stdio Input Keywords: stdio, buffering, ptys Message-ID: <378@node17.mecazh.UUCP> Date: 19 Feb 90 22:29:29 GMT Reply-To: paul@zurich01.UUCP (Paul Breslaw) Organization: Mecasoft SA, CH-8057 Zurich, Switzerland Lines: 42 I have a little program that opens a master side pty and reads from it. I have another little program that opens the corresponding slave side and writes to it. If the master side is coded something like:- FILE *f; char buf[ BF ]; int nr; f = fopen( master, "a+" ); nr = fread( buf, sizeof( char ), BF, f ); then the program hangs on the fread. If, however, I replace the last line with nr = read( fileno( f ), buf, BF ); then the read succeeds. An optional setbuf( f, NULL ); does not alter the situation. I have tested the program on an HP9000/340 (HP-UX 6.5) and a Sun3/50 (SunOS 3.5) with not quite identical non-events :-) Any suggestions what I've done wrong? Paul Breslaw -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Paul Breslaw, Mecasoft SA, | telephone : 41 1 362 2040 Guggachstrasse 10, CH-8057 Zurich, | e-mail : mcsun!chx400!mecazh!paul Switzerland. | paul@mecazh.UUCP