This is the mail archive of the 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: Descriptor passing between process


Wednesday, 23 January, 2002 Christophe LEITIENNE wrote:

CL> I'm using Cygwin 1.3.8 on a Windows 2000 box.
CL> I'm looking for a way to pass a socket descriptor between 2 process, using
CL> sendmsg and recvmsg on a unix named pipe. This procedure seems to be well
CL> knowned and works well on Linux and AIX.
CL> I didn't found anything interesting about it in the mailing list archives,
CL> except someone who started to port this API to Cygwin some time ago, without
CL> any further informations.

CL> am I doing something wrong ?

no. this feature currently is not supported.

CL> Will this API be ported to Cygwin in a near future ?

probably. when/if cygwin daemon will be tested and included into main
sources. daemon issue had been discussed to death in cygwin-developers@
mailing list, you can look in archives if you're interested. Rob
Collins created and is maintaining a separate cygwin_daemon branch in

original "cygwin daemon" (called "cygwin server" then) motivation was
exactly what you're asking about -- providing a secure way to pass
handles between possibly unrelated processes.

CL> Is there a way to pass descriptors between process in an other way with
CL> Cygwin ?

for now, the only way to do it is normal parent/child descriptor

CL> Is it possible to simulate this using the win32 DuplicateHandle and
CL> cygwin_attach_handle_to_fd (and probably with cygwin_attach_fd_to_handle
CL> which does not exists) ?

the problem with DuplicateHandle is that you have to obtain a handle
of other process. this is not always possible, for security reasons.

Egor.   ICQ 5165414 FidoNet 2:5020/496.19

Unsubscribe info:
Bug reporting:

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