Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com Message-ID: <20000126153524.41585.qmail@hotmail.com> X-Originating-IP: [195.212.29.117] From: "Michele Liberi" To: cygwin AT sourceware DOT cygnus DOT com Subject: B20.1++ select bug Date: Wed, 26 Jan 2000 07:35:24 PST Mime-Version: 1.0 Content-Type: text/plain; format=flowed I already appended this problem at the mailing list a few days ago. I was told to update my system at the latest cygwin1.dll available in the snapshot area. It didn't help. That's why I'm sending this help request again. I also tryed to upgrade the gcc compiler to 2.95.2 and recompile the program. The problem is simple: 'select' hangs (do not return) when reading from a pipe and the child process exit. The following C program well illustrates the problem: #include #include #include #include int main(int argc, char **argv, char **envp) { int p1[2], p2[2], maxfd; fd_set fdread; if (pipe(p1)) return 1; if (pipe(p2)) return 1; switch(fork()) { case -1: /* error */ return 1; case 0: /* child */ close(p1[0]); dup2(p1[1],1); close(p2[0]); dup2(p2[1],2); sleep(3); return 0; } close(p1[1]); close(p2[1]); FD_ZERO(&fdread); FD_SET(p1[0],&fdread); FD_SET(p2[0],&fdread); if (p1[0]>p2[0]) maxfd=p1[0]; else maxfd=p2[0]; printf("select input %d\n", fdread); select(maxfd+1,&fdread,NULL,NULL,NULL); printf("select output %d\n", fdread); return 0; } /* main */ ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com