from small one page howto to huge articles all in one place

search text in:




Other .linuxhowtos.org sites:gentoo.linuxhowtos.org



Last additions:
using iotop to find disk usage hogs

using iotop to find disk usage hogs

words:

887

views:

209581

userrating:


May 25th. 2007:
Words

486

Views

258588

why adblockers are bad


Workaround and fixes for the current Core Dump Handling vulnerability affected kernels

Workaround and fixes for the current Core Dump Handling vulnerability affected kernels

words:

161

views:

149878

userrating:


April, 26th. 2006:

Druckversion
You are here: manpages





ELF_GETSHDRNUM

Section: Libelf Programmer's Manual (3)
Updated: 202-0-30
Index Return to Main Contents

 

NAME

elf_getshdrnum, elf_getshnum - retrieve the number of section headers in an ELF file  

SYNOPSIS

#include <libelf.h>

int elf_getshdrnum(Elf *elf, size_t *dst);
int elf_getshnum(Elf *elf, size_t *dst); (deprecated)

 

DESCRIPTION

The elf_getshdrnum() function stores the number of section headers (sections) associated with the ELF descriptor elf into the variable pointed to by dst.

It transparently handles both standard and extended section header counts. If the number of section headers exceeds the representable range of the e_shnum field in the ELF header, the ELF specification allows encoding the true count in section header 0’s sh_size field, and sets e_shnum to 0. This function transparently handles that case.

The function elf_getshnum() is a deprecated alias for elf_getshdrnum() and should not be used in new code (see HISTORY).

 

PARAMETERS

elf
A pointer to an Elf descriptor opened with elf_begin(3). The descriptor must represent a file of kind ELF_K_ELF . If NULL, the function returns -1 without setting elf_errno.

dst
Pointer to a size_t variable. On success, the number of section headers is written here. Must not be NULL.

 

RETURN VALUE

Returns 0 on success and stores the result in dst. Returns -1 on failure.

 

SEE ALSO

elf32_getshdr(3), elf64_getshdr(3), libelf(3), elf(5)

 

ATTRIBUTES

InterfaceAttributeValue
elf_getshdrnum(),~elf_getshnum() Thread safetyM-Safe

 

REPORTING BUGS

Report bugs to <elfutil-devel@sourceware.org> or https://sourceware.org/bugzilla/.

 

HISTORY

elf_getshdrnum first appeared in elfutils 0.142. This function was added due to elf_getshnum return value inconsistencies between different libelf implementations. elf_getshdrnum was introduced to ensure that 0 is returned on success across all libelf implementations.


 

Index

NAME
SYNOPSIS
DESCRIPTION
PARAMETERS
RETURN VALUE
SEE ALSO
ATTRIBUTES
REPORTING BUGS
HISTORY





Support us on Content Nation
rdf newsfeed | rss newsfeed | Atom newsfeed
- Powered by LeopardCMS - Running on Gentoo -
Copyright 2004-2025 Sascha Nitsch Unternehmensberatung GmbH
Valid XHTML1.1 : Valid CSS
- Level Triple-A Conformance to Web Content Accessibility Guidelines 1.0 -
- Copyright and legal notices -
Time to create this page: 13.2 ms