MirOS Manual: dl_iterate_phdr(3)

DL_ITERATE_PHDR(3)         BSD Programmer's Manual          DL_ITERATE_PHDR(3)

NAME

     dl_iterate_phdr - iterate over program headers

SYNOPSIS

     #include <link.h>

     int
     dl_iterate_phdr(int (*callback)(struct dl_phdr_info *, size_t, void*),
             void *data);

DESCRIPTION

     The dl_iterate_phdr() function iterates over all shared objects loaded
     into a process's address space, calling callback for each shared object,
     passing it information about the object's program headers and the data
     argument. The information about the program headers is passed in a struc-
     ture that is defined as:

     struct dl_phdr_info {
             Elf_Addr        dlpi_addr;
             const char      *dlpi_name;
             const Elf_Phdr  *dlpi_phdr;
             Elf_Half        dlpi_phnum;
     };

     The members of struct dl_phdr_info have the following meaning:

     dlpi_addr     The base address at which the shared object is mapped into
                   the address space of the calling process.

     dlpi_name     The name of the shared object.

     dlpi_phdr     A pointer to the shared object's program headers.

     dlpi_phnum    The number of program headers in the shared object.

     Future versions of OpenBSD might add more members to this structure. To
     make it possible for programs to check whether any new members have been
     added, the size of the structure is passed as an argument to callback.

SEE ALSO

     ld(1), ld.so(1), dlfcn(3), elf(5)

HISTORY

     The dl_iterate_phdr function first appeared in OpenBSD 3.7.

MirOS BSD #10-current          January 17, 2005                              1

Generated on 2017-04-03 16:26:17 by $MirOS: src/scripts/roff2htm,v 1.88 2017/01/29 00:51:06 tg Exp $

These manual pages and other documentation are copyrighted by their respective writers; their source is available at our CVSweb, AnonCVS, and other mirrors. The rest is Copyright © 2002–2017 The MirOS Project, Germany.
This product includes material provided by mirabilos.

This manual page’s HTML representation is supposed to be valid XHTML/1.1; if not, please send a bug report — diffs preferred.