aboutsummaryrefslogtreecommitdiff
path: root/share/man/man9
diff options
context:
space:
mode:
Diffstat (limited to 'share/man/man9')
-rw-r--r--share/man/man9/Makefile2
-rw-r--r--share/man/man9/mbuf.918
-rw-r--r--share/man/man9/pget.9107
3 files changed, 121 insertions, 6 deletions
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile
index 37ba7f2e85fc..453f3c0850df 100644
--- a/share/man/man9/Makefile
+++ b/share/man/man9/Makefile
@@ -192,6 +192,7 @@ MAN= accept_filter.9 \
pci.9 \
pfil.9 \
pfind.9 \
+ pget.9 \
pgfind.9 \
physio.9 \
pmap.9 \
@@ -902,6 +903,7 @@ MLINKS+=\
mbuf.9 m_freem.9 \
mbuf.9 MGET.9 \
mbuf.9 m_get.9 \
+ mbuf.9 m_get2.9 \
mbuf.9 m_getjcl.9 \
mbuf.9 m_getcl.9 \
mbuf.9 m_getclr.9 \
diff --git a/share/man/man9/mbuf.9 b/share/man/man9/mbuf.9
index 4df1d6ab704d..9b75c6136b78 100644
--- a/share/man/man9/mbuf.9
+++ b/share/man/man9/mbuf.9
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd January 16, 2014
+.Dd April 30, 2014
.Dt MBUF 9
.Os
.\"
@@ -64,23 +64,25 @@
.Fn M_TRAILINGSPACE "struct mbuf *mbuf"
.Fn M_MOVE_PKTHDR "struct mbuf *to" "struct mbuf *from"
.Fn M_PREPEND "struct mbuf *mbuf" "int len" "int how"
-.Fn MCHTYPE "struct mbuf *mbuf" "u_int type"
+.Fn MCHTYPE "struct mbuf *mbuf" "short type"
.Ft int
.Fn M_WRITABLE "struct mbuf *mbuf"
.\"
.Ss Mbuf allocation functions
.Ft struct mbuf *
-.Fn m_get "int how" "int type"
+.Fn m_get "int how" "short type"
.Ft struct mbuf *
-.Fn m_getm "struct mbuf *orig" "int len" "int how" "int type"
+.Fn m_get2 "int size" "int how" "short type" "int flags"
+.Ft struct mbuf *
+.Fn m_getm "struct mbuf *orig" "int len" "int how" "short type"
.Ft struct mbuf *
.Fn m_getjcl "int how" "short type" "int flags" "int size"
.Ft struct mbuf *
.Fn m_getcl "int how" "short type" "int flags"
.Ft struct mbuf *
-.Fn m_getclr "int how" "int type"
+.Fn m_getclr "int how" "short type"
.Ft struct mbuf *
-.Fn m_gethdr "int how" "int type"
+.Fn m_gethdr "int how" "short type"
.Ft struct mbuf *
.Fn m_free "struct mbuf *mbuf"
.Ft void
@@ -528,6 +530,10 @@ The functions are:
A function version of
.Fn MGET
for non-critical paths.
+.It Fn m_get2 size how type flags
+Allocate an
+.Vt mbuf
+with enough space to hold specified amount of data.
.It Fn m_getm orig len how type
Allocate
.Fa len
diff --git a/share/man/man9/pget.9 b/share/man/man9/pget.9
new file mode 100644
index 000000000000..12eda29ca7c8
--- /dev/null
+++ b/share/man/man9/pget.9
@@ -0,0 +1,107 @@
+.\" Copyright (c) 2011 Sergey Kandaurov
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd May 3, 2014
+.Dt PGET 9
+.Os
+.Sh NAME
+.Nm pget
+.Nd locate a process by number
+.Sh SYNOPSIS
+.In sys/param.h
+.In sys/proc.h
+.Ft int
+.Fn pget "pid_t pid" "int flags" "struct proc **pp"
+.Sh DESCRIPTION
+This function
+takes a
+.Fa pid
+as its argument,
+which can be either a process or thread id,
+and fills a pointer to the
+.Vt proc
+structure in
+.Fa *pp .
+In the latter case, a process owning the specified thread is looked for.
+The operation is performed by invoking the
+.Xr pfind 9
+function.
+The found process is returned locked.
+For the
+.Dv PGET_HOLD
+case, it is returned unlocked (but held).
+The
+.Fn pget
+function can
+perform additional manipulations, depending on a
+.Fa flags
+argument.
+.Pp
+The
+.Fa flags
+argument is the logical OR of some subset of:
+.Bl -tag -width ".Dv PGET_NOTINEXEC"
+.It Dv PGET_HOLD
+If set, the found process will be held and unlocked.
+.It Dv PGET_CANSEE
+If set, the found process will be checked for its visibility.
+See
+.Xr p_cansee 9 .
+.It Dv PGET_CANDEBUG
+If set, the found process will be checked for its debuggability.
+See
+.Xr p_candebug 9 .
+.It Dv PGET_ISCURRENT
+If set, the found process will be checked that it matches the current
+process context.
+.It Dv PGET_NOTWEXIT
+If set, the found process will be checked that it does not have the process
+flag
+.Dv P_WEXIT
+set.
+.It Dv PGET_NOTINEXEC
+If set, the found process will be checked that it does not have the process
+flag
+.Dv P_INEXEC
+set.
+.It Dv PGET_NOTID
+If set,
+.Fa pid
+is not assumed as a thread id for values larger than
+.Dv PID_MAX .
+.It Dv PGET_WANTREAD
+If set, the found process will be checked that the caller may get
+a read access to its structure.
+A shorthand for
+.Pq Dv PGET_HOLD | PGET_CANDEBUG | PGET_NOTWEXIT .
+.El
+.Sh RETURN VALUES
+If the process is found in the specified way, then zero is returned,
+otherwise an appropriate error code is returned.
+.Sh SEE ALSO
+.Xr p_candebug 9 ,
+.Xr p_cansee 9 ,
+.Xr pfind 9