---
name: "gelf_getclass"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/gelf_getclass"
---

# gelf\_getclass(3)

retrieve the class of an ELF descriptor

## NAME

**gelf\_getclass** – retrieve the class of an ELF descriptor

## LIBRARY

library “libelf”

## SYNOPSIS

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

*int*\

**gelf\_getclass**(*Elf \*elf*);

## DESCRIPTION

Function **gelf\_getclass**() returns the ELF class of the descriptor supplied in argument *elf*.

## RETURN VALUES

Function **gelf\_getclass**() will return one of ELFCLASS32 or ELFCLASS64 if the argument *elf* is a descriptor for an ELF file. The value ELFCLASSNONE is returned if argument *elf* was null, or if it was not a descriptor for an ELF file.

## SEE ALSO

[elf(3)](/elf/3.md), [elf\_kind(3)](/elf_kind/3.md), [gelf(3)](/gelf/3.md)
