*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> libelf/elf_cntl (3)              
Title
Content
Arch
Section
 

Contents


ELF_CNTL(3E)							  ELF_CNTL(3E)


NAME    [Toc]    [Back]

     elf_cntl -	control	a file descriptor

SYNOPSIS    [Toc]    [Back]

     cc	[flag ...] file	...  -lelf [library ...]

     #include <libelf.h>

     int elf_cntl(Elf *elf, Elf_Cmd cmd);

DESCRIPTION    [Toc]    [Back]

     elf_cntl instructs	the library to modify its behavior with	respect	to an
     ELF descriptor, elf.  As elf_begin(3E) 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
	       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 completed operations remains valid, but later file
	       operations, such	as the initial elf_getdata for a section, will
	       fail if the data	are not	in memory already.

     ELF_C_FDREAD
	       This command is similar to ELF_C_FDDONE,	except it forces the
	       library to read the rest	of the file.  A	program	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 zero.  Otherwise elf was null or an
     error occurred, and the function returns -1.

SEE ALSO    [Toc]    [Back]

      
      
     elf(3E), elf_begin(3E), elf_getdata(3E), elf_rawfile(3E).

NOTE    [Toc]    [Back]

     If	the program wishes to use the ``raw'' operations [see elf_rawdata,
     which elf_getdata(3E) describes, and elf_rawfile(3E)] 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


									Page 1






ELF_CNTL(3E)							  ELF_CNTL(3E)



     supporting	subsequent elf_rawdata calls.


									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
fcntl IRIX file and descriptor control
fcntl NetBSD file descriptor control
pxfisatty IRIX Determines if file descriptor corresponds to a valid file descriptor
fattach Tru64 Attach a STREAMS-based file descriptor to a file in the file system name space
fdetach Tru64 Detach a STREAMS-based file descriptor from a file in the file system name space
AFopenfile IRIX allocate an AFfilehandle structure for an audio file identified by name / by a Unix file descriptor
AFidentifyfd IRIX retrieve the audio file format of a file descriptor / open AFfilehandle
isfdtype Tru64 Test a file descriptor for a specific file type
AFgetfd IRIX get the Unix file descriptor for the file associated with an AFfilehandle structure
acl_set_fd Tru64 Sets the ACL on the file or directory designated by the file descriptor
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service