This is the mail archive of the cygwin-patches@cygwin.com 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: Patch to pass file descriptors


Hello all.

Why not implement passing file descriptors in the following way:

Somewhere in the structure passed to sendmsg send a handle of
the calling process created with
OpenProcess(PROCESS_DUP_HANDLE, FALSE, GetCurrentProcessId());
OpenProcess will always succed, since the caller is current process.

recvmsg implementation will just use that process handle
for the DuplicateHandle call.

That approach worked for me year ago in the experimental (now dead)
Cygwin port of my application.

-- 
Dmitry.




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