---
name: "capng_get_rootid"
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_get_rootid"
---

# capng\_get\_rootid(3)

get namespace root id

## NAME

capng\_get\_rootid - get namespace root id

## SYNOPSIS

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

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

## 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

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

[**capng\_get\_caps\_fd**(3)](/capng_get_caps_fd/3.md), [**capabilities**(7)](/capabilities/7.md)

## AUTHOR

Steve Grubb
