site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha1; c=relaxed; d=alastairs-place.net; h= subject:mime-version:content-type:from:in-reply-to:date:cc: content-transfer-encoding:message-id:references:to; q=dns/txt; s= aug07; bh=HA14X7D5H0lQqwZHHP0hCKWA5vc=; b=NbPoZZQCE9w7VgoI0xdx8w ye5q1ZXWrSFBIHTgcbe0Jmzk45uy1BPDvk7r3p7x8akgWjZusK9YxyH4qrmWnpqV /scbaGJbaZ8IkLxIiz5vyja1F4y67+98MsN2zFBaFfPyvaVPawseekJWJGVHhpvK lXc34x0JnpXxIm3hjGEEY= 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: <http://alastairs-place.net/2009/11/cross-process_s/> 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. Kind regards, Alastair. -- http://alastairs-place.net _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
Alastair Houghton