Merge commit 'dc97a43d4a70c8773a619f11b95b07a787f6f5b7' into merges
[unleashed.git] / share / man / man3elf / elf_kind.3elf
blobc3166de41e71f73b410bd2f1fe01561e2ae2aad2
1 '\" te
2 .\"  Copyright 1989 AT&T  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH ELF_KIND 3ELF "Jul 11, 2001"
7 .SH NAME
8 elf_kind \- determine file type
9 .SH SYNOPSIS
10 .LP
11 .nf
12 cc [ \fIflag\fR ... ] \fIfile\fR ... \fB-lelf\fR [ \fIlibrary\fR ... ]
13 #include <libelf.h>
15 \fBElf_Kind\fR \fBelf_kind\fR(\fBElf *\fR\fIelf\fR);
16 .fi
18 .SH DESCRIPTION
19 .sp
20 .LP
21 This function returns a value identifying the kind of file associated with an
22 \fBELF\fR descriptor (\fIelf\fR). Defined values are below:
23 .sp
24 .ne 2
25 .na
26 \fB\fBELF_K_AR\fR\fR
27 .ad
28 .RS 14n
29 The file is an archive [see \fBar.h\fR(3HEAD)]. An \fBELF\fR descriptor may
30 also be associated with an archive \fImember\fR, not the archive itself, and
31 then \fBelf_kind()\fR identifies the member's type.
32 .RE
34 .sp
35 .ne 2
36 .na
37 \fB\fBELF_K_COFF\fR\fR
38 .ad
39 .RS 14n
40 The file is a \fBCOFF\fR object file. \fBelf_begin\fR(3ELF) describes the
41 library's handling for \fBCOFF\fR files.
42 .RE
44 .sp
45 .ne 2
46 .na
47 \fB\fBELF_K_ELF\fR\fR
48 .ad
49 .RS 14n
50 The file is an \fBELF\fR file. The program may use \fBelf_getident()\fR to
51 determine the class. Other functions, such as \fBelf32_getehdr()\fR, are
52 available to retrieve other file information.
53 .RE
55 .sp
56 .ne 2
57 .na
58 \fB\fBELF_K_NONE\fR\fR
59 .ad
60 .RS 14n
61 This indicates a kind of file unknown to the library.
62 .RE
64 .sp
65 .LP
66 Other values are reserved, to be assigned as needed to new kinds of files.
67 \fIelf\fR should be a value previously returned by \fBelf_begin()\fR. A null
68 pointer is allowed, to simplify error handling, and causes \fBelf_kind()\fR to
69 return \fBELF_K_NONE\fR.
70 .SH ATTRIBUTES
71 .sp
72 .LP
73 See \fBattributes\fR(5) for descriptions of the following attributes:
74 .sp
76 .sp
77 .TS
78 box;
79 c | c
80 l | l .
81 ATTRIBUTE TYPE  ATTRIBUTE VALUE
83 Interface Stability     Stable
85 MT-Level        MT-Safe
86 .TE
88 .SH SEE ALSO
89 .sp
90 .LP
91 \fBar.h\fR(3HEAD), \fBelf\fR(3ELF), \fBelf32_getehdr\fR(3ELF),
92 \fBelf_begin\fR(3ELF), \fBelf_getident\fR(3ELF), \fBlibelf\fR(3LIB),
93 \fBattributes\fR(5)