Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com From: "Alfred Minarik" To: Subject: bug: pipe + O_NONBLOCK Date: Sun, 18 Sep 2005 09:36:57 +0200 Message-ID: <000101c5bc23$bf83cb90$8c00000a@w2k> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 #include 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/