ELF_CNTL(3ELF) | ELF Library Functions | ELF_CNTL(3ELF) |
elf_cntl - control an elf file descriptor
cc [ flag ... ] file ... -lelf [ library ... ] #include <libelf.h> int elf_cntl(Elf *elf, Elf_Cmd cmd);
elf_cntl() instructs the library to modify its behavior with respect to an ELF descriptor, elf. As elf_begin(3ELF) describes, an ELF descriptor can have multiple activations, and multiple ELF descriptors may share a single file descriptor. Generally, elf_cntl() commands apply to all activations of elf. Moreover, if the ELF descriptor is associated with an archive file, descriptors for members within the archive will also be affected as described below. Unless stated otherwise, operations on archive members do not affect the descriptor for the containing archive.
The cmd argument tells what actions to take and may have the following values:
ELF_C_FDDONE
ELF_C_FDREAD
If elf_cntl() succeeds, it returns 0. Otherwise elf was NULL or an error occurred, and the function returns −1.
See attributes(7) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
Interface Stability | Stable |
MT-Level | MT-Safe |
elf(3ELF), elf_begin(3ELF), elf_getdata(3ELF), elf_rawfile(3ELF), libelf(3LIB), attributes(7)
If the program wishes to use the ``raw'' operations (see elf_rawdata(), which elf_getdata(3ELF) describes, and elf_rawfile(3ELF)) after disabling the file descriptor with ELF_C_FDDONE or ELF_C_FDREAD, it must execute the raw operations explicitly beforehand. Otherwise, the raw file operations will fail. Calling elf_rawfile() makes the entire image available, thus supporting subsequent elf_rawdata() calls.
July 11, 2001 | OmniOS |