From owner-freebsd-current Tue Sep 5 8:51: 1 2000 Delivered-To: freebsd-current@freebsd.org Received: from nagual.pp.ru (pobrecita.freebsd.ru [194.87.13.42]) by hub.freebsd.org (Postfix) with ESMTP id 9966D37B422 for ; Tue, 5 Sep 2000 08:50:58 -0700 (PDT) Received: (from ache@localhost) by nagual.pp.ru (8.11.0/8.11.0) id e85Fovs67343 for current@freebsd.org; Tue, 5 Sep 2000 19:50:57 +0400 (MSD) (envelope-from ache) Date: Tue, 5 Sep 2000 19:50:56 +0400 From: "Andrey A. Chernov" To: current@freebsd.org Subject: FIFOs & select: what about our implementation? Message-ID: <20000905195056.A67326@nagual.pp.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Organization: Biomechanoid Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Consider this comment comes from screen(1): /* * Define this if your system exits select() immediatly if a pipe is * opened read-only and no writer has opened it. */ #define BROKEN_PIPE 1 We have broken(?) pipe, according to this statement. At least, we have select return code -1 with wrong errno == 0. I attach the test for it below. The question is: what about our fifo select (actually poll) implementation? Is it really broken, or is it a feature? What standards says? If this is a feature, at least errno must be fixed. ----------------------------------------------------- #include #include #include #include #include char *fin = "/tmp/conftest$$"; main() { struct timeval tv; int r, x; unlink(fin); if (mkfifo(fin, 0600)) exit(1); close(0); if (open(fin, O_RDONLY|O_NONBLOCK)) exit(1); r = 1; tv.tv_sec = 1; tv.tv_usec = 0; if (select(1, &r, 0, 0, &tv)) { perror("select"); exit(1); } exit(0); } ----------------------------------------------------- -- Andrey A. Chernov http://ache.pp.ru/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message