From owner-freebsd-hackers Wed Oct 14 18:19:38 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA04139 for freebsd-hackers-outgoing; Wed, 14 Oct 1998 18:19:38 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from whistle.com (s205m131.whistle.com [207.76.205.131]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA04134 for ; Wed, 14 Oct 1998 18:19:36 -0700 (PDT) (envelope-from archie@whistle.com) Received: (from smap@localhost) by whistle.com (8.7.5/8.6.12) id SAA04891 for ; Wed, 14 Oct 1998 18:19:20 -0700 (PDT) Received: from bubba.whistle.com(207.76.205.7) by whistle.com via smap (V1.3) id sma004889; Wed Oct 14 18:18:55 1998 Received: (from archie@localhost) by bubba.whistle.com (8.8.7/8.6.12) id SAA02921 for freebsd-hackers@freebsd.org; Wed, 14 Oct 1998 18:18:55 -0700 (PDT) From: Archie Cobbs Message-Id: <199810150118.SAA02921@bubba.whistle.com> Subject: bug with SIGIO? To: freebsd-hackers@FreeBSD.ORG Date: Wed, 14 Oct 1998 18:18:55 -0700 (PDT) X-Mailer: ELM [version 2.4ME+ PL38 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi, The program included below seems to indicate a bug with SIGIO, in that the process is not always getting signalled when the file descriptor is writable. If you run this program, it outputs for a while, then stops, then resumes when you hit return (which causes a readable condition). I've verified this behavior in 2.2.7 but not 3.0-current. Q1. Is this in fact a bug, or else a misunderstanding? Q2. If this is not a bug, what is the correct way to do this? I apologize if this is already know; didn't find anything in the PR database. Thanks, -Archie ___________________________________________________________________________ Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com #include #include #include #include #include #include void catch() { } int main(int ac, void *av[]) { sigset_t empty, block; int on = 1; fcntl(1, F_SETFL, O_NONBLOCK); ioctl(1, FIOASYNC, &on); sigemptyset(&empty); sigemptyset(&block); sigaddset(&block, SIGIO); sigprocmask(SIG_BLOCK, &block, NULL); signal(SIGIO, catch); for (;;) { int w = write(1, "!@#$%", 5); if (w < 0 && errno == EWOULDBLOCK) { sigsuspend(&empty); write(1, " resumed ", 7); } } } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message