• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: problem calling Mach RPC function
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problem calling Mach RPC function


  • Subject: Re: problem calling Mach RPC function
  • From: Antoine Missout <email@hidden>
  • Date: Wed, 30 Jun 2010 10:32:48 -0400

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.

Also read Mac OS X Internals : http://www.osxbook.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
References: 
 >problem calling Mach RPC function (From: Bill Appleton <email@hidden>)
 >Re: problem calling Mach RPC function (From: Bill Appleton <email@hidden>)
 >Re: problem calling Mach RPC function (From: Bill Appleton <email@hidden>)

  • Prev by Date: Re: kext version handling
  • Next by Date: ptrace / task_for_pid / pid_suspend
  • Previous by thread: Re: problem calling Mach RPC function
  • Next by thread: kext version handling
  • Index(es):
    • Date
    • Thread