On 17 Nov 2009, at 17:27, Uli Kusterer wrote:
> In case of suggestion #3, the application that used to call bootstrap_register only has the pid of the target application to which to "send a Mach send-right directly".
> In order to send a Mach send right however one needs a send right itself to a port to which the target application has receive rights. In order to get that send right, the target application itself also needs to send this application a Mach send right, however in order send that send right it also needs a send right to send it and the loop never ends.
> Does anyone know what paragraph 3) means to achieve and how, possibly with a short example?
:-) I think paragraph 3 is a bit bonkers, for the reason you give. You need a send right to a port in the target task in order to send a send right. Presumably the assumption is that someone may have *had* a send right already and decided to send a name via a separate route for some reason instead, though why you would do that is beyond me.
If you only have a pid, you plainly can't send a send right. What you need to do is something like the example I posted on my blog the other day:
That is, use a server to register and name your send rights.
As Tyler Sample pointed out to me today, you *could* use the bootstrap server for that purpose, but it's a little evil because you need to use bootstrap_register() (or something similar), and putting random ports in the bootstrap namespace seems a little evil to me. I prefer the separate server approach.
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden