---
name: "NS_GET_OWNER_UID"
section: "2const"
platform: "linux"
package: "man-pages"
version: "6.19-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/NS_GET_OWNER_UID"
---

# NS\_GET\_OWNER\_UID(2const)

discovering the owner of a user namespace

## NAME

NS\_GET\_OWNER\_UID - discovering the owner of a user namespace

## SYNOPSIS

```
#include <linux/nsfs.h>  /* Definition of NS_GET_OWNER_UID */
#include <sys/ioctl.h>
```

**int ioctl(int** *fd***, NS\_GET\_OWNER\_UID, uid\_t \****uid***);**

## DESCRIPTION

The **NS\_GET\_OWNER\_UID** operation can be used to discover the owner user ID of a user namespace (i.e., the effective user ID of the process that created the user namespace).

*fd* refers to a */proc/*pid*/ns/user* file.

The owner user ID is returned in the *uid\_t* pointed to by the third argument.

## RETURN VALUE

On success, 0 is returned. On error, -1 is returned, and *errno* is set to indicate the error.

## ERRORS

- **EINVAL**

  *fd* does not refer to a user namespace.

## STANDARDS

Linux.

## HISTORY

Linux 4.11.

## SEE ALSO

[**ioctl**(2)](/ioctl/2.md), [**ioctl\_nsfs**(2)](/ioctl_nsfs/2.md)
