elf_kind(3E) elf_kind(3E)
NAME
elfkind - determine file type
SYNOPSIS
cc [flag ...] file ... -lelf [library ...]
#include <libelf.h>
ElfKind elfkind(Elf *elf);
DESCRIPTION
This function returns a value identifying the kind of file associated
with an ELF descriptor, elf. Currently defined values appear below.
ELFKAR
The file is an archive [see ar(4)]. An ELF descriptor may also be
associated with an archive member, not the archive itself, and
then elfkind() identifies the member's type.
ELFKCOFF
The file is a COFF object file. elfbegin(3E) describes the
library's handling for COFF files.
ELFKELF
The file is an ELF file. The program may use elfgetident() to
determine the class. Other functions, such as elfgetehdr(), are
available to retrieve other file information.
ELFKNONE
This indicates a kind of file unknown to the library.
Other values are reserved, to be assigned as needed to new kinds of
files. elf should be a value previously returned by elfbegin(). A
null pointer is allowed, to simplify error handling, and causes
elfkind() to return ELFKNONE.
SEE ALSO
elf(3E), elfbegin(3E), elfgetehdr(3E), elfgetident(3E), ar(4).
Page 1 Reliant UNIX 5.44 Printed 11/98