Re: [PATCH] immortal helpers

From: Robert Collins <robertc_at_robertcollins.net>
Date: Mon, 22 Feb 2010 12:16:06 +1100

On Mon, 2010-02-22 at 02:03 +0100, Henrik Nordström wrote:
> mån 2010-02-22 klockan 11:44 +1100 skrev Robert Collins:
>
> > command protocol for it would be pretty similar to the SHM disk IO
> > helper, but for processes. Something like:
> > squid->helper: spawn stderrfd argv(escaped/encoded to be line & NULLZ
> > string safe)
> > helper->squid: pid, stdinfd, stdoutfd
>
> Which requires UNIX domain sockets for fd passing, and unknown
> implementation on Windows..

I thought SHM could pass around fd's. Anyhow, its doable on unix. On
windows you can supply a HANDLE cross process:
BOOL WINAPI DuplicateHandle(
  __in HANDLE hSourceProcessHandle,
  __in HANDLE hSourceHandle,
  __in HANDLE hTargetProcessHandle,
  __out LPHANDLE lpTargetHandle,
  __in DWORD dwDesiredAccess,
  __in BOOL bInheritHandle,
  __in DWORD dwOptions
)

So you call that, and then the other process can use the handle.

-Rob

Received on Mon Feb 22 2010 - 01:16:17 MST

This archive was generated by hypermail 2.2.0 : Mon Feb 22 2010 - 12:00:07 MST