elf_cntl3
Perform control operations on an elf descriptor
Usage
#include <libelf.h> int elf_cntl(Elf *elf, Elf_Cmd cmd);
Overview
Perform control operations on the ELF descriptor elf according to the operation specified by cmd.
The following commands are supported:
ELF_C_FDDONE-
This command tells
libelfthat the application is done using the file descriptor associated with the elf object. The file descriptor may then be closed immediately without affecting the in-memory ELF data. Unless all data has been read from the file descriptor (seeELF_C_FDREADbelow) future operation on the Elf descriptor may fail.
ELF_C_FDREAD-
This command causes
libelfto read the entire contents of the underlying file into memory immediately.libelfgenerally reads and parses elements of ELF files only when they are required. This command instead triggerslibelfto read all elements immediately. Using this command ensures thatELF_C_FDDONEmay be used without causing future operations on the Elf descriptor to fail.
Return value
On success, returns 0.
On failure, it returns -1 and sets an error that can be retrieved with elf_errmsg(3).
Attributes
| Interface Attribute Value |
| elf_cntl() |