NS_GET_OWNER_UID(2const)

NS_GET_OWNER_UID2const

Discovering the owner of a user namespace

Usage

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

Overview

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.

Releases

2 releases since Debian 13 (Trixie); the text changed 1 time.

  1. 13
  2. Arch

Standards

Linux.

History

Linux 4.11.

From man-pages 6.19-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.