File: elf_rand.3

package info (click to toggle)
elfutils 0.194-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 27,680 kB
  • sloc: ansic: 114,970; sh: 35,537; cpp: 4,998; makefile: 1,986; yacc: 1,388; lex: 130; asm: 77; sed: 39; awk: 35
file content (71 lines) | stat: -rw-r--r-- 1,341 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
.TH ELF_RAND 3 2025-06-30 "Libelf" "Libelf Programmer's Manual"

.SH NAME
elf_rand - Set the offset for the next archive member in an ELF file.

.SH SYNOPSIS
.nf
#include <libelf.h>

.BI "size_t elf_rand(Elf *" elf ", size_t " offset ");"
.fi

.SH DESCRIPTION
The
.BR elf_rand ()
function sets the current archive member offset for the ELF archive descriptor
.I elf
to
.IR offset .

This function is only valid when
.I elf
refers to an archive descriptor (i.e., its kind is
.BR ELF_K_AR ).

Archive member offsets can be acquired from the
.I Elf_Arsym
array returned by
.BR elf_getarsym (3).

If the archive header at the given offset cannot be parsed or validated,
then 0 is returned.

.SH PARAMETERS
.TP
.I elf
A pointer to an ELF archive descriptor.

.TP
.I offset
A byte offset to the archive header, indicating the desired member position.

.SH RETURN VALUE
Returns the input
.I offset
if successful. Returns 0 if
.I elf
is NULL, is not an archive descriptor, or if an error occurs while reading the member at
.IR offset .

.SH SEE ALSO
.BR elf_getarsym (3),
.BR elf_next (3),
.BR libelf (3),
.BR elf (5)

.SH ATTRIBUTES
.TS
allbox;
lbx lb lb
l l l.
Interface	Attribute	Value
T{
.na
.nh
.BR elf_rand ()
T}	Thread safety	MT-Safe
.TE

.SH REPORTING BUGS
Report bugs to <elfutils-devel@sourceware.org> or https://sourceware.org/bugzilla/.