kernel: bwrite_common's 3rd & 4th args can be bools
[unleashed.git] / share / man / man3elf / nlist.3elf
blobbb804a9a845e1ff4b6c915063a33cf663a2c4b88
1 '\" te
2 .\"  Copyright 1989 AT&T Copyright (c) 2001, 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. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
4 .\"  See the License for the specific language governing permissions and limitations under the License. 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
5 .\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH NLIST 3ELF "Jul 11, 2001"
7 .SH NAME
8 nlist \- get entries from name list
9 .SH SYNOPSIS
10 .LP
11 .nf
12 cc [ \fIflag\fR... ] \fIfile\fR ... \fB-lelf\fR [ \fIlibrary\fR ... ]
13 #include <nlist.h>
15 \fBint\fR \fBnlist\fR(\fBconst char *\fR\fIfilename\fR, \fBstruct nlist *\fR\fInl\fR);
16 .fi
18 .SH DESCRIPTION
19 .sp
20 .LP
21 \fBnlist()\fR examines the name list in the executable file whose name is
22 pointed to by \fIfilename\fR, and selectively extracts a list of values and
23 puts them in the array of \fBnlist()\fR structures pointed to by \fBnl\fR. The
24 name list \fBnl\fR consists of an array of structures containing names of
25 variables, types, and values. The list is terminated with a null name, that is,
26 a null string is in the name position of the structure. Each variable name is
27 looked up in the name list of the file. If the name is found, the type, value,
28 storage class, and section number of the name are inserted in the other fields.
29 The type field may be set to 0 if the file was not compiled with the \fB-g\fR
30 option to  \fBcc\fR.
31 .sp
32 .LP
33 \fBnlist()\fR will always return the information for an external symbol of a
34 given name if the name exists in the file. If an external symbol does not
35 exist, and there is more than one symbol with the specified name  in the file
36 (such as static symbols defined in separate files), the values returned will be
37 for the last occurrence of that name in the file. If the name is not found, all
38 fields in the structure except \fBn_name\fR are set to 0.
39 .sp
40 .LP
41 This function is useful for examining the system name list kept in the file
42 \fB/dev/ksyms\fR. In this way programs can obtain system addresses that are up
43 to date.
44 .SH RETURN VALUES
45 .sp
46 .LP
47 All value entries are set to 0 if the file cannot be read or if it does not
48 contain a valid name list.
49 .sp
50 .LP
51 \fBnlist()\fR returns 0 on success, \(mi1 on error.
52 .SH ATTRIBUTES
53 .sp
54 .LP
55 See \fBattributes\fR(5) for descriptions of the following attributes:
56 .sp
58 .sp
59 .TS
60 box;
61 c | c
62 l | l .
63 ATTRIBUTE TYPE  ATTRIBUTE VALUE
65 Interface Stability     Stable
67 MT-Level        Safe
68 .TE
70 .SH SEE ALSO
71 .sp
72 .LP
73 \fBelf\fR(3ELF), \fBkvm_nlist\fR(3KVM), \fBkvm_open\fR(3KVM),
74 \fBlibelf\fR(3LIB), \fBa.out\fR(4), \fBattributes\fR(5), \fBksyms\fR(7D),
75 \fBmem\fR(7D)