CAPNG\_GET\_ROOTID(3) Libcap-ng API CAPNG\_GET\_ROOTID(3)

# [NAME](#NAME)

capng\_get\_rootid - get namespace root id

# [SYNOPSIS](#SYNOPSIS)

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

uid\_t capng\_get\_rootid(void);

# [DESCRIPTION](#DESCRIPTION)

capng\_get\_rootid gets the rootid for file capabilities operations. The value is a host-endian user ID in the caller's user namespace.

# [RETURN VALUE](#RETURN_VALUE)

If V3 file capabilities have not been selected, or the kernel does not support them, it returns CAPNG\_UNSET\_ROOTID. Otherwise it returns the namespace root user ID.

# [SEE ALSO](#SEE_ALSO)

[**capng\_get\_caps\_fd**(3)](/man/os/libcap-ng/capng_get_caps_fd.3), [**capabilities**(7)](/man/os/libcap-ng/capabilities.7)

# [AUTHOR](#AUTHOR)

Steve Grubb

Sept 2020 Red Hat

---

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