---
name: "capng_save_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_save_state"
---

# capng\_save\_state(3)

get the internal library state

## NAME

capng\_save\_state - get the internal library state

## SYNOPSIS

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

void \*capng\_save\_state(void);

## DESCRIPTION

capng\_save\_state is a function that returns a pointer to the internal state of the libcap-ng library. It should be considered opaque and not for alteration directly. This function should be used when you suspect a third party library may use libcap-ng also and want to make sure it doesn't alter something important. This function is not available in the python bindings.

## RETURN VALUE

This returns NULL on failure and a non-NULL pointer otherwise.

## NOTES

The structure returned by capng\_save\_state is malloc'd;  it should be free'd if not used.

## SEE ALSO

[**capng\_restore\_state**(3)](/capng_restore_state/3.md), [**capabilities**(7)](/capabilities/7.md)

## AUTHOR

Steve Grubb
