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

# dwarf\_attroffset(3)

retrieve the section-relative offset of an attribute descriptor

## NAME

**dwarf\_attroffset** – retrieve the section-relative offset of an attribute descriptor

## LIBRARY

library “libdwarf”

## SYNOPSIS

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

*int*\

**dwarf\_attroffset**(*Dwarf\_Attribute at*, *Dwarf\_Off \*ret\_off*, *Dwarf\_Error \*err*);

## DESCRIPTION

Function **dwarf\_attroffset**() retrieves the section-relative offset of the attribute descriptor referenced by argument *at*.

Argument *ret\_off* should point to a location that is to hold the returned section-relative offset. If argument *err* is non-NULL, it is used to return an error descriptor in case of an error.

## RETURN VALUES

On success, function **dwarf\_attroffset**() returns DW\_DLV\_OK.

In case of an error, it returns DW\_DLV\_ERROR and sets argument *err*.

## COMPATIBILITY

This function is an extension to the DWARF(3) API.

## ERRORS

The **dwarf\_attroffset**() function may fail with the following errors:

- \[DW\_DLE\_ARGUMENT\]

  Either of the arguments *at* or *ret\_off* was NULL.

## SEE ALSO

[dwarf(3)](/dwarf/3.md), [dwarf\_attr(3)](/dwarf_attr/3.md)
