DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

elf_kind(S-osr5)


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-osr5). A null pointer is allowed, to simplify error handling; it makes elf_kind(S-osr5) 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-osr5) to determine the class. You can use other functions, such as elf_getehdr(S-osr5), 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-osr5).

See also

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

Standards conformance

elf_kind(S-osr5) is not part of any currently supported standard; it was developed by UNIX System Laboratories, Inc. and is maintained by The SCO Group.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005