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:

209580

userrating:


May 25th. 2007:
Words

486

Views

258587

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:

149876

userrating:


April, 26th. 2006:

Druckversion
You are here: manpages





ELF_GETIDENT

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

 

NAME

elf_getident - return the ELF identification bytes  

SYNOPSIS

#include <libelf.h>

char * elf_getident(Elf *elf, size_t *nbytes);
 

DESCRIPTION

The elf_getident() function returns a pointer to the 1-byte ELF identification array from the ELF header of the given descriptor elf.

This identification data begins with the magic number `177ELF` and includes the class, data encoding, ELF version, OS ABI, and ABI version fields. It corresponds to the first EI_NIDENT bytes of the ELF header and can be accessed via the e_ident field of either Elf32_Ehdr or Elf64_Ehdr .

If elf is a valid descriptor for an ELF object, the function returns a pointer to the internal buffer containing the header's identification bytes. The buffer is owned by the library and must not be modified or freed by the caller.

If nbytes is not NULL, the function sets to EI_NIDENT (16), the length in bytes of the returned identifier.

 

PARAMETERS

elf
Pointer to an Elf descriptor referring to a valid ELF object. If the descriptor does not represent an ELF object file (is NULL or elf_kind() is not ELF_K_ELF ), NULL is returned.

nbytes
Optional pointer to a size_t variable. If no-NULL, it will be set to the length of the returned buffer (always EI_NIDENT on success, 0 on failure).

 

RETURN VALUE

Returns a pointer to the internal 1-byte e_ident buffer on success and NULL on failure. Does not set elf_errno.

This buffer is indexed using the EI_CLASS, EI_DATA, EI_VERSION, EI_OSABI, and EI_ABIVERSION macros found in elf.h. Also see elf(5).

 

SEE ALSO

libelf(3), elf(5)

 

ATTRIBUTES

InterfaceAttributeValue
elf_getident() Thread safetyM-Safe

 

REPORTING BUGS

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


 

Index

NAME
SYNOPSIS
DESCRIPTION
PARAMETERS
RETURN VALUE
SEE ALSO
ATTRIBUTES
REPORTING BUGS





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: 12.2 ms