bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A proxy of the proc server for translators


From: zhengda
Subject: Re: A proxy of the proc server for translators
Date: Mon, 30 Jun 2008 15:10:13 +0200
User-agent: Thunderbird 2.0.0.14 (X11/20080421)

olafBuddenhagen@gmx.net wrote:
The only difference between translators and other programs is that a
translator uses the bootstrap port, while other programs ignore it. As
the translator subprocess is forked from the "outer" helper program
invoked through settrans, the bootstrap port is copied to it. The helper
program ignores it, the translator uses it. No problem here.

It is possible to create the weirdest settrans commands; you can
actually put complete shell scripts there... Ask Thomas Schwinge for
some crazy examples ;-) (See
http://lists.gnu.org/archive/html/bug-hurd/2007-04/msg00008.html )
Indeed, the command is so weird:)
Sorry, I was unclear: I did actually understand all that. I just meant
that I was at a loss as to how to handle it...

In the meantime, it dawned upon me however. I don't know how these
things work exactly, so I'm not sure this is correct... AIUI every
process has it's own port for proc, right?

So I think all you need to do is for every client that contacts the proc
proxy, to create a distinct port to the real proc server, and forward
all requests from this client on that port.
As my understanding, the proxy of proc server creates many different names for the port to the proc server and each name is used for each process.
I think I'll try it after I finish my current work.
I'm not very clear how to manipulate the port.
Here I need to create different names to access a port, so I need to get some unallocated names. Is this a right way to do it?
   mach_port_allocate (mach_task_self (), MACH_PORT_RIGHT_DEAD_NAME,
           &proc_port1);
   mach_port_destroy (mach_task_self (), proc_port1);
When I destroy a port of dead name, I get an unallocated name.
I don't see many example of using dead name in Hurd. I suppose the above is one way to use the dead name.
Unless I'm mistaken, the proc server doesn't really know where a request
comes from; it just distinguishes the clients by the port on which the
request is coming in...
I think it works in this way.

Zheng Da




reply via email to

[Prev in Thread] Current Thread [Next in Thread]