| Current File : //usr/man/man3elf/elf_getarhdr.3elf |
'\" te
.\" Copyright 1989 AT&T Copyright (c) 2001, Sun Microsystems, Inc. All Rights Reserved
.TH elf_getarhdr 3ELF "11 Jul 2001" "SunOS 5.11" "ELF Library Functions"
.SH NAME
elf_getarhdr \- retrieve archive member header
.SH SYNOPSIS
.LP
.nf
cc [ \fIflag\fR ... ] \fIfile\fR ... \fB-lelf\fR [ \fIlibrary\fR... ]
#include <libelf.h>
\fBElf_Arhdr *\fR\fBelf_getarhdr\fR(\fBElf *\fR\fIelf\fR);
.fi
.SH DESCRIPTION
.sp
.LP
\fBelf_getarhdr()\fR returns a pointer to an archive member header, if one is available for the \fBELF\fR descriptor \fIelf\fR. Otherwise, no archive member header exists, an error occurred, or \fIelf\fR was null; \fBelf_getarhdr()\fR then returns a null value. The header includes the following members.
.sp
.in +2
.nf
char *ar_name;
time_t ar_date;
uid_t ar_uid;
gid_t ar_gid;
mode_t ar_mode;
off_t ar_size;
char *ar_rawname;
.fi
.in -2
.sp
.LP
An archive member name, available through \fBar_name\fR, is a null-terminated string, with the \fBar\fR format control characters removed. The \fBar_rawname\fR member holds a null-terminated string that represents the original name bytes in the file, including the terminating slash and trailing blanks as specified in the archive format.
.sp
.LP
In addition to ``regular'' archive members, the archive format defines some special members. All special member names begin with a slash (\fB/\fR), distinguishing them from regular members (whose names may not contain a slash). These special members have the names (\fBar_name\fR) defined below.
.sp
.ne 2
.mk
.na
\fB\fB/\fR\fR
.ad
.RS 6n
.rt
This is the archive symbol table. If present, it will be the first archive member. A program may access the archive symbol table through \fBelf_getarsym()\fR. The information in the symbol table is useful for random archive processing (see \fBelf_rand()\fR on \fBelf_begin\fR(3ELF)).
.RE
.sp
.ne 2
.mk
.na
\fB\fB//\fR\fR
.ad
.RS 6n
.rt
This member, if present, holds a string table for long archive member names. An archive member's header contains a 16-byte area for the name, which may be exceeded in some file systems. The library automatically retrieves long member names from the string table, setting \fBar_name\fR to the appropriate value.
.RE
.sp
.LP
Under some error conditions, a member's name might not be available. Although this causes the library to set \fBar_name\fR to a null pointer, the \fBar_rawname\fR member will be set as usual.
.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), \fBelf_begin\fR(3ELF), \fBelf_getarsym\fR(3ELF), \fBlibelf\fR(3LIB), \fBattributes\fR(5)