CAPNG\_GET\_CAPS\_PROCESS(3) Libcap-ng API CAPNG\_GET\_CAPS\_PROCESS(3)

# [NAME](#NAME)

capng\_get\_caps\_process - get the capabilities from a process

# [SYNOPSIS](#SYNOPSIS)

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

int capng\_get\_caps\_process(void);

# [DESCRIPTION](#DESCRIPTION)

capng\_get\_caps\_process will get the capabilities and bounding set of the pid stored inside libcap-ng's state table. The default is the pid of the running process. This can be changed by using the capng\_setpid function.

# [RETURN VALUE](#RETURN_VALUE)

This returns 0 on success and -1 on failure.

# [NOTES](#NOTES)

If you are doing multi-threaded programming, calling this function will only get capabilities on the calling thread. If you want to get overall capabilities for a multi-threaded process, you can only do that before creating any threads. Afterwards, threads may be able to independently set capabilities.

capng\_get\_caps\_process needs a mounted /proc to read the current bounding set, otherwise it will fail.

# [SEE ALSO](#SEE_ALSO)

[**capng\_setpid**(3)](/man/os/libcap-ng/capng_setpid.3), [**capabilities**(7)](/man/os/libcap-ng/capabilities.7)

# [AUTHOR](#AUTHOR)

Steve Grubb

June 2009 Red Hat

---

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