From owner-freebsd-hackers Sun Dec 8 00:26:55 1996 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id AAA01816 for hackers-outgoing; Sun, 8 Dec 1996 00:26:55 -0800 (PST) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.8.4/8.8.4) with ESMTP id AAA01811 for ; Sun, 8 Dec 1996 00:26:51 -0800 (PST) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.3/8.6.9) id TAA19537; Sun, 8 Dec 1996 19:24:22 +1100 Date: Sun, 8 Dec 1996 19:24:22 +1100 From: Bruce Evans Message-Id: <199612080824.TAA19537@godzilla.zeta.org.au> To: joerg_wunsch@uriah.heep.sax.de, mbarkah@hemi.com Subject: Re: bug in 2.2-alpha loopback (?) Cc: freebsd-hackers@freebsd.org Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >> I can't reproduce this with your test program: >> >> j@uriah 1455% ./bar >> Waiting for client on port 2000 >> Attention, read() returned 0. > >Sorry, I wasn't very careful considering all the variables. This >might be a "telnet" problem instead of a loop interface problem See another thread in freebsd-bugs about bugs in telnet LINEMODE. I lost your example program, but the following simple program shows the bug: main() { char buf[4]; int i, nr; while (1) { nr = read(0, buf, sizeof buf); if (nr == 0) exit(0); printf("\nread %d bytes:", nr); for (i = 0; i < nr; ++i) printf(" %02x", (unsigned char)buf[i]); printf("\n"); } } Run this and type `1^D' where ^D is the eof character for the tty. The read should return 1, but in telnet LINEMODE it doesn't return. The eol character is similarly broken (when set). The eol2 character works. Bruce