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: converse of cygwin_attach_handle_to_fd()?


On 04 June 2006 00:10, Samuel Thibault wrote:

> Hi,
> 
> cygwin_attach_handle_to_fd() lets create a cygwin fd on top of a windows
> handle. When calling close() on the fd, the windows handle is closed
> too. Is there any way to close the fd without closing the underlying
> handle? (i.e. the converse of cygwin_attach_handle_to_fd(), actually)

  Well, the simple workaround would be to write a wrapper function for
cygwin_attach_handle_to_fd; the wrapper would call DuplicateHandle to get a
spare copy of the original handle and then pass that duplicated handle to
cygwin_attach_handle_to_fd instead of the original handle; that way, when you
close the fd, the duplicate of the handle is closed, entirely independently of
the original.

    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


--
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/


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