Mail Archives: cygwin/1997/05/16/09:23:09
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 <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <sys/select.h>
#include <sys/types.h>
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".
- Raw text -