X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=0.3 required=5.0 tests=AWL,BAYES_00,DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_NUMERIC_HELO,SPF_HELO_PASS,TW_CG,TW_FD,T_RP_MATCHES_RCVD,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Juanjo Subject: Re: Problem with Cygwin's fdopen and Windows handles Date: Mon, 30 May 2011 21:12:06 +0000 (UTC) Lines: 49 Message-ID: References: <20110529233841 DOT GC5283 AT ednor DOT casa DOT cgf DOT cx> <20110530174649 DOT GB14225 AT ednor DOT casa DOT cgf DOT cx> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit User-Agent: Loom/3.14 (http://gmane.org/) 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 Christopher Faylor cygwin.com> writes: > > Please calm down. I am calm :-) I just happen to like exclamation signs. > I guess I shouldn't have said the "doesn't really work" and stuck with > "of limited utility". fds attached with cygwin_attach_handle_to_fd are > not fully functional. You still have not answered my question. C fds are working. They allow read() write() and close(). The question is actually why fread() does not work. From your email I still am not convinced that the problem is with cygwin_attach_handle_to_fd(). Do ANSI streams need something that C file ids do not provide? > >I have seen messages in a sibling mailing list reporting that fork() > >fails when a program injects libraries using various mechanisms > >http://sourceware.org/ml/cygwin/2011-04/msg00185.html > > "sibling mailing list"? That is this mailing list. Sorry, it is very difficult for me to identify in gmane the actual name of the mailing list. > If you have an application which uses a lot of dlls then best practice > for Windows DLLs is to build them with unique load addresses. Barring > that you could rebase them with cygwin's rebase or rebaseall utilties. > Setting unique base addresses will actually cause your application to > load slightly faster whether you use Cygwin or not. It seems I did not express myself properly. Code is compiled on the fly. DLLs do not survive beyond program execution. This is a dynamic language (Common Lisp btw) and functions are compiled and run and consumed quickly. Calling rebase for each invocation is overkill (it will scan the whole system!) and I would not even know how to start assigning fixed addresses to libraries myself. Let me insist that we could live without fork if only fread() on Windows handles worked -- all ECL needs is a means to execute programs with redirected input/output & error channels (a bit beyond what popen() does). If the answer is we should abandon Cygwin or deprecate it for this project, it would be nice to know. Best regards, Juanjo -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple