Current File : //usr/man/man3elf/elf_kind.3elf
'\" te
.\" Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
.\" Copyright 1989 AT&T
.TH elf_kind 3ELF "13 Aug 2010" "SunOS 5.11" "ELF Library Functions"
.SH NAME
elf_kind \- determine file type
.SH SYNOPSIS
.LP
.nf
cc [ \fIflag\fR ... ] \fIfile\fR ... \fB-lelf\fR [ \fIlibrary\fR ... ]
#include <libelf.h>

\fBElf_Kind\fR \fBelf_kind\fR(\fBElf *\fR\fIelf\fR);
.fi

.SH DESCRIPTION
.sp
.LP
This function returns a value identifying the kind of file associated with an \fBELF\fR descriptor (\fIelf\fR). Defined values are below:
.sp
.ne 2
.mk
.na
\fB\fBELF_K_AR\fR\fR
.ad
.RS 14n
.rt  
The file is an archive (see \fBar.h\fR(3HEAD)). An \fBELF\fR descriptor may also be associated with an archive \fImember\fR, not the archive itself, and then \fBelf_kind()\fR identifies the member's type.
.RE

.sp
.ne 2
.mk
.na
\fB\fBELF_K_ELF\fR\fR
.ad
.RS 14n
.rt  
The file is an \fBELF\fR file. The program may use \fBelf_getident()\fR to determine the class. Other functions, such as \fBelf32_getehdr()\fR, are available to retrieve other file information.
.RE

.sp
.ne 2
.mk
.na
\fB\fBELF_K_NONE\fR\fR
.ad
.RS 14n
.rt  
This indicates a kind of file unknown to the library.
.RE

.sp
.LP
Other values are reserved, to be assigned as needed to new kinds of files. \fIelf\fR should be a value previously returned by \fBelf_begin()\fR. A null pointer is allowed, to simplify error handling, and causes \fBelf_kind()\fR to return \fBELF_K_NONE\fR.
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp

.sp
.TS
tab() box;
cw(2.75i) |cw(2.75i) 
lw(2.75i) |lw(2.75i) 
.
ATTRIBUTE TYPEATTRIBUTE VALUE
_
Interface StabilityCommitted
_
MT-LevelMT-Safe
.TE

.SH SEE ALSO
.sp
.LP
\fBar.h\fR(3HEAD), \fBelf\fR(3ELF), \fBelf32_getehdr\fR(3ELF), \fBelf_begin\fR(3ELF), \fBelf_getident\fR(3ELF), \fBlibelf\fR(3LIB), \fBattributes\fR(5)