CAPNG\_SAVE\_STATE(3) Libcap-ng API CAPNG\_SAVE\_STATE(3)

# [NAME](#NAME)

capng\_save\_state - get the internal library state

# [SYNOPSIS](#SYNOPSIS)

**#include &lt;cap-ng.h&gt;**

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

# [DESCRIPTION](#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](#RETURN_VALUE)

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

# [NOTES](#NOTES)

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

# [SEE ALSO](#SEE_ALSO)

[**capng\_restore\_state**(3)](/man/os/libcap-ng/capng_restore_state.3), [**capabilities**(7)](/man/os/libcap-ng/capabilities.7)

# [AUTHOR](#AUTHOR)

Steve Grubb

June 2009 Red Hat

---

Document: capng_save_state(3) from libcap-ng 0.9.6-r1 (Chainguard OS)
Source: https://github.com/stevegrubb/libcap-ng.git
