ELF\_NDXSCN(3) Libelf Programmer's Manual ELF\_NDXSCN(3)

# [NAME](#NAME)

elf\_ndxscn - retrieve the index of a descriptor for an ELF file section

# [SYNOPSIS](#SYNOPSIS)

**#include &lt;libelf.h&gt;**

**size\_t elf\_ndxscn(Elf\_Scn \*scn);**

# [DESCRIPTION](#DESCRIPTION)

The **elf\_ndxscn** function retrieves the index of the section descriptor referred to by *scn.*

# [PARAMETERS](#PARAMETERS)

[*scn*](#scn)

An *Elf\_Scn* pointer to the section descriptor whose index is to be retrieved.

# [RETURN VALUE](#RETURN_VALUE)

The **elf\_ndxscn** function returns the index of the section descriptor. If *scn* is NULL, it returns **SHN\_UNDEF.** **SHN\_UNDEF** is zero.

# [SEE ALSO](#SEE_ALSO)

[**libelf**(3)](/man/os/elfutils/libelf.3), [**elf**(5)](/man/os/elfutils/elf.5)

# [ATTRIBUTES](#ATTRIBUTES)

For an explanation of the terms used in this section, see [**attributes**(7)](/man/os/elfutils/attributes.7).

**Interface** **Attribute** **Value** elf\_ndxscn () Thread safety MT-Safe

# [REPORTING BUGS](#REPORTING_BUGS)

Report bugs to &lt;elfutils-devel@sourceware.org&gt; or https://sourceware.org/bugzilla/.

2024-07-18 Libelf

---

Document: elf_ndxscn(3) from elfutils 0.196-r1 (Chainguard OS)
Source: https://sourceware.org/git/elfutils.git
