Re: Undefined symbol trying to use notify_server
Re: Undefined symbol trying to use notify_server
- Subject: Re: Undefined symbol trying to use notify_server
- From: Jim Magee <email@hidden>
- Date: Tue, 21 Oct 2003 00:51:16 -0400
On Oct 19, 2003, at 5:17 PM, email@hidden wrote:
extern boolean_t notify_server(
mach_msg_header_t *InHeadP,
mach_msg_header_t *OutHeadP);
as defined in mach/notify_server.h, when dealing with dead port
notification
for threads and tasks.
Yes, I am aware of TN2050, but I really prefer to do it this way, if
possible.
But when I try to build the project, I get link error:
Undefined symbols: _notify_server
Any help would be very much appreciated - thanks !
If you are trying to get process death notifications, and can live with
a Panther-only solution, I highly recommend using kqueue() over Mach
port death notifications.
But to answer the specific question you asked...
These "catcher" functions are not provided in any shared libraries by
default. This is for two reasons:
First, the way the Mach Interface Generator (MIG) produces code, the
shared library it resided in would have all sorts of unresolved
references to routines you would have to provide. That doesn't work
all that well with standard shared library construction techniques. We
could work around this by providing fake implementation that just
called dyld routines to find your real implementations (as is done with
the Mach exception server "catcher" routines) except...
Secondly, there are several MIG-controlled options that one may want to
turn on for these routines (security tokens to identify the sender,
sequence numbers for re-ordering mesages in a multi-threaded server,
etc...). Enabling these change the prototypes of the functions you
[the server-implementer] must provide and the prototype of the function
that the MIG generated server routine (like notify_server) will
dispatch to.
Because these MIG options may come into play more often for Mach port
notifications than for exceptions, we don't try to guess what options
you would want. We leave it up to you, the developer, to run the
appropriate .defs file through MIG (with the appropriate options
specified) and then compile and link the resulting code into your
application if you want to go this route.
--Jim
PS: It is important to note that all of Mach falls in the category of
SPI with respect to Mac OS X, but it clearly is a fundamental part of
Darwin.
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.