---
name: "elf_ndxscn"
section: "3"
platform: "linux"
package: "libelf"
version: "0.197-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/elf_ndxscn"
---

# elf\_ndxscn(3)

retrieve the index of a descriptor for an ELF file section

## NAME

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

## SYNOPSIS

**#include \<libelf.h\>**

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

## DESCRIPTION

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

## PARAMETERS

- *scn*

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

## 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

[**libelf**(3)](/libelf/3.md), [**elf**(5)](/elf/5.md)

## ATTRIBUTES

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

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

## REPORTING BUGS

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