Bug 94141 - man page for dl_iterate_phdr() does not mention current-executable-first iteration pattern
Summary: man page for dl_iterate_phdr() does not mention current-executable-first iter...
Status: RESOLVED CODE_FIX
Alias: None
Product: Documentation
Classification: Unclassified
Component: man-pages (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: documentation_man-pages@kernel-bugs.osdl.org
URL: http://linux.die.net/man/3/dl_iterate...
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-02 19:14 UTC by Simon Que
Modified: 2016-03-11 19:30 UTC (History)
1 user (show)

See Also:
Kernel Version:
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Simon Que 2015-03-02 19:14:04 UTC
When I was using dl_iterate_phdr(), I noticed that the currently running executable wasn't showing up by name. And the first object visited by the iteration was unnamed.

According to this Stack Overflow page, the first object will always be the current executable:
http://stackoverflow.com/questions/8875876/getting-the-elf-header-of-the-main-executable

But I didn't find any mention of this behavior in the official documentation:
http://linux.die.net/man/3/dl_iterate_phdr
Comment 1 Michael Kerrisk 2016-03-11 19:30:01 UTC
I added some text to the man page to note this:

       The first object visited by callback is the main program.   For
       the main program, the dlpi_name field will be an empty string.

Closing this bug.

Note You need to log in before you can comment on or make changes to this bug.