docs: Merge procps_ns_* into misc

This commit is contained in:
Craig Small 2020-12-21 12:41:10 +11:00
parent 7246249b8c
commit 770505ded4
4 changed files with 33 additions and 79 deletions

View File

@ -16,13 +16,19 @@
.\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA .\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
.\" %%%LICENSE_END .\" %%%LICENSE_END
.\" .\"
.TH PROCPS_MISC 3 2020-10-20 "libproc-2" .TH PROCPS_MISC 3 2020-12-21 "libproc-2"
.\" Please adjust this date whenever revising the manpage. .\" Please adjust this date whenever revising the manpage.
.\" .\"
.SH NAME .SH NAME
procps_misc \- API to system information in the /proc filesystem procps_misc \- API to system information in the /proc filesystem
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.B #include <proc/namespace.h>
.PP
.BI "int procps_ns_get_id(const char * " name ");"
.BI "const char *procps_ns_get_name(const int " id ");"
.BI "int procps_ns_read_pid(const int " pid ", struct procps_namespaces * " nsp ");"
.PP
.B #include <proc/sysinfo.h> .B #include <proc/sysinfo.h>
.PP .PP
.B long procps_cpu_count(void); .B long procps_cpu_count(void);
@ -88,6 +94,16 @@ To encode a given Linux version, such as using it to compare against the current
version, use the following macro: version, use the following macro:
.TP .TP
.BI LINUX_VERSION( major , minor , patch ) .BI LINUX_VERSION( major , minor , patch )
.PP
.BR procps_ns_get_id ()
finds the ID of the namespace for the given namespace name.
.BR procps_ns_get_name ()
finds the name of the namespace of the given integer ID.
.BR procps_ns_read_pid ()
puts the inodes for the namespaces of the given process into
the array pointed to \fInsp\fR.
.SH RETURN VALUE .SH RETURN VALUE
For For
@ -115,6 +131,20 @@ Unable to parse the osrelease file.
.BR procps_linux_version () .BR procps_linux_version ()
may also return any (negated) value that \fBfopen\fR() may set errno to. may also return any (negated) value that \fBfopen\fR() may set errno to.
.BR procps_ns_get_id ()
returns an integer for the namespace ID for the given name or
.B \-EINVAL
for an invalid input or an unknown namespace name.
.BR 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
.B NULL
.BR procps_ns_read_pid ()
Returns 0 on success and \fB\-EINVAL\fR on failure.
.SH FILES .SH FILES
.TP .TP
.I /proc/loadavg .I /proc/loadavg
@ -125,6 +155,8 @@ Contains the release version of the Linux kernel or proc filesystem.
.TP .TP
.I /proc/sys/kernel/pid_max .I /proc/sys/kernel/pid_max
Contains the value at which PIDs wrap around, one greater than the maximum PID value. Contains the value at which PIDs wrap around, one greater than the maximum PID value.
.IB /proc/ PID /ns
contains the set of namespaces for a particular \fBPID\fR.
.SH BUGS .SH BUGS
Due to the way the three numbers are encoded into a single integer, Due to the way the three numbers are encoded into a single integer,

View File

@ -1,76 +0,0 @@
.\" (C) Copyright 2020 Craig Small <csmall@dropbear.xyz>
.\"
.\" %%%LICENSE_START(LGPL_2.1+)
.\" This manual is free software; you can redistribute it and/or
.\" modify it under the terms of the GNU Lesser General Public
.\" License as published by the Free Software Foundation; either
.\" version 2.1 of the License, or (at your option) any later version.
.\"
.\" This manual is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
.\" Lesser General Public License for more details.
.\"
.\" You should have received a copy of the GNU Lesser General Public
.\" License along with this library; if not, write to the Free Software
.\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
.\" %%%LICENSE_END
.\"
.TH PROCPS_LINUX_VERSION 3 2020-05-18 "libproc-2"
.\" Please adjust this date whenever revising the manpage.
.\"
.SH NAME
procps_ns \-
provide information on the namespaces
.SH SYNOPSIS
.nf
.B #include <proc/namespace.h>
.PP
.BI "int procps_ns_get_id(const char * " name ");"
.BI "const char *procps_ns_get_name(const int " id ");"
.BI "int procps_ns_read_pid(const int " pid ", struct procps_namespaces * " nsp ");"
.sp
Link with \fI\-lprocps\fP.
.SH DESCRIPTION
The family of
.BR procps_ns ()
functions return information about the Linux namespaces.
.BR procps_ns_get_id ()
finds the ID of the namespace for the given namespace name.
.BR procps_ns_get_name ()
finds the name of the namespace of the given integer ID.
.BR procps_ns_read_pid ()
puts the inodes for the namespaces of the given process into
the array pointed to \fInsp\fR.
.SH RETURN VALUE
.BR procps_ns_get_id ()
returns an integer for the namespace ID for the given name or
.B \-EINVAL
for an invalid input or an unknown namespace name.
.BR 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
.B NULL
.BR procps_ns_read_pid ()
Returns 0 on success and \fB\-EINVAL\fR on failure.
.SH FILES
.TP
.IB /proc/ PID /ns
contains the set of namespaces for a particular \fBPID\fR.
.SH VERSIONS
The
.BR procps_ns ()
set of functions first appeared in libproc-2 version 0.0.
.SH SEE ALSO
.BR proc (5),
.BR namespaces (7).

View File

@ -1 +0,0 @@
.so man3/procps_ns_get_id.3

View File

@ -1 +0,0 @@
.so man3/procps_ns_get_id.3