elf_cntl man page on SmartOS

Man page or keyword search:  
man Server   16655 pages
apropos Keyword Search (all sections)
Output format
SmartOS logo
[printable version]


       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  ar‐

       The  cmd argument tells what actions to take and may have the following

		       This value tells	 the  library  not  to	use  the  file
		       descriptor  associated  with  elf. A program should use
		       this command when it has requested all the  information
		       it  cares  to  use  and wishes to avoid the overhead of
		       reading the rest of the file. The memory for  all  com‐
		       pleted  operations remains valid, but later file opera‐
		       tions, such as the initial elf_getdata() for a section,
		       will fail if the data are not in memory already.

		       This  command  is  similar  to  ELF_C_FDDONE, except it
		       forces the library to read the rest of the file. A pro‐
		       gram  should  use  this	command when it must close the
		       file descriptor but has	not  yet  read	everything  it
		       needs  from  the	 file.	After elf_cntl() completes the
		       ELF_C_FDREAD  command,  future  operations,   such   as
		       elf_getdata(),  will use the memory version of the file
		       without needing to use the file descriptor.

       If elf_cntl() succeeds, it returns 0. Otherwise	elf  was  NULL	or  an
       error occurred, and the function returns −1.

       See attributes(5) for descriptions of the following attributes:

       │Interface Stability │ Stable	      │
       │MT-Level	    │ MT-Safe	      │

       elf(3ELF),   elf_begin(3ELF),   elf_getdata(3ELF),   elf_rawfile(3ELF),
       libelf(3LIB), attributes(5)

       If the program wishes to use the ``raw'' operations (see elf_rawdata(),
       which  elf_getdata(3ELF)	 describes,  and elf_rawfile(3ELF)) after dis‐
       abling 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.

				 Jul 11, 2001			ELF_CNTL(3ELF)

List of man pages available for SmartOS

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
Vote for polarhome
Free Shell Accounts :: the biggest list on the net