elf_errno(3)

elf_errno3

Retrieve the error code of the last failing libelf function call.

Usage

#include <libelf.h>

int elf_errno(void);

Overview

The elf_errno function retrieves the error code of the last failing libelf library function. This error code indicates the type of error that occurred during the failing function call. Each thread maintains its own separate error code.

Parameters

This function does not take any parameters.

Return value

The elf_errno function returns an integer representing the most recent error code for the current thread. If no error has occurred, it returns 0. If an error occurred, the function returns a non-zero error code that corresponds to the specific error. Error codes can be passed to elf_errmsg in order to create a string describing the error.

Releases

Unchanged in 2 releases since Debian 13 (Trixie).

  1. 13–Arch

Reporting bugs

Report bugs to <[email protected]> or https://sourceware.org/bugzilla/.

From libelf 0.197-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.