| 1 |
.\" Copyright 2017, Michael Kerrisk <[email protected]> |
| 2 |
.\" Copyright, the authors of the Linux man-pages project |
| 3 |
.\" |
| 4 |
.\" SPDX-License-Identifier: Linux-man-pages-copyleft |
| 5 |
.\" |
| 6 |
.TH NS_GET_OWNER_UID 2const 2026-02-08 "Linux man-pages 6.18" |
| 7 |
.SH NAME |
| 8 |
NS_GET_OWNER_UID |
| 9 |
\- |
| 10 |
discovering the owner of a user namespace |
| 11 |
.SH SYNOPSIS |
| 12 |
.nf |
| 13 |
.BR "#include <linux/nsfs.h>" " /* Definition of " NS_GET_OWNER_UID " */" |
| 14 |
.B #include <sys/ioctl.h> |
| 15 |
.P |
| 16 |
.BI "int ioctl(int " fd ", NS_GET_OWNER_UID, uid_t *" uid ); |
| 17 |
.fi |
| 18 |
.SH DESCRIPTION |
| 19 |
The |
| 20 |
.B NS_GET_OWNER_UID |
| 21 |
operation can be used to discover |
| 22 |
the owner user ID of a user namespace (i.e., the effective user ID |
| 23 |
of the process that created the user namespace). |
| 24 |
.P |
| 25 |
.I fd |
| 26 |
refers to a |
| 27 |
.IR /proc/ pid /ns/user |
| 28 |
file. |
| 29 |
.P |
| 30 |
The owner user ID is returned in the |
| 31 |
.I uid_t |
| 32 |
pointed to by the third argument. |
| 33 |
.SH RETURN VALUE |
| 34 |
On success, |
| 35 |
0 is returned. |
| 36 |
On error, |
| 37 |
\-1 is returned, and |
| 38 |
.I errno |
| 39 |
is set to indicate the error. |
| 40 |
.SH ERRORS |
| 41 |
.TP |
| 42 |
.B EINVAL |
| 43 |
.I fd |
| 44 |
does not refer to a user namespace. |
| 45 |
.SH STANDARDS |
| 46 |
Linux. |
| 47 |
.SH HISTORY |
| 48 |
Linux 4.11. |
| 49 |
.\" linux.git 015bb305b8ebe8d601a238ab70ebdc394c7a19ba |
| 50 |
.SH SEE ALSO |
| 51 |
.BR ioctl (2), |
| 52 |
.BR ioctl_nsfs (2) |