X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-0.0 required=5.0 tests=AWL,BAYES_50,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org X-Trace: 119166432/mk-filter-4.mail.uk.tiscali.com/B2C/$b2c-THROTTLED-DYNAMIC/b2c-CUSTOMER-DYNAMIC-IP/79.66.17.75/None/johne53 AT tiscali DOT co DOT uk X-SBRS: None X-RemoteIP: 79.66.17.75 X-IP-MAIL-FROM: johne53 AT tiscali DOT co DOT uk X-MUA: Microsoft Outlook Express 6.00.2900.2180Produced By Microsoft MimeOLE V6.00.2900.2180 X-IP-BHB: Once X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApwEANlTT0lPQhFL/2dsb2JhbACEVboqWI93hkM Message-ID: <005b01c96455$6c6bed60$4001a8c0@mycomputer> From: "John Emmas" To: Subject: Named pipes (blocking problem) Date: Mon, 22 Dec 2008 16:50:40 -0000 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="Windows-1252"; reply-type=original Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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 Note-from-DJ: This may be spam I'm trying to build a program that implements inter-process communication using named pipes. Because the code needs to also work under Windows (MSVC++) it uses CreateNamedPipe(...) to create the pipes (described here):- http://msdn.microsoft.com/en-us/library/aa365150(VS.85).aspx If I understand the description, it seems that the created pipe can either be blocking or nonblocking depending on whether the flag FILE_FLAG_OVERLAPPED is specified at creation time. The program reads from the pipe using ReadFile(...) - described here:- http://msdn.microsoft.com/en-us/library/aa365467(VS.85).aspx Note that this function takes five parameters - the fifth of which is an (optional) pointer to an OVERLAPPED struct (LPOVERLAPPED). A valid pointer needs to be passed for nonblocking pipes, whereas NULL can be passed for blocking pipes. The program in question builds and runs successfully under VC++. But when I build the same code under Cygwin, any pipes created seem to be permanently nonblocking - i.e. if a 'blocking' pipe was originally specified at creation time, ReadFile(...) will nevertheless return early if there's no data available to read. Here are my questions:- 1) Is this a 'known problem' when using ReadFile() in Cygwin? 2) If Cygwin implements these functions internally, is there a way that I can force my program to link to the corresponding Windows library (which seems to be working as expected) instead of linking to Cygwin's implementation? I'm currently using Cygwin version 1.5 BTW. Thanks, John -- 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/