---
name: "unw_apply_reg_state"
section: "3"
platform: "linux"
package: "libunwind"
version: "1.8.3-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/unw_apply_reg_state"
---

# unw\_apply\_reg\_state(3)

## NAME

unw\_apply\_reg\_state -- apply a register state update to a cursor

## SYNOPSIS

\#include \<libunwind.h\>\

int unw\_apply\_reg\_state(unw\_cursor\_t \*cp, void \*reg\_states\_data);\

## DESCRIPTION

The unw\_apply\_reg\_state() routine updates the register values  of a cursor according to the instructions in reg\_states\_data, which have been obtained by calling unw\_reg\_states\_iterate.

## RETURN VALUE

On successful completion, unw\_apply\_reg\_state() returns 0.  Otherwise the negative value of one of the error codes below is  returned.

## THREAD AND SIGNAL SAFETY

unw\_apply\_reg\_state() is thread safe. If cursor cp is  in the local address space, this routine is also safe to use from a  signal handler.

## ERRORS

- UNW\_EUNSPEC

   An unspecified error occurred.

- UNW\_ENOINFO

   Libunwind was unable to locate  unwind-info for the procedure.

- UNW\_EBADVERSION

   The unwind info for the procedure has  version or format that is not understood by libunwind.

In addition, unw\_apply\_reg\_state() may return any error  returned by the access\_mem() call-back (see  unw\_create\_addr\_space(3libunwind)).

## SEE ALSO

libunwind(3libunwind), unw\_reg\_states\_iterate(3libunwind)

## AUTHOR

David Mosberger-Tang\
 Email: **dmosberger@gmail.com**\
 WWW: **http://www.nongnu.org/libunwind/**.
