This manual page is for Mac OS X version 10.6.3

If you are running a different version of Mac OS X, view the documentation locally:

  • In Terminal, using the man(1) command

Reading manual pages

Manual pages are intended as a quick reference for people who already understand a technology.

  • For more information about the manual page format, see the manual page for manpages(5).

  • For more information about this technology, look for other documentation in the Apple Reference Library.

  • For general information about writing shell scripts, read Shell Scripting Primer.



DLADDR(3)                               BSD Library Functions Manual                               DLADDR(3)

NAME
     dladdr -- find the image containing a given address

SYNOPSIS
     #include <dlfcn.h>

     int
     dladdr(const void* addr, Dl_info* 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* dli_fname     The pathname of the shared object containing the address.

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

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

     void* dli_saddr           The value of the symbol returned in dli_sname.

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

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

     If the image containing addr is found, but no nearest symbol was found, the dli_sname and dli_saddr
     fields are set to NULL.

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 <jacereda@users.source-
     forge.net> and Peter O'Gorman <ogorman@users.sourceforge.net>.

     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 implementation.  The following bugs are
     present:

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

BSD                                          September 24, 2004                                          BSD

Reporting Problems

The way to report a problem with this manual page depends on the type of problem:

Content errors
Report errors in the content of this documentation with the feedback links below.
Bug reports
Report bugs in the functionality of the described tool or API through Bug Reporter.
Formatting problems
Report formatting mistakes in the online version of these pages with the feedback links below.

Did this document help you? Yes It's good, but... Not helpful...