Create a daemon, add a MachServices dictionary with a proper identifier. See man 5 launchd.plist
In the client code, use bootstrap_look_up with the identifier to get the daemon port.
Then call the function using that port as the first parameter.
Regarding Mach RPC, the best documentation you'll find is by reading source code on opensource.apple.com.
- Antoine
On 2010-06-18, at 1:54 PM, Bill Appleton wrote: hi all,
i have seen bootstrap_look_up -- is there any documentation on this?
is there any other way to discover a port?
thx
bill
On Fri, Jun 18, 2010 at 8:59 AM, Bill Appleton <email@hidden> wrote:
Hi All,
I managed to build my own files with Mig and the compile and link.
Now I am uncertain about what port to specify in this function.
simpleroutine PCSetModal(clientPort :mach_port_t;
modal :boolean_t);
does anyone know the value for the first argument? do i need to find the port from a name server or something?
thanks,
Bill Appleton
On Fri, Jun 18, 2010 at 7:52 AM, Bill Appleton <email@hidden> wrote:
Hi All,
I have read all about calling mach RPC functions and realize it is supposed to be easy, but when I include the header and try to call the function I am getting a link error.
here is the function i need from the "defs" Mig definition file:
simpleroutine PCSetModal(clientPort :mach_port_t; modal :boolean_t);
here is the definition i found in the generated .h file:
/* SimpleRoutine PCSetModal */ #ifdef mig_external
mig_external #else extern #endif /* mig_external */ kern_return_t WKPCSetModal ( mach_port_t clientPort, boolean_t modal );
but that stuff above just looks like an external fx definition, which triggers the link error. it seems like it needs to drag in all the RPC magic code somehow.
Maybe I have the wrong header? It doesn't look like it has all I need...
Maybe I need to generate my own header from the Mig file? Any help would be appreciated.
thanks,
Bill Appleton
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
|