X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,TW_FD,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Message-ID: <4DE3E451.8040209@gmail.com> Date: Mon, 30 May 2011 11:39:13 -0700 From: Daniel Colascione User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: Problem with Cygwin's fdopen and Windows handles References: <20110529233841 DOT GC5283 AT ednor DOT casa DOT cgf DOT cx> <20110530174649 DOT GB14225 AT ednor DOT casa DOT cgf DOT cx> In-Reply-To: <20110530174649.GB14225@ednor.casa.cgf.cx> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig012CC4F6097261CDF37E5C80" 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 --------------enig012CC4F6097261CDF37E5C80 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 5/30/11 10:46 AM, Christopher Faylor wrote: > On Mon, May 30, 2011 at 07:34:27AM +0000, Juanjo wrote: >> Christopher Faylor writes: >>> Unfortunately, cygwin_attach_handle_to_fd doesn't really work. Cygwin >>> needs to know the type of handle it is attaching in order to set up the >>> correct type of file handler. Since it doesn't do that the handle is >>> of limited utility. >> >> If this was true, the function should have then been removed from the >> manual or marked as not working. But I believe this is not right, for >> read() and file handlers work perfectly and the problem only arises >> with fread() !!! >=20 > Please calm down. >=20 > 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. If cygwin_attach_handle_to_fd is ever deprecated or replaced entirely, could we replace it with opening /proc/self/fd/handle:XXXX, where XXXX is the decimal encoding of the handle value? It'd eliminate a Cygwin API call and allow easier interaction with handles inherited from non-Cygwin programs, and if the code exists to automatically detect the proper fhandler type for a given HANDLE, the loss in API richness shouldn't matter. --------------enig012CC4F6097261CDF37E5C80 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (Darwin) iEYEARECAAYFAk3j5FQACgkQ17c2LVA10VsiHQCgi82XiS3iAKKmJXHezFJhgG/s aSsAnAx3etp2O63nmvc4JiM90zOan+To =/F13 -----END PGP SIGNATURE----- --------------enig012CC4F6097261CDF37E5C80--