From owner-freebsd-current Tue Jan 30 12:52:21 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id MAA28408 for current-outgoing; Tue, 30 Jan 1996 12:52:21 -0800 (PST) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id MAA28317 Tue, 30 Jan 1996 12:52:11 -0800 (PST) Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.9/8.6.9) id HAA25491; Wed, 31 Jan 1996 07:51:31 +1100 Date: Wed, 31 Jan 1996 07:51:31 +1100 From: Bruce Evans Message-Id: <199601302051.HAA25491@godzilla.zeta.org.au> To: current@freebsd.org, dyson@freebsd.org Subject: new pipes fail several tests #1 Sender: owner-current@freebsd.org Precedence: bulk The Minix test programs found several bugs in the new pipe code. #1: read() doesn't return -1/EAGAIN for EOF in non-blocking mode. See POSIX.1-1990 6.4.1.2(2). Bruce #include #include #include #include #include #include #define check(what, expected) assert((what, expected)) int main(void) { char buf[1]; int fd[2]; int r; r = pipe(fd); check("pipe", r == 0); r = fcntl(fd[0], F_SETFL, O_NONBLOCK); check("fcntl", r == 0); r = read(fd[0], buf, 1); printf("read %d bytes, errno = %d\n", r, errno); check("read", r == -1); check("read", errno == EAGAIN); return 0; }