DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

elf_kind(S)


elf_kind -- determine file type

Syntax

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

#include <libelf.h>

Elf_Kind elf_kind(Elf *elf);

Description

This function returns a value identifying the kind of file associated with an ELF descriptor elf. (See ``Return values''.) Other values are reserved, to be assigned to new kinds of files. elf should be a value previously returned by elf_begin(S). A null pointer is allowed, to simplify error handling; it makes elf_kind(S) return ELF_K_NONE.

Return values

Currently defined values appear below.

ELF_K_AR
The file is an archive (see ar(FP)). An ELF descriptor may also be associated with an archive member, not the archive itself, and then elf_kind( ) identifies the member's type.

ELF_K_COFF
The file is a COFF object file. elf_begin( ) describes the library's handling for COFF files.

ELF_K_ELF
The file is an ELF file. The program can use elf_getident(S) to determine the class. You can use other functions, such as elf_getehdr(S), to retrieve other file information.

ELF_K_NONE
This indicates a kind of file unknown to the library.

Diagnostics

Error conditions are identified through the routine elf_error(S).

See also

ar(FP), elf(S), elf_begin(S), elf_getehdr(S), elf_getident(S)

Standards conformance

elf_kind(S) is not part of any currently supported standard; it was developed by UNIX System Laboratories, Inc. and is maintained by The SCO Group.
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003