---
name: "elf64_fsize"
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/elf32_fsize"
---

# elf64\_fsize(3)

return the size of a file type

Part of [elf32\_fsize(3)](/elf32_fsize/3.md).

## NAME

**gelf\_fsize**, **elf32\_fsize**, **elf64\_fsize** – return the size of a file type

## LIBRARY

library “libelf”

## SYNOPSIS

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

*size\_t*\

**elf32\_fsize**(*Elf\_Type type*, *size\_t count*, *unsigned int version*);

*size\_t*\

**elf64\_fsize**(*Elf\_Type type*, *size\_t count*, *unsigned int version*);

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

*size\_t*\

**gelf\_fsize**(*Elf \*elf*, *Elf\_Type type*, *size\_t count*, *unsigned int version*);

## DESCRIPTION

These functions return the size in bytes of the file representation of *count* numbers of objects of ELF type *type*. For ELF types that are of variable length, these functions return a size of one byte.

Functions **elf32\_fsize**() and **elf64\_fsize**() return sizes for files of class ELFCLASS32 and ELFCLASS64 respectively. Function **gelf\_fsize**() returns the size for the class of ELF descriptor *elf*.

## RETURN VALUES

These functions return a non-zero value in case of success, or zero in case of an error.

## ERRORS

These functions may fail with:

- \[ELF\_E\_ARGUMENT\]

  Argument *elf* was NULL in a call to **gelf\_fsize**().

- \[ELF\_E\_ARGUMENT\]

  ELF descriptor *elf* had an unknown ELF class.

- \[ELF\_E\_ARGUMENT\]

  Argument *type* contained an illegal value.

- \[ELF\_E\_UNIMPL\]

  Support for ELF type *type* has not been implemented.

- \[ELF\_E\_VERSION\]

  Argument *version* is not a supported version.

## SEE ALSO

[elf(3)](/elf/3.md), [gelf(3)](/gelf/3.md)
