From: Peter DOT Eggimann AT mgb DOT ch Subject: select & pipe does not work! 16 May 1997 09:23:09 -0700 Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Original-To: X-Mailer: Microsoft Exchange Server Internet Mail Connector Version 4.0.994.63 Original-Sender: owner-gnu-win32 AT cygnus DOT com Hi, I encountered a problem while porting some software. The select call (waiting for a pipe) returns immediate even thougt there is no data available from the pipe. Then I tried a small test program (see below) and encountered the same problem. pipetest.c ------------------------------------------------------------------------ ------------------------ #include #include #include #include #include main () { int result; int pipeFd [2]; struct fd_set rset; if (pipe( pipeFd) < 0) { printf ("Error %d creating pipe\n", errno); exit (-1); } FD_ZERO (&rset); FD_SET (pipeFd[0], &rset); result = select (pipeFd[0]+1, &rset, (fd_set*)0, (fd_set*)0, (struct timeval*)0); switch (result) { case 0: printf ("Select: received 0 ?!?\n"); break; case -1: printf ("Select: Error occured\n"); break; default: printf ("normal event\n"); break; } return (0); } ------------------------------------------------------------------------ ------------------------ compiled whith: gcc -g -o pipetest pipetest.c I've installes b18 on NT4.0. The same code on a UN*X box works fine. Has anyone any ideas? - For help on using this list (especially unsubscribing), send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".