PROCPS_LINUX_VERSION(3)

NAME
procps_ns - provide information on the namespaces

SYNOPSIS
#include <proc/namespace.h>

int procps_ns_get_id(const char * name);
const char *procps_ns_get_name(const int id);
int procps_ns_read_pid(const int pid, struct procps_namespaces * nsp);

Link with -lprocps.

DESCRIPTION
The family of procps_ns() functions return information about the Linux namespaces. procps_ns_get_id() finds the ID of the namespace for the given namespace name. procps_ns_get_name() finds the name of the namespace of the given integer ID. procps_ns_read_pid() puts the inodes for the namespaces of the given process into the array pointed to nsp.

RETURN VALUE
procps_ns_get_id() returns an integer for the namespace ID for the given name or -EINVAL for an invalid input or an unknown namespace name. procps_ns_get_name() returns a statically allocated string containing the name of the namespace for the given ID. If the name is not found the function returns NULL procps_ns_read_pid() Returns 0 on success and -EINVAL on failure.

FILES

/proc/PID/ns
    contains the set of namespaces for a particular PID.

VERSIONS
The procps_ns() set of functions first appeared in libproc-2 version 0.0.

SEE ALSO
proc(5), namespaces(7).