Mail Archives: cygwin/2005/09/18/03:38:39
Hello,
Writing to full O_NONBLOCKed pipes should not block, but return -1 with
errno==EAGAIN.
This should print "filling" for a while, then print "full" and exit.
But at cygwin (1.5.18 on 2000/XP) it prints only "filling" and then
hangs.
--------
#include <unistd.h>
#include <fcntl.h>
int main()
{
int mypipe[2];
int data[60];
int ret;
pipe (mypipe);
fcntl(mypipe[1], F_SETFL, O_NONBLOCK);
for (;;)
{
ret=write (mypipe[1],data,57);
if (ret==-1)
{
printf("full\n");
exit(0);
}
else if (ret==57) printf("filling\n");
else printf("unexpected\n");
}
}
---------
Please take a look at this, thanks,
-Alfred
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -