This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problem with Cygwin's fdopen and Windows handles

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() !!!
> Please calm down.
> 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.

Attachment: signature.asc
Description: OpenPGP digital signature

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]