delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/08/09/00:29:18

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Fri, 9 Aug 2002 00:28:40 -0400
From: Christopher Faylor <cgf AT redhat DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: More on pipes and O_NONBLOCK
Message-ID: <20020809042840.GB10305@redhat.com>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <F536EC3453B2D411AD6100508BAF5F9901FAB495 AT bwga521a DOT ts DOT siemens DOT de>
Mime-Version: 1.0
In-Reply-To: <F536EC3453B2D411AD6100508BAF5F9901FAB495@bwga521a.ts.siemens.de>
User-Agent: Mutt/1.3.23.1i

On Fri, Aug 02, 2002 at 03:17:23PM +0200, Kandziora Jan wrote:
>Hi all,
>
>It's been a while since I tried to use a cygwin pipe with nonblocking
>operation.
>I tried it with
>
>	if (fcntl(0,F_SETFL,O_NONBLOCK)<0)
>	{
>		perror("input stream can not be set to nonblocking mode");
>		exit(EXIT_FAILURE);
>	}
>	if (fcntl(1,F_SETFL,O_NONBLOCK)<0)
>	{
>		perror("output stream can not be set to nonblocking mode");
>		exit(EXIT_FAILURE);
>	}
>
>It worked for reading from a piped stdin, but not for writing, although the
>code
>snipped above reported no error. Instead, the write on a piped stdout
>blocked after
>writing 12288 Bytes.
>
>Now I read in a Win32 API Book that WIN32 APIs WriteFile() to any pipe is
>always blocking. - Huh? -
>
>If that's true, and Cygwin uses WIN32 API for Pipes, the second fcntl() has
>to fail if the
>descriptor belongs to a pipe, hasn't it? At least that behaviour should be
>noted somewhere,
>maybe in the "Implementation Details" section in the Cygwin API
>Documentation.
>
>What do you think?

I think that a patch would be gratefully accepted.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019