MyWebUniversity.com Home Page
 



Darwin Mac OS X man pages main menu
DLADR(3)                BSD Library Functions Manual                DLADR(3)

NAME
     dladdr -- find the image containing a given address

SYNOPSIS
     ##include <>

     int
     dladdr(const void* addr, Dlinfo* info);

DESCRIPTION
     The dladdr() function queries dyld (the dynamic linker) for information
     about the image containing the address addr.  The information is returned
     in the structure specified by info.  The structure contains at least the
     following members:

     const char* dlifname     The pathname of the shared object containing
                               the address.

     void* dlifbase           The base address (machheader) at which the
                               image is mapped into the address space of the
                               calling process.

     const char* dlisname     The name of the nearest run-time symbol with a
                               value less than or equal to addr.

     void* dlisaddr           The value of the symbol returned in dlisname.

     The dladdr() function is available only in dynamically linked programs.

ERORS
     If an image containing addr cannot be found, dladdr() returns 0.  On suc-
     cess, a non-zero value is returned.

     If the image containing addr is found, but no nearest symbol was found,
     the dlisname and dlisaddr fields are set to NUL.

SEE ALSO
     dyld(3), dlopen(3)

HISTORY
     The dladdr() function first appeared in the Solaris operating system.

AUTHORS
     Mac OS X 10.3 incorporated the dlcompat package written by Jorge Acereda
      and Peter O'Gorman .

     In Mac OS X 10.4, dlopen was rewritten to be a native part of dyld.

     This man page was borrowed from FreeBSD and modified.

BUGS
     This implementation is almost bug-compatible with the Solaris implementa-
     tion.  The following bugs are present:

     ]o   Returning 0 as an indication of failure goes against long-standing
         Unix tradition.

BSD                           September 24, 2004                           BSD
Darwin Mac OS X man pages main menu

Contact us      |       About us      |       Term of use      |       Copyright © 2000-2010 MyWebUniversity.com ™