---
name: "capng_restore_state"
section: "3"
platform: "linux"
package: "libcap-ng"
version: "0.9.6-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/capng_restore_state"
---

# capng\_restore\_state(3)

set the internal library state

## NAME

capng\_restore\_state - set the internal library state

## SYNOPSIS

**#include \<cap-ng.h\>**

void capng\_restore\_state(void \*\*state);

## DESCRIPTION

capng\_restore\_state is a function that takes the state information previously saved by capng\_save\_state and restores the libraries internal state. This function is not available in the python bindings.

## RETURN VALUE

None.

## NOTES

capng\_restore\_state free's the previously malloc'd state, thus the state can't be restored multiple times.

The working pid is part of the restored state, if restoring the state to a different thread, capng\_setpid can be used to update it.

## SEE ALSO

[**capng\_save\_state**(3)](/capng_save_state/3.md), [**capabilities**(7)](/capabilities/7.md)

## AUTHOR

Steve Grubb
