summaryrefslogtreecommitdiff
path: root/usr/src/man
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/man')
-rw-r--r--usr/src/man/Makefile1
-rw-r--r--usr/src/man/man1/Makefile21
-rw-r--r--usr/src/man/man1/column.1129
-rw-r--r--usr/src/man/man1/crontab.146
-rw-r--r--usr/src/man/man1/ctfdiff.1347
-rw-r--r--usr/src/man/man1/ctfdump.1420
-rw-r--r--usr/src/man/man1/hostname.117
-rw-r--r--usr/src/man/man1/ld.12
-rw-r--r--usr/src/man/man1/ld.so.1.121
-rw-r--r--usr/src/man/man1/machid.125
-rw-r--r--usr/src/man/man1/mdb.113
-rw-r--r--usr/src/man/man1/nawk.19
-rw-r--r--usr/src/man/man1/pargs.126
-rw-r--r--usr/src/man/man1/pfexec.16
-rw-r--r--usr/src/man/man1/proc.112
-rw-r--r--usr/src/man/man1/ps.16
-rw-r--r--usr/src/man/man1/sed.122
-rw-r--r--usr/src/man/man1/zlogin.181
-rw-r--r--usr/src/man/man1m/Makefile6
-rw-r--r--usr/src/man/man1m/dladm.1m465
-rw-r--r--usr/src/man/man1m/flowadm.1m49
-rw-r--r--usr/src/man/man1m/prstat.1m13
-rw-r--r--usr/src/man/man1m/reboot.1m3
-rw-r--r--usr/src/man/man1m/snoop.1m19
-rw-r--r--usr/src/man/man1m/svc.startd.1m9
-rw-r--r--usr/src/man/man1m/tunefs.1m8
-rw-r--r--usr/src/man/man1m/vfsstat.1m213
-rw-r--r--usr/src/man/man1m/vndadm.1m651
-rw-r--r--usr/src/man/man1m/vndstat.1m163
-rw-r--r--usr/src/man/man1m/zfs.1m2
-rw-r--r--usr/src/man/man1m/zoneadm.1m28
-rw-r--r--usr/src/man/man1m/zonecfg.1m95
-rw-r--r--usr/src/man/man1m/zpool.1m1
-rw-r--r--usr/src/man/man3c/Makefile3
-rw-r--r--usr/src/man/man3c/inotify_add_watch.3c120
-rw-r--r--usr/src/man/man3c/inotify_init.3c107
-rw-r--r--usr/src/man/man3c/inotify_rm_watch.3c81
-rw-r--r--usr/src/man/man3c/psignal.3c2
-rw-r--r--usr/src/man/man3c/timer_create.3c16
-rw-r--r--usr/src/man/man3c/timer_settime.3c12
-rw-r--r--usr/src/man/man3dlpi/Makefile2
-rw-r--r--usr/src/man/man3dlpi/dlpi_open.3dlpi31
-rw-r--r--usr/src/man/man3lib/Makefile1
-rw-r--r--usr/src/man/man3lib/libvnd.3lib690
-rw-r--r--usr/src/man/man3nsl/t_bind.3nsl660
-rw-r--r--usr/src/man/man3vnd/Makefile70
-rw-r--r--usr/src/man/man3vnd/vnd_create.3vnd280
-rw-r--r--usr/src/man/man3vnd/vnd_errno.3vnd170
-rw-r--r--usr/src/man/man3vnd/vnd_frameio_read.3vnd705
-rw-r--r--usr/src/man/man3vnd/vnd_pollfd.3vnd155
-rw-r--r--usr/src/man/man3vnd/vnd_prop_get.3vnd242
-rw-r--r--usr/src/man/man3vnd/vnd_prop_iter.3vnd148
-rw-r--r--usr/src/man/man3vnd/vnd_prop_writeable.3vnd101
-rw-r--r--usr/src/man/man3vnd/vnd_walk.3vnd155
-rw-r--r--usr/src/man/man3xnet/Makefile4
-rw-r--r--usr/src/man/man3xnet/htonl.3xnet29
-rw-r--r--usr/src/man/man4/Makefile1
-rw-r--r--usr/src/man/man4/overlay_files.4187
-rw-r--r--usr/src/man/man4/proc.45073
-rw-r--r--usr/src/man/man4/process.418
-rw-r--r--usr/src/man/man5/Makefile5
-rw-r--r--usr/src/man/man5/brands.53
-rw-r--r--usr/src/man/man5/inotify.5305
-rw-r--r--usr/src/man/man5/lx.5113
-rw-r--r--usr/src/man/man5/overlay.5521
-rw-r--r--usr/src/man/man5/privileges.524
-rw-r--r--usr/src/man/man5/resource_controls.5133
-rw-r--r--usr/src/man/man7/Makefile4
-rw-r--r--usr/src/man/man7/swap.792
-rw-r--r--usr/src/man/man7d/Makefile5
-rw-r--r--usr/src/man/man7d/cpuid.7d5
-rw-r--r--usr/src/man/man7d/qede.7d100
-rw-r--r--usr/src/man/man7d/vnd.7d118
-rw-r--r--usr/src/man/man7d/zfd.7d81
-rw-r--r--usr/src/man/man7fs/Makefile2
-rw-r--r--usr/src/man/man7fs/hyprlofs.7fs62
-rw-r--r--usr/src/man/man7fs/lxproc.7fs115
-rw-r--r--usr/src/man/man7i/uscsi.7i40
-rw-r--r--usr/src/man/man7m/Makefile2
-rw-r--r--usr/src/man/man7m/datafilt.7m48
-rw-r--r--usr/src/man/man7p/Makefile6
-rw-r--r--usr/src/man/man7p/vxlan.7p130
-rw-r--r--usr/src/man/man9/Makefile9
-rw-r--r--usr/src/man/man9/iport.9334
-rw-r--r--usr/src/man/man9e/Makefile4
-rw-r--r--usr/src/man/man9e/mac_capab_led.9e228
-rw-r--r--usr/src/man/man9f/Makefile70
-rw-r--r--usr/src/man/man9f/ddi_ffs.9f157
-rw-r--r--usr/src/man/man9f/kmem_alloc.9f7
-rw-r--r--usr/src/man/man9f/sas_phymap_create.9f307
-rw-r--r--usr/src/man/man9f/sas_phymap_lookup_ua.9f213
-rw-r--r--usr/src/man/man9f/scsi_address_device.9f169
-rw-r--r--usr/src/man/man9f/scsi_hba_attach_setup.9f529
-rw-r--r--usr/src/man/man9f/scsi_hba_iport_exist.9f98
-rw-r--r--usr/src/man/man9f/scsi_hba_iport_register.9f88
-rw-r--r--usr/src/man/man9f/scsi_hba_iport_unit_address.9f74
-rw-r--r--usr/src/man/man9f/scsi_hba_iportmap_create.9f179
-rw-r--r--usr/src/man/man9f/scsi_hba_tgtmap_create.9f489
-rw-r--r--usr/src/man/man9f/scsi_wwnstr_to_wwn.9f169
-rw-r--r--usr/src/man/man9s/scsi_address.9s163
100 files changed, 13846 insertions, 3347 deletions
diff --git a/usr/src/man/Makefile b/usr/src/man/Makefile
index 7bfd356b32..a948d1256c 100644
--- a/usr/src/man/Makefile
+++ b/usr/src/man/Makefile
@@ -85,6 +85,7 @@ SUBDIRS= man1 \
man3tsol \
man3uuid \
man3volmgt \
+ man3vnd \
man3xcurses \
man3xnet \
man4 \
diff --git a/usr/src/man/man1/Makefile b/usr/src/man/man1/Makefile
index 8dc13a00f6..af6013f4f9 100644
--- a/usr/src/man/man1/Makefile
+++ b/usr/src/man/man1/Makefile
@@ -72,6 +72,7 @@ MANFILES= acctcom.1 \
clear.1 \
cmp.1 \
col.1 \
+ column.1 \
comm.1 \
command.1 \
compress.1 \
@@ -84,6 +85,8 @@ MANFILES= acctcom.1 \
csh.1 \
csplit.1 \
ctags.1 \
+ ctfdiff.1 \
+ ctfdump.1 \
ctrun.1 \
ctstat.1 \
ctwatch.1 \
@@ -217,6 +220,7 @@ MANFILES= acctcom.1 \
m4.1 \
mac.1 \
mach.1 \
+ machid.1 \
madv.so.1.1 \
mail.1 \
mailcompat.1 \
@@ -466,6 +470,9 @@ MANLINKS= batch.1 \
helpuid.1 \
helpyorn.1 \
hist.1 \
+ i286.1 \
+ i386.1 \
+ i486.1 \
if.1 \
intro.1 \
jsh.1 \
@@ -476,8 +483,10 @@ MANLINKS= batch.1 \
notify.1 \
onintr.1 \
page.1 \
+ pauxv.1 \
pcat.1 \
pcred.1 \
+ penv.1 \
pfcsh.1 \
pfiles.1 \
pfksh.1 \
@@ -511,9 +520,11 @@ MANLINKS= batch.1 \
sh.1 \
snca.1 \
source.1 \
+ sparc.1 \
spellin.1 \
stop.1 \
strconf.1 \
+ sun.1 \
switch.1 \
ulimit.1 \
unalias.1 \
@@ -645,6 +656,12 @@ unlimit.1 := LINKSRC = limit.1
dumpkeys.1 := LINKSRC = loadkeys.1
+i286.1 := LINKSRC = machid.1
+i386.1 := LINKSRC = machid.1
+i486.1 := LINKSRC = machid.1
+sparc.1 := LINKSRC = machid.1
+sun.1 := LINKSRC = machid.1
+
rmail.1 := LINKSRC = mail.1
page.1 := LINKSRC = more.1
@@ -654,6 +671,9 @@ snca.1 := LINKSRC = nca.1
pcat.1 := LINKSRC = pack.1
unpack.1 := LINKSRC = pack.1
+pauxv.1 := LINKSRC = pargs.1
+penv.1 := LINKSRC = pargs.1
+
pfcsh.1 := LINKSRC = pfexec.1
pfksh.1 := LINKSRC = pfexec.1
pfsh.1 := LINKSRC = pfexec.1
@@ -699,7 +719,6 @@ hashcheck.1 := LINKSRC = spell.1
hashmake.1 := LINKSRC = spell.1
spellin.1 := LINKSRC = spell.1
-
strconf.1 := LINKSRC = strchg.1
settime.1 := LINKSRC = touch.1
diff --git a/usr/src/man/man1/column.1 b/usr/src/man/man1/column.1
new file mode 100644
index 0000000000..a8c23310ba
--- /dev/null
+++ b/usr/src/man/man1/column.1
@@ -0,0 +1,129 @@
+.\" Copyright (c) 1989, 1990, 1993
+.\" The Regents of the University of California. 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.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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.
+.\"
+.\" @(#)column.1 8.1 (Berkeley) 6/6/93
+.\" $FreeBSD$
+.\"
+.\" Portions Copyright (c) 2013 Joyent, Inc. All rights reserved.
+.\"
+.TH COLUMN 1 "Jan 10, 2013"
+.SH NAME
+column \- columnate lists
+.SH SYNOPSIS
+.LP
+.nf
+\fBcolumn\fR [\fB-tx\fR] [\fB-c\fR \fIcolumns\fR] [\fB-s\fR \fIsep\fR] [\fIfile\fR ... ]
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBcolumn\fR
+utility formats its input into multiple columns.
+Rows are filled before columns.
+Input is taken from
+\fIfile\fR
+operands, or, by default, from the standard input.
+Empty lines are ignored.
+.SH OPTIONS
+.sp
+.LP
+The options are as follows:
+.sp
+.ne 2
+.na
+\fB\fB-c\fR \fIcolumns\fR\fR
+.ad
+.RS 17n
+Output is formatted for a display \fIcolumns\fR
+wide.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fB-s\fR \fIsep\fR\fR
+.ad
+.RS 17n
+Specify a set of characters to be used to delimit columns for the
+\fB-t\fR option.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fB-t\fR\fR
+.ad
+.RS 17n
+Determine the number of columns the input contains and create a table.
+Columns are delimited with whitespace, by default, or with the characters
+supplied using the \fBs\fR
+option.
+Useful for pretty-printing displays.
+.RE
+
+.sp
+.ne 2
+.na
+\fB-x\fR
+.ad
+.RS 17n
+Fill columns before filling rows.
+.RE
+
+.SH ENVIRONMENT
+The COLUMNS , LANG , LC_ALL
+and
+LC_CTYPE
+environment variables affect the execution of
+\fBcolumn\fR
+as described in
+\fBenviron\fR(5).
+
+.SH EXIT STATUS
+The \fBcolumn\fR utility exits 0 on success and >0 if an error occurs.
+
+.SH EXAMPLES
+.sp
+.in +2
+.nf
+(printf \&"PERM LINKS OWNER GROUP SIZE MONTH DAY \&"\ \&;\ \&\e
+printf \&"HH:MM/YEAR NAME\en\&"\ \&;\ \&\e
+ls -l \&| sed 1d) \&| column -t
+.fi
+.in -2
+.sp
+
+
+.SH SEE ALSO
+\fBls\fR(1), \fBpaste\fR(1), \fBsort\fR(1)
+
+.SH HISTORY
+The \fBcolumn\fR command appeared in 4.3BSD-Reno.
+
+.SH BUGS
+Input lines are limited to LINE_MAX bytes in length.
diff --git a/usr/src/man/man1/crontab.1 b/usr/src/man/man1/crontab.1
index c5e4b6e321..d306beb5f8 100644
--- a/usr/src/man/man1/crontab.1
+++ b/usr/src/man/man1/crontab.1
@@ -1,6 +1,7 @@
'\" te
.\" Copyright 1989 AT&T
.\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved
+.\" Copyright (c) 2011, Joyent, Inc. All Rights Reserved
.\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at http://www.opengroup.org/bookstore/.
.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text
@@ -26,7 +27,7 @@ crontab \- user crontab file
.LP
.nf
-\fB/usr/bin/crontab\fR \fB-l\fR [\fIusername\fR]
+\fB/usr/bin/crontab\fR \fB-l\fR [\fB-g\fR] [\fIusername\fR]
.fi
.LP
@@ -46,7 +47,7 @@ crontab \- user crontab file
.LP
.nf
-\fB/usr/xpg4/bin/crontab\fR \fB-l\fR [\fIusername\fR]
+\fB/usr/xpg4/bin/crontab\fR \fB-l\fR [\fB-g\fR] [\fIusername\fR]
.fi
.LP
@@ -66,7 +67,7 @@ crontab \- user crontab file
.LP
.nf
-\fB/usr/xpg6/bin/crontab\fR \fB-l\fR [\fIusername\fR]
+\fB/usr/xpg6/bin/crontab\fR \fB-l\fR [\fB-g\fR] [\fIusername\fR]
.fi
.LP
@@ -85,6 +86,17 @@ users' crontabs.
.LP
If \fBcrontab\fR is invoked with \fIfilename\fR, this overwrites an existing
\fBcrontab\fR entry for the user that invokes it.
+.sp
+.LP
+Cron supports a merged crontab with entries coming from either the user's
+\fB/var/spool/cron/crontabs\fR file or from the user's
+\fB/etc/cron.d/crontabs\fR file. The entries in the user's
+\fB/var/spool/cron/crontabs\fR file are editable whereas those in
+\fB/etc/cron.d/crontabs\fR are system-defined entries which may not
+be customized by the user. The dual set of crontab entries is only
+of interest to system-defined users such as \fBroot\fR. Except where
+otherwise explicitly indicated, all variants of the \fBcrontab\fR command
+act only on the editable crontab files found in \fB/var/spool/cron/crontabs\fR.
.SS "\fBcrontab\fR Access Control"
.LP
Users: Access to \fBcrontab\fR is allowed:
@@ -337,6 +349,9 @@ file using the \fB-r\fR option.
If \fIusername\fR is specified, the specified user's \fBcrontab\fR file is
edited, rather than the current user's \fBcrontab\fR file. This can only be
done by root or by a user with the \fBsolaris.jobs.admin\fR authorization.
+.sp
+Only the entries in the user's \fB/var/spool/cron/crontabs\fR file are
+editable.
.RE
.sp
@@ -348,6 +363,22 @@ done by root or by a user with the \fBsolaris.jobs.admin\fR authorization.
Lists the \fBcrontab\fR file for the invoking user. Only root or a user with
the \fBsolaris.jobs.admin\fR authorization can specify a username following the
\fB-l\fR option to list the \fBcrontab\fR file of the specified user.
+.sp
+Entries from the user's \fB/var/spool/cron/crontabs\fR file are listed, unless
+the \fB-g\fR option is given, in which case only entries from the user's
+\fB/etc/cron.d/crontabs\fR file are listed.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fB-g\fR\fR
+.ad
+.RS 6n
+In conjunction with the \fB-l\fR option, lists the global \fBcrontab\fR file
+for the invoking or specified user (if authorized) instead of the editable
+\fBcrontab\fR file. This option is not valid unless the \fB-l\fR option is
+also given.
.RE
.sp
@@ -571,6 +602,15 @@ list of denied users
.sp
.ne 2
.na
+\fB\fB/etc/cron.d/crontabs\fR\fR
+.ad
+.RS 28n
+system spool area for \fBcrontab\fR
+.RE
+
+.sp
+.ne 2
+.na
\fB\fB/var/cron/log\fR\fR
.ad
.RS 28n
diff --git a/usr/src/man/man1/ctfdiff.1 b/usr/src/man/man1/ctfdiff.1
new file mode 100644
index 0000000000..c0e59436fa
--- /dev/null
+++ b/usr/src/man/man1/ctfdiff.1
@@ -0,0 +1,347 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright (c) 2015, Joyent, Inc.
+.\"
+.Dd Oct 4, 2014
+.Dt CTFDIFF 1
+.Os
+.Sh NAME
+.Nm ctfdiff
+.Nd compare two CTF containers
+.Sh SYNOPSIS
+.Nm ctfdiff
+.Op Fl afIloqt
+.Op Fl F Ar function
+.Op Fl O Ar object
+.Op Fl p Ar parent1
+.Op Fl p Ar parent2
+.Op Fl T Ar type
+.Ar file1 file2
+.Sh DESCRIPTION
+The
+.Nm
+utility identifies differences between the contents of the
+.Sy CTF
+containers found in
+.Em file1
+and
+.Em file2 .
+.Lp
+.Nm
+can find differences between two
+.Sy CTF
+container's
+.Sy labels ,
+.Sy functions ,
+.Sy objects ,
+and
+.Sy types .
+When no options are specified,
+.Nm
+will only consider
+.Sy functions ,
+.Sy objects,
+and
+.Sy types .
+.Lp
+Two
+.Sy labels
+are considered the same, if they have the same name.
+Two
+.Sy objects
+are considered the same if they have the same name and the type of the
+object is the same.
+Two
+.Sy functions
+are considered the same if they have the same, the same return type, the
+same number of arguments, and the types of their arguments are the same.
+.Lp
+Two
+.Sy types
+are considered the same if they have the same, they represent the same
+kind of thing, and the contents of the type are the same.
+This varies for each specific kind, for example, two structs are the
+same if they have the same members whose types, offsets, and names are
+all the same.
+For more information on the specifics for what we look at
+for each kind of type, and the kinds themselves, see the information we
+use to encode them in
+.Xr ctf 4 .
+If the option
+.Fl I
+is specified, then the names of basic integer types are ignored.
+For an example of where this makes sense, see
+.Sy Example 4 .
+.Lp
+If the
+.Sy CTF
+container found inside of either
+.Em file1
+or
+.Em file2
+has been uniquified (see
+.Xr ctf 4
+for more on uniquification), then the parent
+.Sy CTF
+container is also required for the diff to complete.
+.Sh OPTIONS
+The following options are supported:
+.Bl -hang -width Ds
+.It Fl a
+.Bd -filled -compact
+Diff
+.Sy labels ,
+.Sy types ,
+.Sy objects ,
+and
+.Sy functions .
+.Ed
+.It Fl f
+.Bd -filled -compact
+Diff
+.Sy function
+type argument information.
+.Ed
+.It Fl F Ar function
+.Bd -filled -compact
+When diffing
+.Sy functions ,
+only consider the function
+.Em function .
+This option requires that the option
+.Fl -f
+be specified and can be repeated multiple times.
+.Ed
+.It Fl I
+.Bd -filled -compact
+Ignore the names of integral types.
+This option is useful when comparing types between two
+.Sy CTF
+containers that have different programming models.
+In this case, when comparing integers, the name of the type is not
+considered.
+This means that the ILP32 type long which is a 32-bit wide signed
+integer is the same as the LP64 type int which is a 32-bit wide signed
+integer, even though they have different names.
+.Ed
+.It Fl l
+.Bd -filled -compact
+Diff the
+.Sy labels
+contained inside the
+.Sy CTF
+containers.
+.Ed
+.It Fl o
+.Bd -filled -compact
+Diff type information for
+.Sy objects .
+.Ed
+.It Fl O Ar object
+.Bd -filled -compact
+When diffing type information for
+.Sy objects ,
+only compare if the object is name
+.Em object .
+This option requires
+.Fl o
+to be specified and can be repeated multiple times.
+.Ed
+.It Fl p Ar parent1
+.Bd -filled -compact
+Specifies the path of file that is the parent of the
+.Sy CTF
+container inside of
+.Em file1
+is
+.Em parent1 .
+This option is required if
+.Em file1
+has been uniquified.
+For more information on uniquification, see
+.Xr ctf 4 .
+.Ed
+.It Fl P Ar parent2
+.Bd -filled -compact
+Specifies the path of file that is the parent of the
+.Sy CTF
+container inside of
+.Em file2 is
+.Em parent2 .
+This option is required if
+.Em file1
+has been uniquified.
+For more information on uniquification, see
+.Xr ctf 4 .
+.Ed
+.It Fl q
+.Bd -filled -compact
+Enables quiet mode.
+Standard output from the diff will not be emitted.
+However, diagnostics messages will still be emitted to standard error.
+.Ed
+.It Fl t
+.Bd -filled -compact
+Diff the
+.Sy type
+information sections in the
+.Sy CTF
+containers.
+.Ed
+.It Fl T Ar type
+.Bd -filled -compact
+When diffing the
+.Sy types
+section, only consider it if the type is name
+.Em type .
+Types specified here do not impact the diffing of
+.Sy objects
+or
+.Sy functions .
+Even with
+.Fl -T
+specified, other types will be diffed as necessary for the evaluation of
+the named types; however, the results of those intermediate differences
+will not impact the results of
+.Nm ,
+only named types are considered when evaluating the exit status of
+.Nm .
+.Ed
+.El
+.Sh EXIT STATUS
+.Bl -inset
+.It Sy 0
+.Bd -filled -offset indent -compact
+Execution completed successfully, no differences were detected
+between
+.Em file1
+and
+.Em file2 .
+.Ed
+.It Sy 1
+.Bd -filled -offset indent -compact
+Execution completed successfully, but differences were detected
+between
+.Em file1
+and
+.Em file2 .
+.Ed
+.It Sy 2
+.D1 Invalid command line options were specified.
+.It Sy 3
+.D1 A fatal error occurred.
+.El
+.Sh EXAMPLES
+.Sy Example 1
+Diffing Two
+.Sy CTF
+Containers
+.Lp
+The following example compares two
+.Sy CTF
+containers using the default set
+of comparisons:
+.Sy objects ,
+.Sy functions ,
+and
+.Sy types .
+.Bd -literal -offset 6n
+$ ctfdiff /usr/lib/libc.so.1 /usr/lib/libdtrace.so.1
+ctf container /usr/lib/libc.so.1 type 37 is different
+ctf container /usr/lib/libc.so.1 type 38 is different
+ctf container /usr/lib/libc.so.1 type 39 is different
+ctf container /usr/lib/libc.so.1 type 40 is different
+ctf container /usr/lib/libc.so.1 type 41 is different
+ctf container /usr/lib/libc.so.1 type 42 is different
+ctf container /usr/lib/libc.so.1 type 43 is different
+ctf container /usr/lib/libc.so.1 type 47 is different
+ctf container /usr/lib/libc.so.1 type 48 is different
+ctf container /usr/lib/libc.so.1 type 49 is different
+\&...
+.Ed
+.Sy Example 2
+Diffing Types Between Two
+.Sy CTF
+Containers with Parents
+.Lp
+The following example compares two
+.Sy CTF
+containers
+.Sy /ws/rm/zlan/proto/kernel/drv/amd64/vnd
+and
+.Sy /ws/rm/zlan/proto/kernel/drv/amd64/overlay
+that have been uniquified against the same container
+.Sy /ws/rm/zlan/proto/kernel/amd64/genunix .
+.Bd -literal -offset 6n
+$ ctfdiff -t -p /ws/rm/zlan/proto/kernel/amd64/genunix \\
+ -P /ws/rm/zlan/proto/kernel/amd64/genunix \\
+ /ws/rm/zlan/proto/kernel/drv/amd64/vnd \\
+ /ws/rm/zlan/proto/kernel/drv/amd64/overlay
+ctf container /ws/rm/zlan/proto/kernel/drv/amd64/vnd type 32769 is different
+ctf container /ws/rm/zlan/proto/kernel/drv/amd64/vnd type 32770 is different
+ctf container /ws/rm/zlan/proto/kernel/drv/amd64/vnd type 32771 is different
+ctf container /ws/rm/zlan/proto/kernel/drv/amd64/vnd type 32772 is different
+ctf container /ws/rm/zlan/proto/kernel/drv/amd64/vnd type 32774 is different
+ctf container /ws/rm/zlan/proto/kernel/drv/amd64/vnd type 32775 is different
+ctf container /ws/rm/zlan/proto/kernel/drv/amd64/vnd type 32776 is different
+ctf container /ws/rm/zlan/proto/kernel/drv/amd64/vnd type 32777 is different
+ctf container /ws/rm/zlan/proto/kernel/drv/amd64/vnd type 32778 is different
+ctf container /ws/rm/zlan/proto/kernel/drv/amd64/vnd type 32779 is different
+\&...
+.Ed
+.Lp
+.Sy Example 3
+Diffing a Specific Function in Two
+.Sy CTF
+Containers
+.Lp
+This example shows us looking for differences in the function
+.Sy libzfs_core_init
+in two different version of the library
+.Sy libzfs_core.so.1 .
+.Bd -literal -offset 6n
+$ ctfdiff -f -F libzfs_core_init /usr/lib/libzfs_core.so.1 \\
+ /ws/rm/ctf/proto/usr/lib/libzfs_core.so.1
+$ echo $?
+.Ed
+.Lp
+.Sy Example 4
+Diffing Types to Find Differences Between Different Data Models.
+.Lp
+This example looks for differences between structures used in an ioctl
+that the kernel wants to be bitness neutral by comparing a 32-bit and
+64-bit library that consumes it.
+In this example, we'll use the library
+.Sy libvnd.so.1
+and the types
+.Sy vnd_ioc_attach_t ,
+.Sy vnd_ioc_link_t ,
+.Sy vnd_ioc_unlink_t ,
+.Sy vnd_ioc_buf_t ,
+and
+.Sy vnd_ioc_info_t .
+.Bd -literal -offset 6n
+$ ctfdiff -t -I -T vnd_ioc_attach_t -T vnd_ioc_link_t \\
+ -T vnd_ioc_unlink_t -T vnd_ioc_buf_t -T vnd_ioc_info_t \\
+ i386/libvnd.so.1 amd64/libvnd.so.1
+$ echo $?
+0
+.Ed
+.Sh INTERFACE STABILITY
+The command syntax is
+.Sy Committed .
+The output format is
+.Sy Uncommitted .
+.Sh SEE ALSO
+.Xr ctfdump 1 ,
+.Xr diff 1 ,
+.Xr ctf 4
diff --git a/usr/src/man/man1/ctfdump.1 b/usr/src/man/man1/ctfdump.1
new file mode 100644
index 0000000000..eb0fd10165
--- /dev/null
+++ b/usr/src/man/man1/ctfdump.1
@@ -0,0 +1,420 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright (c) 2015, Joyent, Inc.
+.\"
+.Dd Oct 4, 2014
+.Dt CTFDUMP 1
+.Os
+.Sh NAME
+.Nm ctfdump
+.Nd dump parts of ctf data from files
+.Sh SYNOPSIS
+.Nm ctfdump
+.Op Fl dfhlsSt
+.Op Fl p Ar parent
+.Op Fl u Ar outfile
+.Ar file
+.Sh DESCRIPTION
+The
+.Nm
+utility dumps and decodes the
+.Sy CTF
+data contained inside of
+.Sy ELF
+objects and raw
+.Sy CTF
+files.
+.Lp
+.Nm
+can dump information about the
+.Sy CTF header ,
+the
+.Sy labels
+encoded in the
+.Sy CTF
+container,
+the types of
+.Sy data objects ,
+the internal
+.Sy string
+table,
+the types of the return function and the arguments for
+.Sy functions ,
+and of course, it displays information about the
+.Sy types
+defined in the
+.Sy CTF
+container.
+.Lp
+.Nm
+can also be used to dump out the raw
+.Sy CTF
+data and send it to another file.
+When writing out data, it always ensures that the
+.Sy CTF
+data is decompressed.
+In this form, the
+.Sy CTF
+data can be inspected using
+.Nm
+and other tools such as
+.Xr mdb 1 .
+.Lp
+When no options are specified,
+.Nm
+displays all information.
+However, when the
+.Fl u
+option is used, then no information is displayed by default, unless
+requested through the appropriate option.
+.Sh OPTIONS
+The following options are supported:
+.Bl -hang -width Ds
+.It Fl d
+.Bd -filled -compact
+Dump the types of symbols that correspond to objects.
+.Ed
+.It Fl f
+.Bd -filled -compact
+Dump the types of the return values and arguments of the functions.
+.Ed
+.It Fl h
+.Bd -filled -compact
+Dump the
+.Sy CTF
+header
+.Ed
+.It Fl l
+.Bd -filled -compact
+Dump all
+.Sy CTF
+labels associated with the file.
+.Ed
+.It Fl p Ar parent
+.Bd -filled -compact
+Use the type information in
+.Em parent
+to supplement output.
+This is useful when a
+.Nm CTF
+container has been
+.Sy uniquified
+against
+.Em parent .
+This allows
+.Nm
+to use the names of types when used with
+.Fl t .
+.Ed
+.It Fl s
+.Bd -filled -compact
+Dump the internal
+.Sy CTF
+string table
+.Ed
+.It Fl S
+.Bd -filled -compact
+Displays statistics about the
+.Sy CTF
+container.
+.Ed
+.It Fl t
+.Bd -filled -compact
+Dump the type information contained in the
+.Sy CTF
+conatiner.
+.Ed
+.It Fl u Ar outfile
+.Bd -filled -compact
+Copies the uncompressed
+.Sy CTF
+data to the file specified by
+.Em outfile .
+This can be used to make it easier to inspect the raw
+.Sy CTF
+data.
+.Ed
+.El
+.Sh OUTPUT
+When the
+.Nm
+utility is executed with its default options, it prints out a textual
+representation of the
+.Sy CTF
+information.
+Note, the output format of
+.Nm
+is subject to change at any time and should not be relied upon as a
+stable format to be used for parsing.
+.Ss CTF Header
+This section describes the values in the
+.Sy CTF
+header.
+Each line in the section describes the value of one of the
+members of the header.
+For more information on the meaning and interpretation of these members,
+see
+.Xr ctf 4 .
+.Ss Label Table
+This section describes information about the labels present in the
+.Sy CTF
+information.
+Each entry in this section, if present, starts with a
+number and is followed by a string.
+An example entry in the label section might look like:
+.Bd -literal
+\&...
+ 2270 joyent_20151001T070028Z
+\&...
+.Ed
+.Pp
+The number,
+.Em 2270 ,
+represents the last type that the label applies to.
+The string,
+.Em joyent_20151001T070028Z ,
+is the name of the label.
+In this case, if there were no other labels,
+it would indicate that the label applied to all types up to, and
+including, the type number 2270.
+For more information on how labels are used with
+.Sy CTF
+information, see the section
+.Em The Label Section
+in
+.Xr ctf 4 .
+.Ss Data Objects
+This section describes the type information relating to data objects
+from the symbol table.
+An entry for a data object consists of four columns.
+The first column is just a monotonic ID.
+The second number is the type id of the object.
+The third column is the name of the symbol and the fourth column is the
+corresponding index from the symbol table.
+.Pp
+Take for example, the following couple of entries:
+.Bd -literal
+\&...
+ [0] 13 hz (48)
+ [1] 78 _nd (49)
+ [2] 1656 __pfmt_label (56)
+ [3] 926 _aio_hash (68)
+ [4] 13 _lio_free (70)
+ [5] 1321 u8_number_of_bytes (73)
+\&...
+.Ed
+.Pp
+Let's take the first entry in the list above.
+The symbol is named
+.Sy hz .
+It is the first data object, as indicated by the number zero in
+brackets.
+It has a type id of 13 and in this case, it has a symbol table index of
+48.
+.Ss Functions
+This section describes the type information for functions.
+For each function present in the symbol table with type information, the
+function's entry into the function section, the function's name, the
+function's symbol table index, the function's return type, and the types
+of the function's arguments are printed.
+If a function is a variadic function, then the variadic argument is
+printed as the string
+.Sy '...' .
+.Pp
+Take for example, the following couple of entries:
+.Bd -literal
+\&...
+ [687] pfprint_stack (3110) returns: 11 args: (385, 115, 29, 1704, 223, 116, 2)
+ [688] pfprint_stddev (3111) returns: 11 args: (385, 115, 29, 1704, 223, 116, 2)
+ [689] pfprint_quantize (3112) returns: 11 args: (385, 115, 29, 1704, 223, 116, 2)
+ [690] pfprint_lquantize (3113) returns: 11 args: (385, 115, 29, 1704, 223, 116, 2)
+ [691] pfprint_llquantize (3114) returns: 11 args: (385, 115, 29, 1704, 223, 116, 2)
+\&...
+.Ed
+.Pp
+The first column is the function's entry number in the function type
+information section.
+It is enclosed in brackets.
+The next column is the function's name and it is followed in parenthesis
+by the its index in the
+symbol table.
+The following portions of this entry describe the return
+type and then all of the arguments, in positional order.
+.Ss Types
+The types section gives information about each type in the
+.Sy CTF
+container.
+Each entry begins with its type identifier.
+The type identifier may either be in square brackets or in angle
+brackets.
+If the type identifier is enclosed in angle brackets, then that
+represents that it is a root type or top-level type.
+If it is square brackets, then it is not.
+For more information on root types, see
+.Xr ctf 4 .
+.Pp
+Next, the type will have its name and kind.
+If it is an array, it will be followed with a subscript that describes
+the number of entries in the array.
+If it is a pointer, it will followed by the
+.Sy *
+symbol to indicate that it is a pointer.
+If the type has the
+.Sy const ,
+.Sy volatile ,
+.Sy typedef ,
+or
+.Sy restrict
+keyword applied to it, that will precede the name.
+All of these reference types, including pointer, will then be followed
+with an example of the type that they refer to.
+.Pp
+Types which are an integral or floating point value will be followed by
+information about their encoding and the number of bits represented in
+the type.
+.Pp
+Arrays will be followed by two different entries, the contents and
+index.
+The contents member contains the type id of the array's contents
+and the index member describes a type which can represent the array's
+index.
+.Pp
+Structures and unions will be preceded with the corresponding C keyword,
+.Sy struct
+or
+.Sy union .
+After that, the size in bytes of the structure will be indicated.
+ON each subsequent line, a single member will be listed.
+That line will contain the member's name, it's type identifier, and the
+offset into the structure that it can be found in, in bits.
+.Pp
+The following show examples of type information for all of these
+different types:
+.Bd -literal
+\&...
+ [5] char [12] contents: 1, index: 2
+ [6] short encoding=SIGNED offset=0 bits=16
+ <7> struct exit_status (4 bytes)
+ e_termination type=6 off=0
+ e_exit type=6 off=16
+
+ <8> typedef time_t refers to 2
+ <9> struct utmp (36 bytes)
+ ut_user type=3 off=0
+ ut_id type=4 off=64
+ ut_line type=5 off=96
+ ut_pid type=6 off=192
+ ut_type type=6 off=208
+ ut_exit type=7 off=224
+ ut_time type=8 off=256
+
+ <10> struct utmp * refers to 9
+ [11] const struct utmp refers to 9
+ [12] const struct utmp * refers to 11
+ <13> int encoding=SIGNED offset=0 bits=32
+ <14> typedef int32_t refers to 13
+\&...
+.Ed
+.Ss String Table
+This section describes all of the strings that are present in the
+.Sy CTF
+container.
+Each line represents an entry in the string table.
+First the byte offset into the string table is shown in brackets and
+then the
+string's value is displayed.
+Note the following examples:
+.Bd -literal
+ [0] \0
+ [1] joyent_20151001T070028Z
+ [25] char
+ [30] long
+ [35] short
+.Ed
+.Ss Statistics
+This section contains miscellaneous statistics about the
+.Sy CTF
+data present.
+Each line contains a single statistic.
+A brief explanation of the statistic is placed first, followed by an
+equals sign, and then finally the value.
+.Sh EXIT STATUS
+.Bl -inset
+.It Sy 0
+.Dl Execution completed successfully.
+.It Sy 1
+.Dl A fatal error occurred.
+.It Sy 2
+.Dl Invalid command line options were specified.
+.El
+.Sh EXAMPLES
+.Sy Example 1
+Displaying the Type Section of a Single File
+.Lp
+The following example dumps the type section of the file
+.Sy /usr/lib/libc.so.1 .
+.Bd -literal -offset 6n
+$ ctfdump -t /usr/lib/libc.so.1
+- Types ----------------------------------------------------
+
+ <1> int encoding=SIGNED offset=0 bits=32
+ <2> long encoding=SIGNED offset=0 bits=32
+ <3> typedef pid_t refers to 2
+ <4> unsigned int encoding=0x0 offset=0 bits=32
+ <5> typedef uid_t refers to 4
+ <6> typedef gid_t refers to 5
+ <7> typedef uintptr_t refers to 4
+\&...
+.Ed
+.Lp
+.Sy Example 2
+Dumping the CTF data to Another File
+.Lp
+The following example dumps the entire CTF data from the file
+.Sy /usr/lib/libc.so.1
+and places it into the file
+.Sy ctf.out .
+This then shows how you can use the
+.Xr mdb 1
+to inspect its contents.
+.Bd -literal -offset 6n
+$ ctfdump -u ctf.out /usr/lib/libc.so.1
+$ mdb ./ctf.out
+> ::typedef -r /usr/lib/libctf.so.1
+> 0::print ctf_header_t
+{
+ cth_preamble = {
+ ctp_magic = 0xcff1
+ ctp_version = 0x2
+ ctp_flags = 0
+ }
+ cth_parlabel = 0
+ cth_parname = 0
+ cth_lbloff = 0
+ cth_objtoff = 0x8
+ cth_funcoff = 0x5e0
+ cth_typeoff = 0x7178
+ cth_stroff = 0x12964
+ cth_strlen = 0x7c9c
+}
+.Ed
+.Sh INTERFACE STABILITY
+The command syntax is
+.Sy Committed .
+The output format is
+.Sy Uncommitted .
+.Sh SEE ALSO
+.Xr ctfdiff 1 ,
+.Xr dump 1 ,
+.Xr elfdump 1 ,
+.Xr mdb 1 ,
+.Xr ctf 4
diff --git a/usr/src/man/man1/hostname.1 b/usr/src/man/man1/hostname.1
index 8d81482755..74e9c16938 100644
--- a/usr/src/man/man1/hostname.1
+++ b/usr/src/man/man1/hostname.1
@@ -1,8 +1,9 @@
.\" Copyright (c) 1992, Sun Microsystems, Inc.
+.\" Copyright 2016 Joyent, Inc.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.Dd May 12, 2016
+.Dd Aug 26, 2016
.Dt HOSTNAME 1
.Os
.Sh NAME
@@ -20,6 +21,19 @@ command prints the name of the current host, as given before the
prompt.
The super-user can set the hostname by giving
.Ar name-of-host .
+.Pp
+While setting the hostname changes the hostname for the running system,
+it does not persist the change.
+The proper way to update the hostname will vary depending on how the
+system is configured.
+For most systems, the persistent hostname is stored in the file
+.Pa /etc/nodename .
+See
+.Xr nodename 4
+for more information on how to update it.
+Note, the
+.Pa /etc/nodename
+file may be ignored in cases where the system is configured to use DHCP.
.Sh OPTIONS
.Bl -tag -width Ds
.It Fl s
@@ -27,4 +41,5 @@ Prints only the part of the hostname preceding the first dot.
.El
.Sh SEE ALSO
.Xr uname 1 ,
+.Xr nodename 4 ,
.Xr attributes 5
diff --git a/usr/src/man/man1/ld.1 b/usr/src/man/man1/ld.1
index 5d26bbb556..d44c1e1139 100644
--- a/usr/src/man/man1/ld.1
+++ b/usr/src/man/man1/ld.1
@@ -24,7 +24,7 @@ ld \- link-editor for object files
[\fB-z\fR combreloc | nocombreloc ] [\fB-z\fR defs | nodefs]
[\fB-z\fR direct | nodirect] [\fB-z\fR endfiltee]
[\fB-z\fR fatal-warnings | nofatal-warnings ] [\fB-z\fR finiarray=\fIfunction\fR]
-[\fB-z\fR globalaudit] [\fB-z\fR groupperm | nogroupperm]
+[\fB-z\fR globalaudit] [\fB-z\fR groupperm | nogroupperm]
[\fB-z\fR guidance[=\fIid1\fR,\fIid2\fR...] [\fB-z\fR help ]
[\fB-z\fR ignore | record] [\fB-z\fR initarray=\fIfunction\fR] [\fB-z\fR initfirst]
[\fB-z\fR interpose] [\fB-z\fR lazyload | nolazyload]
diff --git a/usr/src/man/man1/ld.so.1.1 b/usr/src/man/man1/ld.so.1.1
index 4b14ca4f1a..19afbbf3d6 100644
--- a/usr/src/man/man1/ld.so.1.1
+++ b/usr/src/man/man1/ld.so.1.1
@@ -1,9 +1,10 @@
'\"
.\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved
+.\" Copyright (c) 2014, Joyent, Inc. All Rights Reserved
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
.\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with
.\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH LD.SO.1 1 "Oct 5, 2012"
+.TH LD.SO.1 1 "May 8, 2014"
.SH NAME
ld.so.1 \- runtime linker for dynamic objects
.SH SYNOPSIS
@@ -574,6 +575,24 @@ aid debugging. See also the \fBRTLD_DI_SETSIGNAL\fR request to
.RE
.sp
+.ne 2
+.na
+.BR LD_TOXIC_PATH,
+.BR LD_TOXIC_PATH_32,
+.BR LD_TOXIC_PATH_64,
+.ad
+.sp .6
+.RS 4n
+The toxic path refers to a set of paths where by, if
+.B ld.so.1
+were to load a dependency on that path, rather than loading it, it
+should kill the process. This is useful when having built libraries that
+while matching the native architecture of the system, are not suitable
+to be used, for example, libraries that that correspond to an alternate
+release of an operating system.
+.RE
+
+.sp
.LP
Notice that environment variable names beginning with the
characters '\fBLD_\fR' are reserved for possible future enhancements to \fBld\fR(1) and
diff --git a/usr/src/man/man1/machid.1 b/usr/src/man/man1/machid.1
new file mode 100644
index 0000000000..cb95fa36b6
--- /dev/null
+++ b/usr/src/man/man1/machid.1
@@ -0,0 +1,25 @@
+'\" te
+.\" Copyright 1989 AT&T
+.\" Copyright (c) 1999, Sun Microsystems, Inc.
+.\" All Rights Reserved
+.\" Copyright 2015, Joyent, Inc.
+.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
+.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
+.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
+.TH MACHID 1 "Feb 27, 2015"
+.SH NAME
+machid, sun, i286, i386, i486, sparc \- get processor type truth value
+
+.SH DESCRIPTION
+.sp
+.LP
+These commands are obsolete and may be removed in a future version of the
+software.
+.sp
+.ne 2
+.na
+.SH NOTES
+.sp
+.LP
+The \fBmachid\fR family of commands is obsolete. Use \fBuname\fR \fB-p\fR and
+\fBuname\fR \fB-m\fR instead.
diff --git a/usr/src/man/man1/mdb.1 b/usr/src/man/man1/mdb.1
index 4ff373e3dc..a9a7ff4e31 100644
--- a/usr/src/man/man1/mdb.1
+++ b/usr/src/man/man1/mdb.1
@@ -1,6 +1,6 @@
'\" te
.\" Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved.
-.\" Copyright (c) 2012, Joyent, Inc. All Rights Reserved.
+.\" Copyright (c) 2017, Joyent, Inc. All Rights Reserved.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
@@ -3929,6 +3929,17 @@ default.
.sp
.ne 2
.na
+\fB\fBautowrap\fR\fR
+.ad
+.RS 25n
+Forces output to be autowrapped at the terminal width. When this option
+is enabled, \fBmdb\fR will autowrap output, making some attempt to inject
+newlines at word boundaries. This option is disabled by default.
+.RE
+
+.sp
+.ne 2
+.na
\fB\fBfollow_exec_mode=\fR\fImode\fR\fR
.ad
.RS 25n
diff --git a/usr/src/man/man1/nawk.1 b/usr/src/man/man1/nawk.1
index 425db5d299..2c27e1baa0 100644
--- a/usr/src/man/man1/nawk.1
+++ b/usr/src/man/man1/nawk.1
@@ -15,6 +15,12 @@ nawk \- pattern scanning and processing language
.SH SYNOPSIS
.LP
.nf
+\fB/usr/bin/awk\fR [\fB-F\fR \fIERE\fR] [\fB-v\fR \fIassignment\fR] \fI\&'program'\fR | \fB-f\fR \fIprogfile\fR...
+ [\fIargument\fR]...
+.fi
+
+.LP
+.nf
\fB/usr/bin/nawk\fR [\fB-F\fR \fIERE\fR] [\fB-v\fR \fIassignment\fR] \fI\&'program'\fR | \fB-f\fR \fIprogfile\fR...
[\fIargument\fR]...
.fi
@@ -28,7 +34,8 @@ nawk \- pattern scanning and processing language
.SH DESCRIPTION
.sp
.LP
-The \fB/usr/bin/nawk\fR and \fB/usr/xpg4/bin/awk\fR utilities execute
+The \fB/usr/bin/awk\fR, \fB/usr/bin/nawk\fR and \fB/usr/xpg4/bin/awk\fR
+utilities execute
\fIprogram\fRs written in the \fBnawk\fR programming language, which is
specialized for textual data manipulation. A \fBnawk\fR \fIprogram\fR is a
sequence of patterns and corresponding actions. The string specifying
diff --git a/usr/src/man/man1/pargs.1 b/usr/src/man/man1/pargs.1
index 3f8e2bae8c..58b7bfc7f9 100644
--- a/usr/src/man/man1/pargs.1
+++ b/usr/src/man/man1/pargs.1
@@ -1,20 +1,22 @@
'\" te
.\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved
+.\" Copyright 2015 Joyent, Inc.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH PARGS 1 "Jun 19, 2006"
+.TH PARGS 1 "Oct 5, 2015"
.SH NAME
-pargs \- print process arguments, environment variables, or auxiliary
+pargs, penv, pauxv \- print process arguments, environment variables, or auxiliary
vector
.SH SYNOPSIS
.LP
.nf
\fBpargs\fR [\fB-aceFlx\fR] [\fIpid\fR | \fIcore\fR]...
+\fBpauxv\fR [\fB-cF\fR] [\fIpid\fR | \fIcore\fR]...
+\fBpenv\fR [\fB-cF\fR] [\fIpid\fR | \fIcore\fR]...
.fi
.SH DESCRIPTION
-.sp
.LP
The \fBpargs\fR utility examines a target process or process core file and
prints arguments, environment variables and values, or the process auxiliary
@@ -32,10 +34,18 @@ the target process and the \fBpargs\fR process do not share a common character
encoding, \fBpargs\fR attempts to employ the \fBiconv\fR(3C) facility to
generate a printable version of the extracted strings. In the event that such
a conversion is impossible, strings are displayed as 7-bit \fBASCII\fR.
-.SH OPTIONS
.sp
.LP
-The following options are supported:
+The \fBpauxv\fR command is equivalent to running \fBpargs\fR with the
+\fB-x\fR option.
+.sp
+.LP
+The \fBpenv\fR command is equivalent to running \fBpargs\fR with the
+\fB-e\fR option.
+.SH OPTIONS
+.LP
+The following options are supported by \fBpargs\fR. Only the \fB-c\fR
+and \fB-F\fR options are supported by \fBpauxv\fR and \fBpenv\fR:
.sp
.ne 2
.na
@@ -98,7 +108,6 @@ Prints process auxiliary vector.
.RE
.SH OPERANDS
-.sp
.LP
The following operands are supported:
.sp
@@ -120,7 +129,6 @@ Process core file.
.RE
.SH USAGE
-.sp
.LP
Caution should be exercised when using the \fB-F\fR flag. Imposing two
controlling processes on one victim process can lead to chaos. Safety is
@@ -128,7 +136,6 @@ assured only if the primary controlling process, typically a debugger, has
stopped the victim process and the primary controlling process is doing nothing
at the moment of application of the \fBproc\fR tool in question.
.SH EXIT STATUS
-.sp
.LP
The following exit values are returned:
.sp
@@ -151,7 +158,6 @@ option).
.RE
.SH FILES
-.sp
.ne 2
.na
\fB\fB/proc/pid/*\fR\fR
@@ -161,7 +167,6 @@ Process information and control files.
.RE
.SH ATTRIBUTES
-.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
@@ -177,7 +182,6 @@ Interface Stability Evolving
.TE
.SH SEE ALSO
-.sp
.LP
\fBproc\fR(1), \fBiconv\fR(3C), \fBproc\fR(4), \fBascii\fR(5),
\fBattributes\fR(5), \fBenviron\fR(5), \fBformats\fR(5)
diff --git a/usr/src/man/man1/pfexec.1 b/usr/src/man/man1/pfexec.1
index 66e5e08420..5d5c9048ed 100644
--- a/usr/src/man/man1/pfexec.1
+++ b/usr/src/man/man1/pfexec.1
@@ -58,6 +58,12 @@ For \fBpfexec\fR to function correctly, the \fBpfexecd\fR daemon must be running
in the current zone. This is normally managed by the
"\fBsvc:/system/pfexec:default\fR" SMF service (see \fBsmf\fR(5)).
.SH USAGE
+.sp
+.LP
+For \fBpfexec\fR to function correctly, the \fBpfexecd\fR daemon must be running
+in the current zone. This is normally managed by the
+"\fBsvc:/system/pfexec:default\fR" SMF service (see \fBsmf\fR(5)).
+.SH USAGE
.LP
\fBpfexec\fR is used to execute commands with predefined process attributes,
such as specific user or group \fBID\fRs.
diff --git a/usr/src/man/man1/proc.1 b/usr/src/man/man1/proc.1
index 4a428e55fd..e61ae1d714 100644
--- a/usr/src/man/man1/proc.1
+++ b/usr/src/man/man1/proc.1
@@ -539,12 +539,12 @@ Interface Stability See below.
The human readable output is Uncommitted. The options are Committed.
.SH SEE ALSO
.LP
-\fBgcore\fR(1), \fBldd\fR(1), \fBpargs\fR(1), \fBpgrep\fR(1), \fBpkill\fR(1),
-\fBplimit\fR(1), \fBpmap\fR(1), \fBpreap\fR(1), \fBps\fR(1), \fBptree\fR(1),
-\fBppgsz\fR(1), \fBpwd\fR(1), \fBrlogin\fR(1), \fBtime\fR(1), \fBtruss\fR(1),
-\fBwait\fR(1), \fBfcntl\fR(2), \fBfstat\fR(2), \fBsetuid\fR(2),
-\fBdlopen\fR(3C), \fBsignal.h\fR(3HEAD), \fBcore\fR(4), \fBproc\fR(4),
-\fBprocess\fR(4), \fBattributes\fR(5), \fBzones\fR(5)
+\fBgcore\fR(1), \fBldd\fR(1), \fBpargs\fR(1), \fBpauxv\fR(1), \fBpenv\fR(1),
+\fBpgrep\fR(1), \fBpkill\fR(1), \fBplimit\fR(1), \fBpmap\fR(1), \fBpreap\fR(1),
+\fBps\fR(1), \fBptree\fR(1), \fBppgsz\fR(1), \fBpwd\fR(1), \fBrlogin\fR(1),
+\fBtime\fR(1), \fBtruss\fR(1), \fBwait\fR(1), \fBfcntl\fR(2), \fBfstat\fR(2),
+\fBsetuid\fR(2), \fBdlopen\fR(3C), \fBsignal.h\fR(3HEAD), \fBcore\fR(4),
+\fBproc\fR(4), \fBprocess\fR(4), \fBattributes\fR(5), \fBzones\fR(5)
.SH WARNINGS
.LP
The following \fBproc\fR tools stop their target processes while inspecting
diff --git a/usr/src/man/man1/ps.1 b/usr/src/man/man1/ps.1
index 695d4b7c29..f9ce79794a 100644
--- a/usr/src/man/man1/ps.1
+++ b/usr/src/man/man1/ps.1
@@ -37,6 +37,9 @@ displayed is controlled by the options.
Some options accept lists as arguments. Items in a list can be either separated
by commas or else enclosed in quotes and separated by commas or spaces. Values
for \fIproclist\fR and \fIgrplist\fR must be numeric.
+.sp
+.LP
+The \fBps\fR command also accepts BSD-style options. See \fBps\fR(1b).
.SH OPTIONS
.LP
The following options are supported:
@@ -1322,7 +1325,8 @@ Standard See \fBstandards\fR(5).
.SH SEE ALSO
.LP
\fBkill\fR(1), \fBlgrpinfo\fR(1), \fBnice\fR(1), \fBpagesize\fR(1),
-\fBpmap\fR(1), \fBpriocntl\fR(1), \fBwho\fR(1), \fBgetty\fR(1M), \fBproc\fR(4),
+\fBpmap\fR(1), \fBpriocntl\fR(1), \fBps\fR(1b), \fBwho\fR(1), \fBgetty\fR(1M),
+\fBproc\fR(4),
\fBttysrch\fR(4), \fBattributes\fR(5), \fBenviron\fR(5),
\fBresource_controls\fR(5), \fBstandards\fR(5), \fBzones\fR(5)
.SH NOTES
diff --git a/usr/src/man/man1/sed.1 b/usr/src/man/man1/sed.1
index 126402343c..cd805bd841 100644
--- a/usr/src/man/man1/sed.1
+++ b/usr/src/man/man1/sed.1
@@ -1,8 +1,6 @@
.\" Copyright (c) 1992, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
-.\" Copyright 2011 Nexenta Systems, Inc. All rights reserved.
-.\"
.\" This code is derived from software contributed to Berkeley by
.\" the Institute of Electrical and Electronics Engineers, Inc.
.\"
@@ -44,7 +42,8 @@
[\fB\-Ealnr\fP]
[\fB\-e\fP \fIcommand\fP]
[\fB\-f\fP \fIcommand_file\fP]
-[\fB\-I\fP[\fIextension\fP] | \fB\-i\fP[\fIextension\fP]]
+[\fB\-I\fP \fIextension\fP]
+[\fB\-i\fP \fIextension\fP]
[\fIfile ...\fP]
.SH DESCRIPTION
The
@@ -97,11 +96,16 @@ Append the editing commands found in the file
to the list of commands.
The editing commands should each be listed on a separate line.
.TP
-\fB\-I\fP[\fIextension\fP]
-Edit files in-place, saving backups if \fIextension\fP was specified.
-It is not recommended to omit saving backups when in-place editing files,
-as you risk corruption or partial content in situations where disk
-space is exhausted, etc.
+\fB\-I\fP \fIextension\fP
+Edit files in-place, saving backups with the specified
+\fIextension\fP.
+If a zero-length
+\fIextension\fP
+is given, no backup will be saved.
+It is not recommended to give a zero-length
+\fIextension\fP
+when in-place editing files, as you risk corruption or partial content
+in situations where disk space is exhausted, etc.
Note that in-place editing with
\fB\-I\fP
@@ -119,7 +123,7 @@ where using
\fB\-i\fP
is desired.
.TP
-\fB\-i\fP[\fIextension\fP]
+\fB\-i\fP \fIextension\fP
Edit files in-place similarly to
\fB\-I\fP,
but treat each file independently from other files.
diff --git a/usr/src/man/man1/zlogin.1 b/usr/src/man/man1/zlogin.1
index 7c99eb6cb1..476faab86f 100644
--- a/usr/src/man/man1/zlogin.1
+++ b/usr/src/man/man1/zlogin.1
@@ -13,43 +13,43 @@
.\" Portions Copyright [yyyy] [name of copyright owner]
.\" Copyright 2013 DEY Storage Systems, Inc.
.\" Copyright (c) 2014 Gary Mills
+.\" Copyright (c) 2015, Joyent, Inc. All Rights Reserved
.\" Copyright 2015 Nexenta Systems, Inc. All rights reserved.
-.TH ZLOGIN 1 "Mar 17, 2015"
+.TH ZLOGIN 1 "Mar 30, 2015"
.SH NAME
zlogin \- enter a zone
.SH SYNOPSIS
.LP
.nf
-\fBzlogin\fR [\fB-dCEQ\fR] [\fB-e\fR \fIc\fR] [\fB-l\fR \fIusername\fR] \fIzonename\fR
+\fBzlogin\fR [\fB-dCEINQ\fR] [\fB-e\fR \fIc\fR] [\fB-l\fR \fIusername\fR] \fIzonename\fR
.fi
.LP
.nf
-\fBzlogin\fR [\fB-nEQS\fR] [\fB-e\fR \fIc\fR] [\fB-l\fR \fIusername\fR] \fIzonename\fR \fIutility\fR
+\fBzlogin\fR [\fB-inEQS\fR] [\fB-e\fR \fIc\fR] [\fB-l\fR \fIusername\fR] \fIzonename\fR \fIutility\fR
[\fIargument\fR]...
.fi
.SH DESCRIPTION
-.sp
.LP
The \fBzlogin\fR utility is used by the administrator to enter an operating
system zone. Only a superuser operating in the global system zone can use this
utility.
.sp
.LP
-\fBzlogin\fR operates in one of three modes:
+\fBzlogin\fR operates in one of four modes:
.sp
.ne 2
.na
\fBInteractive Mode\fR
.ad
.RS 24n
-If no utility argument is given and the stdin file descriptor for the
-\fBzlogin\fR process is a tty device, \fBzlogin\fR operates in \fBinteractive
-mode\fR. In this mode, \fBzlogin\fR creates a new pseudo terminal for use
-within the login session. Programs requiring a tty device, for example,
-\fBvi\fR(1), work properly in this mode. In this mode, \fBzlogin\fR invokes
-\fBlogin\fR(1) to provide a suitable login session.
+If no utility argument is given or if the \fB-i\fR option is specified, and the
+stdin file descriptor for the \fBzlogin\fR process is a tty device, \fBzlogin\fR
+operates in \fBinteractive mode\fR. In this mode, \fBzlogin\fR creates a new
+pseudo terminal for use within the login session. Programs requiring a tty
+device, for example, \fBvi\fR(1), work properly in this mode. In this mode,
+\fBzlogin\fR invokes \fBlogin\fR(1) to provide a suitable login session.
.RE
.sp
@@ -58,11 +58,12 @@ within the login session. Programs requiring a tty device, for example,
\fBNon-Interactive Mode\fR
.ad
.RS 24n
-If a utility is specified, \fBzlogin\fR operates in \fBnon-interactive mode\fR.
-This mode can be useful for script authors since stdin, stdout, and stderr are
-preserved and the exit status of \fIutility\fR is returned upon termination. In
-this mode, \fBzlogin\fR invokes \fBsu\fR(1M) in order to set up the user's
-environment and to provide a login environment.
+If a utility is specified and the \fB-i\fR option is not specified, \fBzlogin\fR
+operates in \fBnon-interactive mode\fR. This mode can be useful for script
+authors since stdin, stdout, and stderr are preserved and the exit status of
+\fIutility\fR is returned upon termination. In this mode, \fBzlogin\fR invokes
+\fBsu\fR(1M) in order to set up the user's environment and to provide a login
+environment.
.sp
The specified command is passed as a string and interpreted by a shell running
in the non-global zone. See \fBrsh\fR(1).
@@ -80,8 +81,17 @@ available once the zone is in the installed state. Connections to the console
are persistent across reboot of the zone.
.RE
-.SH OPTIONS
.sp
+.ne 2
+.na
+\fBStandalone-processs Interactive Mode\fR
+.ad
+.RS 24n
+If the \fB-I\fR option is specified the user is connected to the zone's stdin,
+stdout and stderr \fBzfd(7D)\fR devices.
+.RE
+
+.SH OPTIONS
.LP
The following options are supported:
.sp
@@ -127,6 +137,25 @@ login by using the escape sequence character.
.sp
.ne 2
.na
+\fB\fB-i\fR\fR
+.ad
+.RS 15n
+Forces interactive mode when a utility argument is specified.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fB-I\fR\fR
+.ad
+.RS 15n
+Connects to the zone's \fBzfd(7D)\fR devices.
+.RE
+
+.sp
+.sp
+.ne 2
+.na
\fB\fB-l\fR \fIusername\fR\fR
.ad
.RS 15n
@@ -149,6 +178,17 @@ and the shell which invokes \fBzlogin\fR both read from standard input.
.sp
.ne 2
.na
+\fB-N\fR
+.ad
+.RS 15n
+Nohup. This may only be used with the -I option to avoid sending EOF to the zfd
+device when zlogin's stdin receives EOF. It can also be toggled by sending
+\fBSIGUSR1\fR to an attached zlogin process.
+.RE
+
+.sp
+.ne 2
+.na
\fB-Q\fR
.ad
.RS 15n
@@ -172,7 +212,6 @@ other forms of login have become impossible.
.RE
.SS "Escape Sequences"
-.sp
.LP
Lines that you type that start with the tilde character (\fB~\fR) are "escape
sequences". The escape character can be changed using the \fB-e\fR option.
@@ -187,12 +226,10 @@ host breaks the connection with no warning to the zone's end.
.RE
.SH SECURITY
-.sp
.LP
Once a process has been placed in a zone other than the global zone, the
process cannot change zone again, nor can any of its children.
.SH OPERANDS
-.sp
.LP
The following operands are supported:
.sp
@@ -223,7 +260,6 @@ Arguments passed to the utility.
.RE
.SH EXIT STATUS
-.sp
.LP
In interactive and non-interactive modes, the \fBzlogin\fR utility exits when
the command or shell in the non-global zone exits. In non-interactive mode, the
@@ -268,7 +304,6 @@ mode.
.RE
.SH ATTRIBUTES
-.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
@@ -284,12 +319,10 @@ Interface Stability Evolving
.TE
.SH SEE ALSO
-.sp
.LP
\fBlogin\fR(1), \fBrsh\fR(1), \fBvi\fR(1), \fBsu\fR(1M), \fBzoneadm\fR(1M),
\fBzonecfg\fR(1M), \fBattributes\fR(5), \fBzones\fR(5)
.SH NOTES
-.sp
.LP
\fBzlogin\fR fails if its open files or any portion of its address space
corresponds to an NFS file. This includes the executable itself or the shared
diff --git a/usr/src/man/man1m/Makefile b/usr/src/man/man1m/Makefile
index 55c4db738f..6efc7db3ff 100644
--- a/usr/src/man/man1m/Makefile
+++ b/usr/src/man/man1m/Makefile
@@ -19,7 +19,7 @@
# Copyright (c) 2017, Chris Fraire <cfraire@me.com>.
#
-include $(SRC)//Makefile.master
+include $(SRC)//Makefile.master
MANSECT= 1m
@@ -521,7 +521,10 @@ _MANFILES= 6to4relay.1m \
uucleanup.1m \
uusched.1m \
uuxqt.1m \
+ vfsstat.1m \
vmstat.1m \
+ vndadm.1m \
+ vndstat.1m \
volcopy.1m \
volcopy_ufs.1m \
vscanadm.1m \
@@ -697,7 +700,6 @@ hal-set-property.1m := LINKSRC = hal-get-property.1m
poweroff.1m := LINKSRC = halt.1m
-
comsat.1m := LINKSRC = in.comsat.1m
fingerd.1m := LINKSRC = in.fingerd.1m
rarpd.1m := LINKSRC = in.rarpd.1m
diff --git a/usr/src/man/man1m/dladm.1m b/usr/src/man/man1m/dladm.1m
index 376d366a43..d10f529ecb 100644
--- a/usr/src/man/man1m/dladm.1m
+++ b/usr/src/man/man1m/dladm.1m
@@ -16,7 +16,7 @@ dladm \- administer data links
.LP
.nf
\fBdladm show-link\fR [\fB-P\fR] [\fB-s\fR [\fB-i\fR \fIinterval\fR]] [[\fB-p\fR] \fB-o\fR \fIfield\fR[,...]] [\fIlink\fR]
-\fBdladm rename-link\fR [\fB-R\fR \fIroot-dir\fR] \fIlink\fR \fInew-link\fR
+\fBdladm rename-link\fR [\fB-R\fR \fIroot-dir\fR] [\fB-z\fR \fIzonename\fR] \fIlink\fR \fInew-link\fR
.fi
.LP
@@ -99,9 +99,11 @@ dladm \- administer data links
.LP
.nf
-\fBdladm set-linkprop\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] \fB-p\fR \fIprop\fR=\fIvalue\fR[,...] \fIlink\fR
-\fBdladm reset-linkprop\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] [\fB-p\fR \fIprop\fR[,...]] \fIlink\fR
-\fBdladm show-linkprop\fR [\fB-P\fR] [[\fB-c\fR] \fB-o\fR \fIfield\fR[,...]] [\fB-p\fR \fIprop\fR[,...]] [\fIlink\fR]
+\fBdladm set-linkprop\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] [\fB-z\fR \fIzonename\fR] \fB-p\fR \fIprop\fR=\fIvalue\fR[,...]
+ \fIlink\fR
+\fBdladm reset-linkprop\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] [\fB-z\fR \fIzonename\fR] [\fB-p\fR \fIprop\fR[,...]] \fIlink\fR
+\fBdladm show-linkprop\fR [\fB-P\fR] [\fB-z\fR \fIzonename\fR] [[\fB-c\fR] \fB-o\fR \fIfield\fR[,...]]
+ [\fB-p\fR \fIprop\fR[,...]] [\fIlink\fR]
.fi
.LP
@@ -116,9 +118,9 @@ dladm \- administer data links
\fBdladm create-vnic\fR [\fB-t\fR] \fB-l\fR \fIlink\fR [\fB-R\fR \fIroot-dir\fR] [\fB-m\fR \fIvalue\fR | auto |
{factory \fB-n\fR \fIslot-identifier\fR]} | {random [\fB-r\fR \fIprefix\fR]}]
[\fB-v\fR \fIvlan-id\fR] [\fB-p\fR \fIprop\fR=\fIvalue\fR[,...]] \fIvnic-link\fR
-\fBdladm delete-vnic\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] \fIvnic-link\fR
+\fBdladm delete-vnic\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] [\fB-z\fR \fIzonename\fR] \fIvnic-link\fR
\fBdladm show-vnic\fR [\fB-pP\fR] [\fB-s\fR [\fB-i\fR \fIinterval\fR]] [\fB-o\fR \fIfield\fR[,...]]
- [\fB-l\fR \fIlink\fR] [\fIvnic-link\fR]
+ [\fB-l\fR \fIlink\fR] [\fB-z\fR \fIzonename\fR] [\fIvnic-link\fR]
.fi
.LP
@@ -140,6 +142,14 @@ dladm \- administer data links
.LP
.nf
+\fBdladm create-overlay\fR [\fB-t\fR] \fB-e\fR \fIencap\fR \fB-s\fR \fIsearch\fR \fB-v\fR \fIvnetid\fR [\fB-p\fR \fIprop\fR=\fIvalue\fR[,...]] \fIoverlay\fR
+\fBdladm delete-overlay\fR \fIoverlay\fR
+\fBdladm modify-overlay\fR \fB-d\fR \fImac\fR | \fB-f\fR | \fB-s\fR \fImac=ip:port\fR \fIoverlay\fR
+\fBdladm show-overlay\fR [ \fB-f\fR | \fB-t\fR ] [[\fB-p\fR] \fB-o\fR \fIfield\fR[,...]] [\fIoverlay\fR]
+.fi
+
+.LP
+.nf
\fBdladm show-usage\fR [\fB-a\fR] \fB-f\fR \fIfilename\fR [\fB-p\fR \fIplotfile\fR \fB-F\fR \fIformat\fR] [\fB-s\fR \fItime\fR]
[\fB-e\fR \fItime\fR] [\fIlink\fR]
.fi
@@ -227,9 +237,9 @@ A WiFi datalink.
.ad
.sp .6
.RS 4n
-A virtual network interface created on a link or an \fBetherstub\fR. It is a
-pseudo device that can be treated as if it were an network interface card on a
-machine.
+A virtual network interface created on a link, an \fBetherstub\fR, or \fBan
+overlay\fR. It is a pseudo device that can be treated as if it were an network
+interface card on a machine.
.RE
.sp
@@ -297,6 +307,20 @@ use any alphanumeric characters, as well as underscore (\fB_\fR), period
characters.
.RE
+.sp
+.ne 2
+.na
+.B overlay
+.ad
+.sp .6
+.RS 4n
+An overlay instance, identified by an administratively-chosen name. An overlay
+can be used to create or join an existing software defined network.
+VNICs created on an overlay will appear to be connected by a local virtual
+switch and will also be connected to interfaces on matching overlays provided by
+other hosts. For more information on overlay devices, see \fBoverlay\fR(5).
+.RE
+
.SS "Options"
.LP
Each \fBdladm\fR subcommand has its own set of options. However, many of the
@@ -569,8 +593,7 @@ will be displayed only once.
.sp
.ne 2
.na
-\fB\fBdladm rename-link\fR [\fB-R\fR \fIroot-dir\fR] \fIlink\fR
-\fInew-link\fR\fR
+\fB\fBdladm rename-link\fR [\fB-R\fR \fIroot-dir\fR] [\fB-z\fR \fIzonename\fR] \fIlink\fR \fInew-link\fR\fR
.ad
.sp .6
.RS 4n
@@ -588,6 +611,16 @@ examples of how this subcommand is used.
See "Options," above.
.RE
+.sp
+.ne 2
+.na
+\fB\fB-z\fR \fIzonename\fR
+.ad
+.sp .6
+.RS 4n
+A link assigned to a zone can only be renamed while the zone is in the ready state.
+.RE
+
.RE
.sp
@@ -3193,8 +3226,7 @@ Extended output is displayed for \fBPTYPE\fR values of \fBcurrent\fR,
.sp
.ne 2
.na
-\fB\fBdladm set-linkprop\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] \fB-p\fR
-\fIprop\fR=\fIvalue\fR[,...] \fIlink\fR\fR
+\fB\fBdladm set-linkprop\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] [\fB-z\fR \fIzonename\fR] \fB-p\fR \fIprop\fR=\fIvalue\fR[,...] \fIlink\fR\fR
.ad
.sp .6
.RS 4n
@@ -3226,6 +3258,16 @@ See "Options," above.
.sp
.ne 2
.na
+\fB\fB-z\fR \fIzonename\fR
+.ad
+.sp .6
+.RS 4n
+Operate on a link that has been delegated to the specified zone.
+.RE
+
+.sp
+.ne 2
+.na
\fB\fB-p\fR \fIprop\fR=\fIvalue\fR[,...], \fB--prop\fR
\fIprop\fR=\fIvalue\fR[,...]\fR
.ad
@@ -3245,8 +3287,7 @@ same value.
.sp
.ne 2
.na
-\fB\fBdladm reset-linkprop\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] [\fB-p\fR
-\fIprop\fR,...] \fIlink\fR\fR
+\fB\fBdladm reset-linkprop\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] [\fB-z\fR \fIzonename\fR] [\fB-p\fR \fIprop\fR,...] \fIlink\fR\fR
.ad
.sp .6
.RS 4n
@@ -3278,6 +3319,16 @@ See "Options," above.
.sp
.ne 2
.na
+\fB\fB-z\fR \fIzonename\fR
+.ad
+.sp .6
+.RS 4n
+Operate on a link that has been delegated to the specified zone.
+.RE
+
+.sp
+.ne 2
+.na
\fB\fB-p\fR \fIprop, ...\fR, \fB--prop\fR=\fIprop, ...\fR\fR
.ad
.sp .6
@@ -3292,8 +3343,7 @@ the same value.
.sp
.ne 2
.na
-\fB\fBdladm show-linkprop\fR [\fB-P\fR] [[\fB-c\fR] \fB-o\fR
-\fIfield\fR[,...]][\fB-p\fR \fIprop\fR[,...]] [\fIlink\fR]\fR
+\fB\fBdladm show-linkprop\fR [\fB-P\fR] [\fB-z\fR \fIzonename\fR] [[\fB-c\fR] \fB-o\fR \fIfield\fR[,...]][\fB-p\fR \fIprop\fR[,...]] [\fIlink\fR]\fR
.ad
.sp .6
.RS 4n
@@ -3411,6 +3461,16 @@ Display persistent link property information
.sp
.ne 2
.na
+\fB\fB-z\fR \fIzonename\fR
+.ad
+.sp .6
+.RS 4n
+Operate on a link that has been delegated to the specified zone.
+.RE
+
+.sp
+.ne 2
+.na
\fB\fB-p\fR \fIprop, ...\fR, \fB--prop\fR=\fIprop, ...\fR\fR
.ad
.sp .6
@@ -3728,8 +3788,7 @@ A comma-separated list of properties to set to the specified values.
.sp
.ne 2
.na
-\fB\fBdladm delete-vnic\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR]
-\fIvnic-link\fR\fR
+\fB\fBdladm delete-vnic\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] [\fB-z\fR \fIzonename\fR] \fIvnic-link\fR\fR
.ad
.sp .6
.RS 4n
@@ -3755,13 +3814,22 @@ next reboot.
See "Options," above.
.RE
+.sp
+.ne 2
+.na
+\fB\fB-z\fR \fIzonename\fR
+.ad
+.sp .6
+.RS 4n
+Operate on a link that has been delegated to the specified zone.
+.RE
+
.RE
.sp
.ne 2
.na
-\fB\fBdladm show-vnic\fR [\fB-pP\fR] [\fB-s\fR [\fB-i\fR \fIinterval\fR]]
-[\fB-o\fR \fIfield\fR[,...]] [\fB-l\fR \fIlink\fR] [\fIvnic-link\fR]\fR
+\fB\fBdladm show-vnic\fR [\fB-pP\fR] [\fB-s\fR [\fB-i\fR \fIinterval\fR]] [\fB-o\fR \fIfield\fR[,...]] [\fB-l\fR \fIlink\fR] [\fB-z\fR \fIzonename\fR] [\fIvnic-link\fR]\fR
.ad
.sp .6
.RS 4n
@@ -3904,6 +3972,16 @@ will be displayed only once.
Display information for all VNICs on the named link.
.RE
+.sp
+.ne 2
+.na
+\fB\fB-z\fR \fIzonename\fR
+.ad
+.sp .6
+.RS 4n
+Operate on a link that has been delegated to the specified zone.
+.RE
+
.RE
.sp
@@ -4321,6 +4399,349 @@ The tunnel destination address.
.sp
.ne 2
.na
+\fBdladm create-overlay\fR \fB-e\fR \fIencap\fR \fB-s\fR \fIsearch\fR
+\fB-v\fR \fIvnetid\fR [\fB-p\fR \fIprop\fR=\fIvalue\fR[,...]] \fIoverlay\fR
+.ad
+.sp .6
+.RS 4n
+Create an overlay device named \fIoverlay\fR.
+.sp
+Overlay devices are similar to etherstubs. VNICs can be created on top
+of them. However, unlike an etherstub which is local to the system, an
+overlay device can be configured to communicate to remote hosts,
+providing a means for network virtualization. The way in which it does
+this is described by the encapsulation module and the search plugin. For
+more information on these, see \fBoverlay\fR(5).
+.sp
+An overlay device has a series of required and optional properties. These
+properties vary based upon the search and encapsulation modules and are fully
+specified in \fBoverlay\fR(5). Not every property needs to be specified - some
+have default values which will be used if nothing specific is specified. For
+example, the default port for VXLAN comes from its IANA standard. If a
+required property is missing, the command will fail and inform you of the
+missing properties.
+.sp
+.ne 2
+.na
+\fB\fB-t\fR, \fB--temporary\fR\fR
+.ad
+.sp .6
+.RS 4n
+Specifies that the overlay is temporary. Temporary overlays last until
+the next reboot.
+.RE
+
+.sp
+.ne 2
+.na
+\fB-e\fR \fIencap\fR, \fB--encap\fR=\fIencap\fR
+.ad
+.sp .6
+.RS 4n
+Use \fIencap\fR as the encapsulation plugin for the overlay device
+\fIoverlay\fR. The encapsulation plugin determines how packets are transformed
+before being put on the wire.
+.RE
+
+.sp
+.ne 2
+.na
+\fB-s\fR \fIsearch\fR, \fB--search\fR=\fIsearch\fR
+.ad
+.sp .6
+.RS 4n
+Use \fIsearch\fR as the search plugin for \fIoverlay\fR. The search plugin
+determines how non-local targets are found and where packets are directed to.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fB-p\fR \fIprop\fR=\fIvalue\fR,..., \fB--prop\fR
+\fIprop\fR=\fIvalue\fR,...\fR
+.ad
+.sp .6
+.RS 4n
+A comma-separated list of properties to set to the specified values.
+.RE
+
+.sp
+.ne 2
+.na
+\fB-v\fR \fIvnetid\fR, \fB--vnetid\fR=\fIvnetid\fR
+.ad
+.sp .6
+.RS 4n
+Sets the virtual networking identifier to \fIvnetid\fR. A virtual network
+identifier determines is similar to a VLAN identifier, in that it identifies a
+unique virtual network. All overlay devices on the system share the same space
+for the virtual network identifier. However, the valid range of identifiers is
+determined by the encapsulation plugin specified by \fB-e\fR.
+.RE
+
+.RE
+
+.sp
+.ne 2
+.na
+\fBdladm delete-overlay\fR \fIoverlay\fR
+.ad
+.sp .6
+.RS 4n
+Delete the specified overlay. This will fail if there are VNICs on top of the
+device.
+.RE
+
+.sp
+.ne 2
+.na
+\fBdladm modify-overlay\fR \fB-d\fR \fImac\fR | \fB-f\fR | \fB-s\fR \fImac=ip:port\fR \fIoverlay\fR
+.ad
+.sp .6
+.RS 4n
+Modifies the target tables for the specified overlay.
+.sp
+The different options allow for different ways of modifying the target table.
+One of \fB-d\fR, \fB-f\fR, and \fB-s\fR is required. This is not applicable for
+all kinds of overlay devices. For more information, see \fBoverlay\fR(5).
+.sp
+.ne 2
+.na
+\fB-d\fR \fImac\fR, \fB--delete-entry\fR=\fImac\fR
+.ad
+.sp .6
+.RS 4n
+Deletes the entry for \fImac\fR from the target table for \fIoverlay\fR. Note,
+if a lookup is pending or outstanding, this does not cancel it or stop it from
+updating the value.
+.RE
+
+.sp
+.ne 2
+.na
+\fB-f\fR, \fB--flush-table\fR
+.ad
+.sp .6
+.RS 4n
+Flushes all values in the target table for \fIoverlay\fR.
+.RE
+
+.sp
+.ne 2
+.na
+\fB-s\fR \fImac\fR=\fIvalue\fR, \fB--set-entry\fR=\fImac\fR=\fIvalue\fR
+.ad
+.sp .6
+.RS 4n
+Sets the value of \fIoverlay\fR's target table entry for \fImac\fR to
+the specified value. The specified value varies upon the encapsulation
+plugin. The value may be a combination of a MAC address, IP address,
+and port. Generally, this looks like
+[\fImac\fR,][\fIIP\fR:][\fIport\fR]. If a component is the last one,
+then there is no need for a separator. eg. if just the MAC address or
+IP is needed, it would look like \fImac\fR and \fIIP\fR respectively.
+.RE
+
+.RE
+
+.sp
+.ne 2
+.na
+\fBdladm show-overlay\fR [ \fB-f\fR | \fB-t\fR ] [[\fB-p\fR] \fB-o\fR \fIfield\fR[,...]] [\fIoverlay\fR]
+.ad
+.sp .6
+.RS 4n
+Shows overlay configuration (the default), internal target tables (\fB-t\fR), or
+the FMA state (\fB-f\fR), either for all overlays or the specified overlay.
+.sp
+By default (with neither \fB-f\fR or \fB-t\fR specified), the following fields
+will be displayed:
+.sp
+.ne 2
+.na
+\fB\fBLINK\fR\fR
+.ad
+.sp .6
+.RS 4n
+The name of the overlay.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fBPROPERTY\fR\fR
+.ad
+.sp .6
+.RS 4n
+The name of the property.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fBPERM\fR\fR
+.ad
+.sp .6
+.RS 4n
+The read/write permissions of the property. The value shown is one of \fBr-\fR
+or \fBrw\fR.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fBVALUE\fR\fR
+.ad
+.sp .6
+.RS 4n
+The current property value. If the value is not set, it is shown as \fB--\fR.
+If it is unknown, the value is shown as \fB?\fR.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fBDEFAULT\fR\fR
+.ad
+.sp .6
+.RS 4n
+The default value of the property. If the property has no default value,
+\fB--\fR is shown.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fBPOSSIBLE\fR\fR
+.ad
+.sp .6
+.RS 4n
+A comma-separated list of the values the property can have. If the values span
+a numeric range, \fImin\fR - \fImax\fR might be shown as shorthand. If the
+possible values are unknown or unbounded, \fB--\fR is shown.
+.RE
+
+.sp
+When the \fB-f\fR option is displayed, the following fields will be displayed:
+.sp
+.ne 2
+.na
+\fB\fBLINK\fR\fR
+.ad
+.sp .6
+.RS 4n
+The name of the overlay.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fBSTATUS\fR\fR
+.ad
+.sp .6
+.RS 4n
+Either \fBONLINE\fR or \fBDEGRADED\fR.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fBDETAILS\fR\fR
+.ad
+.sp .6
+.RS 4n
+When the \fBoverlay\fR's status is \fBONLINE\fR, then this has the value
+\fB--\fR. Otherwise, when it is \fBDEGRADED\fR, this field provides a more
+detailed explanation as to why it's degraded.
+.RE
+
+.sp
+When the \fB-t\fR option is displayed, the following fields will be displayed:
+.sp
+.ne 2
+.na
+\fB\fBLINK\fR\fR
+.ad
+.sp .6
+.RS 4n
+The name of the overlay.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fBTARGET\fR\fR
+.ad
+.sp .6
+.RS 4n
+The target MAC address of a table entry.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fBDESTINATION\fR\fR
+.ad
+.sp .6
+.RS 4n
+The address that an encapsulated packet will be sent to when a packet has the
+address specified by \fBTARGET\fR.
+.RE
+
+The \fBshow-overlay\fR command supports the following options:
+
+.sp
+.ne 2
+.na
+\fB-f\fR, \fB--fma\fR
+.ad
+.sp .6
+.RS 4n
+Displays information about an overlay device's FMA state. For more
+information on the target table, see \fBoverlay\fR(5).
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fB-o\fR \fIfield\fR[,...], \fB--output\fR=\fIfield\fR\fR
+.ad
+.sp .6
+.RS 4n
+A case-insensitive, comma-separated list of output fields to display. The field
+name must be one of the fields listed above, or the special value \fBall\fR, to
+display all fields. The fields applicable to the \fB-o\fR option are limited to
+those listed under each output mode. For example, if using \fB-L\fR, only the
+fields listed under \fB-L\fR, above, can be used with \fB-o\fR.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fB-p\fR, \fB--parsable\fR\fR
+.ad
+.sp .6
+.RS 4n
+Display using a stable machine-parsable format. The \fB-o\fR option is
+required with \fB-p\fR. See "Parsable Output Format", below.
+.RE
+
+.sp
+.ne 2
+.na
+\fB-t\fR, \fB--target\fR
+.ad
+.sp .6
+.RS 4n
+Displays information about an overlay device's target table. For more
+information on the target table, see \fBoverlay\fR(5).
+.RE
+
+.RE
+
+.sp
+.ne 2
+.na
\fB\fBdladm show-usage\fR [\fB-a\fR] \fB-f\fR \fIfilename\fR [\fB-p\fR
\fIplotfile\fR \fB-F\fR \fIformat\fR] [\fB-s\fR \fItime\fR] [\fB-e\fR
\fItime\fR] [\fIlink\fR]\fR
@@ -5496,7 +5917,7 @@ Interface Stability Committed
.LP
\fBacctadm\fR(1M), \fBautopush\fR(1M), \fBifconfig\fR(1M), \fBipsecconf\fR(1M),
\fBndd\fR(1M), \fBpsrset\fR(1M), \fBwpad\fR(1M), \fBzonecfg\fR(1M),
-\fBattributes\fR(5), \fBieee802.3\fR(5), \fBdlpi\fR(7P)
+\fBattributes\fR(5), \fBieee802.3\fR(5), \fBoverlay\fR(5), \fBdlpi\fR(7P)
.SH NOTES
.LP
The preferred method of referring to an aggregation in the aggregation
diff --git a/usr/src/man/man1m/flowadm.1m b/usr/src/man/man1m/flowadm.1m
index 5eca181426..860d5f1faa 100644
--- a/usr/src/man/man1m/flowadm.1m
+++ b/usr/src/man/man1m/flowadm.1m
@@ -1,5 +1,6 @@
'\" te
.\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved
+.\" Copyright (c) 2011, Joyent, Inc. All Rights Reserved
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
@@ -11,14 +12,14 @@ services, containers, and virtual machines
.LP
.nf
\fBflowadm show-flow\fR [\fB-pP\fR] [\fB-S\fR] [\fB-s\fR [\fB-i\fR \fIinterval\fR]] [\fB-l\fR \fIlink\fR]
- [\fB-o\fR \fIfield\fR[,...]] [\fIflow\fR]
+ [\fB-o\fR \fIfield\fR[,...]] [\fB-z\fR \fIzonename\fR] [\fIflow\fR]
.fi
.LP
.nf
-\fBflowadm add-flow\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] \fB-l\fR \fIlink\fR \fB-a\fR \fIattr\fR=\fIvalue\fR[,...]
- \fB-p\fR \fIprop\fR=\fIvalue\fR[,...] \fIflow\fR
-\fBflowadm remove-flow\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] {\fB-l\fR \fIlink\fR | \fIflow\fR}
+\fBflowadm add-flow\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] [\fB-z\fR \fIzonename\fR] \fB-l\fR \fIlink\fR
+ \fB-a\fR \fIattr\fR=\fIvalue\fR[,...] \fB-p\fR \fIprop\fR=\fIvalue\fR[,...] \fIflow\fR
+\fBflowadm remove-flow\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] [\fB-z\fR \fIzonename\fR] {\fB-l\fR \fIlink\fR | \fIflow\fR}
.fi
.LP
@@ -75,8 +76,7 @@ The following subcommands are supported:
.sp
.ne 2
.na
-\fB\fBflowadm show-flow\fR [\fB-pP\fR] [\fB-s\fR [\fB-i\fR \fIinterval\fR]]
-[\fB-o\fR \fIfield\fR[,...]] [\fB-l\fR \fIlink\fR] [\fIflow\fR]\fR
+\fB\fBflowadm show-flow\fR [\fB-pP\fR] [\fB-s\fR [\fB-i\fR \fIinterval\fR]] [\fB-o\fR \fIfield\fR[,...]] [\fB-l\fR \fIlink\fR] [\fB-z\fR \fIzonename\fR] [\fIflow\fR]\fR
.ad
.sp .6
.RS 4n
@@ -221,14 +221,22 @@ Display information for all flows on the named link or information for the
named flow.
.RE
+.sp
+.ne 2
+.na
+\fB\fB-z\fR \fIzonename\fR
+.ad
+.sp .6
+.RS 4n
+Operate on a link that has been delegated to the specified zone.
+.RE
+
.RE
.sp
.ne 2
.na
-\fB\fBflowadm add-flow\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] \fB-l\fR
-\fIlink\fR \fB-a\fR \fIattr\fR=\fIvalue\fR[,...] \fB-p\fR
-\fIprop\fR=\fIvalue\fR[,...] \fIflow\fR\fR
+\fB\fBflowadm add-flow\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] [\fB-z\fR \fIzonename\fR] \fB-l\fR \fIlink\fR \fB-a\fR \fIattr\fR=\fIvalue\fR[,...] \fB-p\fR \fIprop\fR=\fIvalue\fR[,...] \fIflow\fR\fR
.ad
.sp .6
.RS 4n
@@ -266,6 +274,16 @@ persistent creation.
.sp
.ne 2
.na
+\fB\fB-z\fR \fIzonename\fR
+.ad
+.sp .6
+.RS 4n
+Operate on a link that has been delegated to the specified zone.
+.RE
+
+.sp
+.ne 2
+.na
\fB\fB-l\fR \fIlink\fR, \fB--link\fR=\fIlink\fR\fR
.ad
.sp .6
@@ -298,8 +316,7 @@ A comma-separated list of properties to be set to the specified values.
.sp
.ne 2
.na
-\fB\fBflowadm remove-flow\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] \fB-l\fR
-{\fIlink\fR | \fIflow\fR}\fR
+\fB\fBflowadm remove-flow\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] [\fB-z\fR \fIzonename\fR] \fB-l\fR {\fIlink\fR | \fIflow\fR}\fR
.ad
.sp .6
.RS 4n
@@ -329,6 +346,16 @@ persistent removal.
.sp
.ne 2
.na
+\fB\fB-z\fR \fIzonename\fR
+.ad
+.sp .6
+.RS 4n
+Operate on a link that has been delegated to the specified zone.
+.RE
+
+.sp
+.ne 2
+.na
\fB\fB-l\fR \fIlink\fR | \fIflow\fR, \fB--link\fR=\fIlink\fR | \fIflow\fR\fR
.ad
.sp .6
diff --git a/usr/src/man/man1m/prstat.1m b/usr/src/man/man1m/prstat.1m
index a5f02621cf..35cb6fbf24 100644
--- a/usr/src/man/man1m/prstat.1m
+++ b/usr/src/man/man1m/prstat.1m
@@ -1,10 +1,11 @@
'\" te
.\" Copyright (c) 2013 Gary Mills
.\" Copyright (c) 2006, 2009 Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright (c) 2017, Joyent, Inc. All Rights Reserved.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
.\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with
.\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH PRSTAT 1M "Nov 14, 2014"
+.TH PRSTAT 1M "Oct 13, 2017"
.SH NAME
prstat \- report active process statistics
.SH SYNOPSIS
@@ -13,7 +14,7 @@ prstat \- report active process statistics
\fBprstat\fR [\fB-acHJLmRrtTvWZ\fR] [\fB-d\fR u | d] [\fB-C\fR \fIpsrsetlist\fR] [\fB-h\fR \fIlgrplist\fR]
[\fB-j\fR \fIprojlist\fR] [\fB-k\fR \fItasklist\fR] [\fB-n\fR \fIntop\fR[,\fInbottom\fR]]
[\fB-p\fR \fIpidlist\fR] [\fB-P\fR \fIcpulist\fR] [\fB-s\fR \fIkey\fR | \fB-S\fR \fIkey\fR ]
- [\fB-u\fR \fIeuidlist\fR] [\fB-U\fR \fIuidlist\fR] [\fB-z\fR \fIzoneidlist\fR]
+ [\fB-u\fR \fIeuidlist\fR] [\fB-U\fR \fIuidlist\fR] [\fB-z\fR \fIzoneidlist\fR] [\fB-Z\fR]
[\fIinterval\fR [\fIcount\fR]]
.fi
@@ -447,9 +448,11 @@ devices, in kilobytes (\fBK\fR), megabytes (\fBM\fR), or gigabytes (\fBG\fR).
.RS 4n
The resident set size of the process (\fBRSS\fR), in kilobytes (\fBK\fR),
megabytes (\fBM\fR), or gigabytes (\fBG\fR). The RSS value is an estimate
-provided by \fBproc\fR(4) that might underestimate the actual resident set
-size. Users who want to get more accurate usage information for capacity
-planning should use the \fB-x\fR option to \fBpmap\fR(1) instead.
+provided by \fBproc\fR(4) that might underestimate the actual
+per-process resident set size, but is generally accurate for the aggregated
+resident set size. Users who want to get more accurate usage information for
+capacity planning should use the \fB-x\fR option to \fBpmap\fR(1) for
+per-process results instead.
.RE
.sp
diff --git a/usr/src/man/man1m/reboot.1m b/usr/src/man/man1m/reboot.1m
index 87f4bd892b..a4bdebd496 100644
--- a/usr/src/man/man1m/reboot.1m
+++ b/usr/src/man/man1m/reboot.1m
@@ -142,8 +142,7 @@ This option is currently available only on x86 systems. The \fB-p\fR and
.ad
.sp .6
.RS 4n
-Quick. Reboot quickly and ungracefully, without shutting down running processes
-first.
+Quick. Reboot quickly without halting running zones first.
.RE
.SH OPERANDS
diff --git a/usr/src/man/man1m/snoop.1m b/usr/src/man/man1m/snoop.1m
index c599a52271..f85f71089e 100644
--- a/usr/src/man/man1m/snoop.1m
+++ b/usr/src/man/man1m/snoop.1m
@@ -1,5 +1,6 @@
'\" te
.\" Copyright (C) 2009, Sun Microsystems, Inc. All Rights Reserved
+.\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
@@ -12,7 +13,7 @@ snoop \- capture and inspect network packets
\fBsnoop\fR [\fB-aqrCDINPSvV\fR] [\fB-t\fR [r | a | d]] [\fB-c\fR \fImaxcount\fR]
[\fB-d\fR \fIdevice\fR] [\fB-i\fR \fIfilename\fR] [\fB-n\fR \fIfilename\fR] [\fB-o\fR \fIfilename\fR]
[\fB-p\fR \fIfirst\fR [, \fIlast\fR]] [\fB-s\fR \fIsnaplen\fR] [\fB-x\fR \fIoffset\fR [, \fIlength\fR]]
- [\fIexpression\fR]
+ [\fB-z\fR \fIzonename\fR] [\fIexpression\fR]
.fi
.SH DESCRIPTION
@@ -296,6 +297,22 @@ the whole packet, use an \fIoffset\fR of 0. If a \fIlength\fR value is not
provided, the rest of the packet is displayed.
.RE
+.sp
+.ne 2
+.na
+.BI -z zonename
+.ad
+.sp .6
+.RS 4n
+Open an earlier datalink specified via
+.B -d
+or
+.B -I
+in the specified zone \fIzonename\fR.
+This option is only meaningful in the global zone and
+allows the global zone to inspect datalinks of non-global zones.
+.RE
+
.SH OPERANDS
.ne 2
.na
diff --git a/usr/src/man/man1m/svc.startd.1m b/usr/src/man/man1m/svc.startd.1m
index 7c80c35e23..103c6b5fec 100644
--- a/usr/src/man/man1m/svc.startd.1m
+++ b/usr/src/man/man1m/svc.startd.1m
@@ -4,7 +4,7 @@
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH SVC.STARTD 1M "Mar 18, 2011"
+.TH SVC.STARTD 1M "Aug 23, 2012"
.SH NAME
svc.startd \- Service Management Facility master restarter
.SH SYNOPSIS
@@ -372,10 +372,13 @@ properties listed below in the \fBstartd\fR property group.
.RS 4n
The \fBcritical_failure_count\fR and \fBcritical_failure_period\fR properties
together specify the maximum number of service failures allowed in a given
-time interval before \fBsvc.startd\fR transitions the service to maintenance.
+number of seconds before \fBsvc.startd\fR transitions the service to
+maintenance.
If the number of failures exceeds \fBcritical_failure_count\fR in any period of
\fBcritical_failure_period\fR seconds, \fBsvc.startd\fR will transition the
-service to maintenance.
+service to maintenance. The \fBcritical_failure_count\fR value is limited
+to the range 1-10 and defaults to 10. The \fBcritical_failure_period\fR
+defaults to 600 seconds.
.RE
.sp
diff --git a/usr/src/man/man1m/tunefs.1m b/usr/src/man/man1m/tunefs.1m
index 7f522f43fa..0b849f2dd7 100644
--- a/usr/src/man/man1m/tunefs.1m
+++ b/usr/src/man/man1m/tunefs.1m
@@ -3,7 +3,7 @@
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH TUNEFS 1M "Dec 5, 2003"
+.TH TUNEFS 1M "Sep 19, 2013"
.SH NAME
tunefs \- tune an existing UFS file system
.SH SYNOPSIS
@@ -120,3 +120,9 @@ encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).
.sp
.LP
\fBmkfs_ufs\fR(1M), \fBnewfs\fR(1M), \fBattributes\fR(5), \fBlargefile\fR(5)
+
+.\" Take this out and a Unix Demon will dog your steps from now until
+.\" the time_t's wrap around.
+.SH BUGS
+.sp
+You can tune a file system, but you can't tune a fish.
diff --git a/usr/src/man/man1m/vfsstat.1m b/usr/src/man/man1m/vfsstat.1m
new file mode 100644
index 0000000000..aef8431a09
--- /dev/null
+++ b/usr/src/man/man1m/vfsstat.1m
@@ -0,0 +1,213 @@
+'\" te
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\" Copyright 2014 Joyent, Inc. All rights reserved.
+.\"
+.TH "VFSSTAT" "1m" "May 1, 2014" "" ""
+.
+.SH "NAME"
+\fBvfsstat\fR \-\- Report VFS read and write activity
+.
+.SH "SYNOPSIS"
+.
+.nf
+vfsstat [\-hIMrzZ] [interval [count]]
+.
+.fi
+.
+.SH "DESCRIPTION"
+The vfsstat utility reports a summary of VFS read and write
+activity per zone\. It first prints all activity since boot, then
+reports activity over a specified interval\.
+.
+.P
+When run from a non\-global zone (NGZ), only activity from that NGZ
+can be observed\. When run from a the global zone (GZ), activity
+from the GZ and all other NGZs can be observed\.
+.
+.P
+This tool is convenient for examining I/O performance as
+experienced by a particular zone or application\. Other tools
+which examine solely disk I/O do not report reads and writes which
+may use the filesystem\'s cache\. Since all read and write system
+calls pass through the VFS layer, even those which are satisfied
+by the filesystem cache, this tool is a useful starting point when
+looking at a potential I/O performance problem\. The vfsstat
+command reports the most accurate reading of I/O performance as
+experienced by an application or zone\.
+.
+.P
+One additional feature is that ZFS zvol performance is also reported
+by this tool, even though zvol I/O does not go through the VFS
+layer\. This is done so that this single tool can be used to monitor
+I/O performance and because its not unreasonable to think of zvols
+as being included along with other ZFS filesystems\.
+.
+.P
+The calculations and output fields emulate those from iostat(1m)
+as closely as possible\. When only one zone is actively performing
+disk I/O, the results from iostat(1m) in the global zone and
+vfsstat in the local zone should be almost identical\. Note that
+many VFS read operations may be handled by the filesystem cache,
+so vfsstat and iostat(1m) will be similar only when most
+operations require a disk access\.
+.
+.P
+As with iostat(1m), a result of 100% for VFS read and write
+utilization does not mean that the VFS layer is fully saturated\.
+Instead, that measurement just shows that at least one operation
+was pending over the last interval of time examined\. Since the
+VFS layer can process more than one operation concurrently, this
+measurement will frequently be 100% but the VFS layer can still
+accept additional requests\.
+.
+.SH "OUTPUT"
+The vfsstat utility reports the following information:
+.
+.IP "" 4
+.
+.nf
+r/s
+.RS
+reads per second
+.RE
+
+w/s
+.RS
+writes per second
+.RE
+
+kr/s
+.RS
+kilobytes read per second
+.RE
+
+kw/s
+.RS
+kilobytes written per second
+.RE
+
+ractv
+.RS
+average number of read operations actively being serviced by the VFS layer
+.RE
+
+wactv
+.RS
+average number of write operations actively being serviced by the VFS layer
+.RE
+
+read_t
+.RS
+average VFS read latency, in microseconds
+.RE
+
+writ_t
+.RS
+average VFS write latency, in microseconds
+.RE
+
+%r
+.RS
+percent of time there is a VFS read operation pending
+.RE
+
+%w
+.RS
+percent of time there is a VFS write operation pending
+.RE
+
+d/s
+.RS
+VFS operations per second delayed by the ZFS I/O throttle
+.RE
+
+del_t
+.RS
+average ZFS I/O throttle delay, in microseconds
+.RE
+.
+.fi
+.
+.IP "" 0
+.
+.SH "OPTIONS"
+The following options are supported:
+.
+.P
+\-h
+.RS
+Show help message and exit
+.RE
+.
+.P
+\-I
+.RS
+Print results per interval, rather than per second (where applicable)
+.RE
+.
+.P
+\-M
+.RS
+Print results in MB/s instead of KB/s
+.RE
+.
+.P
+\-r
+.RS
+Show results in a comma\-separated format
+.RE
+.
+.P
+\-z
+.RS
+Hide zones with no VFS activity
+.RE
+.
+.P
+\-Z
+.RS
+Print results for all zones, not just the current zone
+.RE
+.
+.SH "OPERANDS"
+interval
+.
+.P
+Specifies the length in seconds to pause between each interval
+report\. If not specified, vfsstat will print a summary since boot
+and exit\.
+.
+.P
+count
+.
+.P
+Specifies the number of intervals to report\. Defaults to
+unlimited if not specified\.
+.
+.SH "SEE ALSO"
+.
+.nf
+iostat(1m), ziostat(1m), mpstat(1m)
+.
+.fi
+.
+.SH "NOTES"
+This command does not examine readdir or any other VFS operations,
+only read and write operations\.
+.
+.P
+This command does not look at network I/O, only I/O operations to
+or from a file\.
+.
+.P
+The output format from vfsstat may change over time; use the
+comma\-separated output for a stable output format\.
diff --git a/usr/src/man/man1m/vndadm.1m b/usr/src/man/man1m/vndadm.1m
new file mode 100644
index 0000000000..253518a88a
--- /dev/null
+++ b/usr/src/man/man1m/vndadm.1m
@@ -0,0 +1,651 @@
+'\" te
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
+.\"
+.TH VNDADM 1M "Mar 06, 2014"
+.SH NAME
+vndadm \- administer vnd devices
+
+.SH SYNOPSIS
+
+.nf
+vndadm create [-z zonename] [-l datalink] device
+vndadm destroy [-z zonename] device...
+vndadm list [-p] [-d delim] [-o field,...] [-z zonename] [device]...
+vndadm get [-p] [-d delim] [-z zonename] device [prop]...
+vndadm set [-z zonename] device prop=val...
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The vndadm command is used to administer vnd devices. A vnd device is
+similar to an IP network interface, except that the vnd device operates
+at layer two. A vnd device is created over a data link (see dladm(1M))
+and its address is that of the underlying data link. For ethernet based
+devices, that address would be the MAC address of the data link. vnd
+devices are character devices which may be used to send and receive
+layer two packets. When reading or writing to a vnd device, the full
+frame must be present. This is useful for working with virtual machines,
+or other environments where you need to manipulate the entire layer two
+frame.
+
+.sp
+.LP
+Every command takes a device as an argument. To specify a vnd device,
+you just use the name of the device. Devices are scoped to zones. If no
+zone is specified, the current zone is assumed. A device name can be any
+series of alphanumeric ascii characters which typically match the name
+of the underlying data link. A given vnd device name must be unique in a
+given zone, but the same name can be used across zones.
+.sp
+.SH OPTIONS
+.sp
+.LP
+All vndadm subcommands have the following common option:
+.sp
+.ne 2
+.na
+-z zonename
+.ad
+.sp .6
+.RS 4n
+Operate in the context of the specified zone. When creating a vnd
+device, the named device is created in the specified zone. All other
+operations scope the device lookup to the specified zone. If the user is
+not in the global zone, the use of -z will not work.
+
+.sp
+.LP
+When -z is used and multiple devices are specified, then
+the use of -z applies to all of the devices.
+.RE
+
+.SH SUBCOMMANDS
+.sp
+.ne 2
+.na
+vndadm create [-z zonename] [-l datalink] device
+.ad
+.sp
+.RS 4n
+Creates a vnd device with the specified name device. If -l datalink is
+not specified, it is assumed that the data link and the device share the
+same name. The created device will exist for as long as the zone exists
+or until a call to vndadm destroy. vnd devices do not persist across
+system reboots. Note, if an IP interface or another libdlpi(3LIB)
+consumer is already using the data link, then vnd will fail.
+
+.sp
+The maximum length of the name of device is 31 characters. The allowed
+set of characters is alphanumberic characters, ':', \'-', and \'_'. The
+names 'zone' and 'ctl' are reserved and may not be used.
+
+.sp
+.ne 2
+.na
+-l datalink
+.ad
+.sp .6
+.RS 4n
+Specifies the name of the data link to create the device over. This
+allows the vnd device name to be different from the data link's name.
+.RE
+.sp
+.ne 2
+.na
+-z zonename
+.ad
+.sp .6
+.RS 4n
+See OPTIONS above.
+.RE
+
+.RE
+
+.sp
+.ne 2
+.na
+vndadm destroy [-z zonename] device...
+.ad
+.sp
+.RS 4n
+Destroys the specified device. The destruction is analogous to
+unlink(2). If the device is still open and used by applications, the
+device will continue to exist, but it will no longer be accessible by
+the name device.
+.sp
+.ne 2
+.na
+-z zonename
+.ad
+.sp .6
+.RS 4n
+See OPTIONS above.
+.RE
+.RE
+
+.sp
+.ne 2
+.na
+vndadm list [-p] [-d delim] [-o field,...] [-z zonename] [device]...
+.ad
+.sp
+.RS 4n
+Lists active vnd devices. By default, vnadm list lists all devices in
+every zone that the caller is allowed to see; the current zone if in the
+non-global zone, and all zones in the global zone. If device is
+specified one or more times, then output will be limited to the
+specified devices.
+.sp
+.ne 2
+.na
+-o field[,...]
+.ad
+.sp .6
+.RS 4n
+A case-insensitive, comma-separated list of output fields. When -o is
+not used, all of the fields listed below are shown. The field name must
+be one of the following fields:
+
+.sp
+.ne 2
+.na
+NAME
+.ad
+.sp .6
+.RS 4n
+The name of the vnd device.
+.RE
+
+.sp
+.ne 2
+.na
+DATALINK
+.ad
+.sp .6
+.RS 4n
+The name of the data link the vnd device was created over.
+.RE
+
+.sp
+.ne 2
+.na
+ZONENAME
+.ad
+.sp .6
+.RS 4n
+The name of the zone that the vnd device exists in.
+.RE
+.RE
+
+.sp
+.ne 2
+.na
+-p
+.ad
+.sp .6
+.RS 4n
+Display the output in a stable machine parseable format. The -o option
+is required with the -p option. See "Parseable Output Format" below.
+.RE
+
+.sp
+.ne 2
+.na
+-d delim
+.ad
+.sp .6
+.RS 4n
+Change the delimiter used in conjunction with generating parseable
+output. This option may only be specified when -p is also specified.
+.RE
+
+.sp
+.ne 2
+.na
+-z zonename
+.ad
+.sp .6
+.RS 4n
+See OPTIONS above.
+.RE
+
+.RE
+
+
+.sp
+.ne 2
+.na
+vndadm get [-p] [-d delim] [-z zonename] device [prop]...
+.ad
+.sp
+.RS 4n
+Displays the properties for the specified device. By default, all
+properties of a given device are displayed. If prop is specified one or
+more times, then only the specified properties will be displayed for
+device. For a list of properties, see the section "Properties" below.
+The property output consists of the following four columns:
+.sp
+.ne 2
+.na
+LINK
+.ad
+.sp .6
+.RS 4n
+The name of the device
+.RE
+
+.sp
+.ne 2
+.na
+PROPERTY
+.ad
+.sp .6
+.RS 4n
+The name of the property. Note that some properties that are private to
+the implementation may be displayed. Those properties begin with a
+leading underscore.
+.RE
+
+.sp
+.ne 2
+.na
+PERM
+.ad
+.sp .6
+.RS 4n
+Describes whether the property is read-only or
+if it is read-write. This field does not
+indicate if the current user has permission, but
+lists permissions for a privileged user.
+.RE
+
+.sp
+.ne 2
+.na
+VALUE
+.ad
+.sp .6
+.RS 4n
+The value of the property.
+.RE
+
+.sp
+.ne 2
+.na
+-p
+.ad
+.sp .6
+.RS 4n
+Display the output in a stable machine parseable format. See "Parseable
+Output Format" below.
+.RE
+
+.sp
+.ne 2
+.na
+-d delim
+.ad
+.sp .6
+.RS 4n
+Change the delimiter used in conjunction with generating parseable
+output. This option may only be specified when -p is also specified.
+.RE
+
+.sp
+.ne 2
+.na
+-z zonename
+.ad
+.sp .6
+.RS 4n
+See OPTIONS above.
+.RE
+.RE
+
+.sp
+.ne 2
+.na
+vndadm set [-z zonename] device prop=val...
+.ad
+.sp
+.RS 4n
+Sets properties on the named device. Setting a property takes effect for
+all operations on the device, after the program returns. Multiple
+properties can be set at once; however, properties are applied one at a
+time to the device. Property names and values must be separated with an
+equals sign. Additional property and value pairs should be separated by
+white space. For a list of properties, see the section "Properties"
+below.
+
+.sp
+.ne 2
+.na
+-z zonename
+.ad
+.sp .6
+.RS 4n
+See OPTIONS above.
+.RE
+.RE
+
+.SS Parseable Output Format
+.sp
+.LP
+The default output for parseable data is to be separated with a single
+ascii space character. The delimiter may be changed with the -d
+option. When parseable output is requested, no numbers that represent
+sizes will be displayed in human readable form, they will be fully
+expanded. eg. the number 42K will instead be 43008.
+
+.SS Properties
+.sp
+.LP
+The following are supported and stable properties. Note that any
+properties that starts with a leading underscore are not a stable
+property and may be removed at any time.
+
+.sp
+.ne 2
+.na
+rxbuf
+.ad
+.sp .6
+.RS 4n
+A read/write property that controls the size of the receive buffer for
+the device. All received data enters the receive buffer until a consumer
+consumes it. If adding a received frame would exceed the size of the
+receive buffer, then that frame will be dropped. The maximum size of the
+buffer is limited by the 'maxsize' property. The minimum size of the
+buffer is the value of the 'maxtu' property. The property's value may be
+anything between that maximum and minimum. When setting this property,
+standard size suffixes such as 'K' and 'M' may be used.
+.RE
+
+.sp
+.ne 2
+.na
+txbuf
+.ad
+.sp .6
+.RS 4n
+A read/write property that controls the size of the transmit buffer. All
+in-flight transmitted data must be able to fit into the transmit buffer
+to account for potential flow control events. If there is not enough
+space in the transmit buffer, transmit related I/O operations will
+either block or fail based on whether the file has been put into
+non-blocking mode by setting O_NONBLOCK or O_NDELAY with fcntl(2). The
+maximum size of the buffer is limited by the 'maxsize' property. The
+minimum size of the buffer is the value of the 'maxtu' property. The
+property's value may be anything between that maximum and minimum. When
+setting this property, standard size suffixes such as 'K' and 'M' may be
+used.
+
+.RE
+
+.sp
+.ne 2
+.na
+maxsize
+.ad
+.sp .6
+.RS 4n
+A read-only property that describes the maximum size of buffers in the
+system. Properties such as rxbuf and txbuf cannot be set beyond this.
+.RE
+
+.sp
+.ne 2
+.na
+mintu
+.ad
+.sp .6
+.RS 4n
+A read-only property that describes the minimum size of a frame
+transmitted to the underlying data link. Note that the minimum listed
+here may be less than the size of a valid layer two frame and therefore
+may be dropped. A frame smaller than this value will be rejected by vnd.
+.RE
+
+.sp
+.ne 2
+.na
+maxtu
+.ad
+.sp .6
+.RS 4n
+A read-only property that describes the maximum size of a frame
+transmitted to the underlying data link. A frame larger than this value
+will be rejected by vnd.
+.RE
+
+.SH EXAMPLES
+.LP
+Example 1 Creating a vnd device
+.sp
+.LP
+To create a vnd device over the VNIC named net0, enter the following
+command:
+
+.sp
+.in +2
+.nf
+# vndadm create net0
+.fi
+.in -2
+.sp
+
+.LP
+Example 2 Creating a vnd device in another zone
+.sp
+.LP
+
+To create a vnd device over the VNIC named net1 in the zone
+1b7155a4-aef9-e7f0-d33c-9705e4b8b525, enter the following command:
+
+.sp
+.in +2
+.nf
+# vndadm create -z 1b7155a4-aef9-e7f0-d33c-9705e4b8b525 net1
+.fi
+.in -2
+.sp
+
+.LP
+Example 3 Destroying a vnd device
+.sp
+.LP
+
+To destroy the vnd device named net0, enter the following command:
+
+.sp
+.in +2
+.nf
+# vndadm destroy net0
+.fi
+.in -2
+.sp
+
+.LP
+Example 4 Destroying a vnd device in another zone
+.sp
+.LP
+
+To destroy the vnd device named net1 in the zone
+1b7155a4-aef9-e7f0-d33c-9705e4b8b525, enter the following command:
+
+.sp
+.in +2
+.nf
+# vndadm destroy -z 1b7155a4-aef9-e7f0-d33c-9705e4b8b525 net1
+.fi
+.in -2
+.sp
+
+.LP
+Example 5 List all vnd devices
+.sp
+.LP
+
+To list all devices, run the following command:
+
+.sp
+.in +2
+.nf
+# vndadm list
+NAME DATALINK ZONENAME
+net0 net0 global
+net0 net0 1b7155a4-aef9-e7f0-d33c-9705e4b8b525
+.fi
+.in -2
+.sp
+
+.LP
+Example 6 Listing devices in a specific zone
+.sp
+.LP
+
+To list devices in a specific zone, run the following command:
+
+.sp
+.in +2
+.nf
+# vndadm list -z 1b7155a4-aef9-e7f0-d33c-9705e4b8b525
+
+NAME DATALINK ZONENAME
+net0 net0 1b7155a4-aef9-e7f0-d33c-9705e4b8b525
+.fi
+.in -2
+.sp
+
+.LP
+Example 7 List all devices in a parseable format
+.sp
+.LP
+
+To list all devices in a parseable format with the delimiter of ':', run
+the following command:
+
+.sp
+.in +2
+.nf
+# vndadm list -p -d: -o name,datalink,zone
+net0:net0:global
+net0:net0:1b7155a4-aef9-e7f0-d33c-9705e4b8b525
+.fi
+.in -2
+.sp
+
+.LP
+Example 8 Retrieving all properties for a device
+.sp
+.LP
+
+To retrieve all of the properties for the vnd device foo0, run the
+following command:
+
+.sp
+.in +2
+.nf
+# vndadm get foo0
+LINK PROPERTY PERM VALUE
+foo0 rxbuf rw 65536
+foo0 txbuf rw 65536
+foo0 maxsize r- 4194304
+foo0 mintu r- 0
+foo0 maxtu r- 1518
+foo0 _nflush rw 10
+foo0 _burstsz rw 10
+.fi
+.in -2
+.sp
+
+.LP
+Example 9 Retrieving specific properties for a device
+.sp
+.LP
+
+To retrieve just the rxbuf and txbuf properties for the vnd device foo0,
+run the following command:
+
+.sp
+.in +2
+.nf
+# vndadm get foo0 rxbuf txbuf
+LINK PROPERTY PERM VALUE
+foo0 rxbuf rw 65536
+foo0 txbuf rw 65536
+.fi
+.in -2
+.sp
+
+.LP
+Example 10 Retrieving properties for a device in a parseable format
+.sp
+.LP
+
+To retrieve all properties for the vnd device foo0 in a parseable
+format, run the following command:
+
+.sp
+.in +2
+.nf
+# vndadm get -p foo0
+foo0 rxbuf rw 65536
+foo0 txbuf rw 65536
+foo0 maxsize r- 4194304
+foo0 mintu r- 0
+foo0 maxtu r- 1518
+foo0 _nflush rw 10
+foo0 _burstsz rw 10
+.fi
+.in -2
+.sp
+
+.LP
+Example 11 Setting a property on a device
+.sp
+.LP
+
+To set the receive buffer size to one megabyte on the device foo0, run
+the following command:
+
+.sp
+.in +2
+.nf
+# vndadm set foo0 rxbuf=1M
+.fi
+.in -2
+.sp
+
+.LP
+Example 12 Setting multiple properties on a device
+.sp
+.LP
+
+To set the transmit buffer to 300 Kb and the receive buffer to 1 Mb, run
+the following command:
+
+.sp
+.in +2
+.nf
+# vndadm set foo0 rxbuf=300K txbuf=1M
+.fi
+.in -2
+.sp
+
+.SH SEE ALSO
+
+dladm(1M), ipadm(1M), fcntl(2), fcntl.h(3HEAD), libvnd(3LIB),
+vndstat(1M), vnd(7D)
diff --git a/usr/src/man/man1m/vndstat.1m b/usr/src/man/man1m/vndstat.1m
new file mode 100644
index 0000000000..a7f843e228
--- /dev/null
+++ b/usr/src/man/man1m/vndstat.1m
@@ -0,0 +1,163 @@
+'\" te
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
+.\"
+.TH VNDSTAT 1M "Mar 06, 2014"
+.SH NAME
+vndstat \- report vnd activity
+
+.SH SYNOPSIS
+
+vndstat [interval [count]]
+
+.SH DESCRIPTION
+.sp
+.LP
+The vndstat command reports a summary of per-device vnd
+activity. Once per interval it prints a table of statistics per
+device. In the global zone, vndstat reports on all devices in the
+system. From the non-global zone, it only reports on devices that are
+present in that zone. vndstat reports on all vnd devices
+that exist, including anonymous devices which are not linked into the
+file system.
+.sp
+.LP
+The vndstat command's output includes the following information:
+.sp
+.ne 2
+.na
+.B name
+.ad
+.RS 14n
+The name of the device, if bound. If a given vnd device is not
+bound into the file system, hence considered anonymous, then there will
+be no name for the device.
+.RE
+
+.sp
+.ne 2
+.na
+.B rx B/s
+.ad
+.RS 14n
+The number of bytes received by the device during interval.
+.RE
+
+.sp
+.ne 2
+.na
+.B tx B/s
+.ad
+.RS 14n
+The number of bytes transmitted by the device during interval.
+.RE
+
+.sp
+.ne 2
+.na
+.B drops
+.ad
+.RS 14n
+The number of packets and messages which have been dropped. This
+includes all drops due to insufficient buffer space, IP hooks, and
+unknown or malformed DLPI messages.
+.RE
+
+.sp
+.ne 2
+.na
+.B txfc
+.ad
+.RS 14n
+The number of flow control events that have occurred. A flow control
+event occurs when the layers below vnd request that all transmits
+be paused until a future call resumes the flow. This statistic is
+incremented when the flow is resumed. It is not incremented when it is
+first paused.
+.RE
+
+.sp
+.ne 2
+.na
+.B zone
+.ad
+.RS 14n
+The name of the zone the device is located in.
+.RE
+
+.SH OPTIONS
+
+.sp
+.ne 2
+.na
+interval
+.ad
+.RS 13n
+Report once each interval seconds. interval may not be
+fractional.
+.RE
+
+.sp
+.ne 2
+.na
+count
+.ad
+.RS 13n
+Only print count reports, then exit.
+.RE
+.sp
+.LP
+When no arguments are given to vndstat, it will always print at an
+interval of one second. Reports will continue until vndstat
+is terminated.
+
+.SH EXAMPLES
+.LP
+Example 1 Print five seconds of data
+
+.sp
+.in +2
+.nf
+example% vndstat 1 5
+ name | rx B/s | tx B/s | drops txfc | zone
+ net0 | 1.45MB/s | 14.1KB/s | 0 0 | 1b7155a4-aef9-e7f0-d33c-9705e4b8b525
+ net0 | 3.50MB/s | 19.5KB/s | 0 0 | 1b7155a4-aef9-e7f0-d33c-9705e4b8b525
+ net0 | 2.83MB/s | 30.8KB/s | 0 0 | 1b7155a4-aef9-e7f0-d33c-9705e4b8b525
+ net0 | 3.08MB/s | 30.6KB/s | 0 0 | 1b7155a4-aef9-e7f0-d33c-9705e4b8b525
+ net0 | 3.21MB/s | 30.6KB/s | 0 0 | 1b7155a4-aef9-e7f0-d33c-9705e4b8b525
+.fi
+.in -2
+.sp
+
+.SH ATTRIBUTES
+.sp
+.LP
+See attributes(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+box;
+c | c
+l | l .
+ATTRIBUTE TYPE ATTRIBUTE VALUE
+_
+Interface Stability See below.
+.TE
+
+.sp
+.LP
+Invocation is evolving. Human readable output is unstable.
+.SH SEE ALSO
+
+dlstat(1M), nicstat(1M), vndadm(1M), vnd(7M)
diff --git a/usr/src/man/man1m/zfs.1m b/usr/src/man/man1m/zfs.1m
index 6f138940b2..24365e7904 100644
--- a/usr/src/man/man1m/zfs.1m
+++ b/usr/src/man/man1m/zfs.1m
@@ -23,7 +23,7 @@
.\" Copyright 2011 Joshua M. Clulow <josh@sysmgr.org>
.\" Copyright (c) 2011, 2016 by Delphix. All rights reserved.
.\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
-.\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
+.\" Copyright (c) 2015, Joyent, Inc. All rights reserved.
.\" Copyright (c) 2014 by Adam Stevko. All rights reserved.
.\" Copyright (c) 2014 Integros [integros.com]
.\" Copyright 2017 Nexenta Systems, Inc.
diff --git a/usr/src/man/man1m/zoneadm.1m b/usr/src/man/man1m/zoneadm.1m
index 145e6cc893..2dc87a6178 100644
--- a/usr/src/man/man1m/zoneadm.1m
+++ b/usr/src/man/man1m/zoneadm.1m
@@ -1,6 +1,7 @@
'\" te
.\" Copyright 2015 Nexenta Systems, Inc. All rights reserved.
.\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright (c) 2011 Joyent, Inc. All Rights Reserved.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
@@ -128,12 +129,14 @@ Use the following command to attach a zone:
.sp
.ne 2
.na
-\fB\fBboot\fR [\fB--\fR \fIboot_options\fR]\fR
+\fB\fBboot\fR [\fB-X\fR] [\fB--\fR \fIboot_options\fR]\fR
.ad
.sp .6
.RS 4n
Boot (or activate) the specified zones.
.sp
+The \fI-X\fR option enables debug for the zone's brand while booting.
+.sp
The following \fIboot_options\fR are supported:
.sp
.ne 2
@@ -248,12 +251,25 @@ The source zone must be halted before this subcommand can be used.
.sp
.ne 2
.na
-\fB\fBhalt\fR\fR
+\fB\fBhalt [\fB-X\fR]\fR\fR
.ad
.sp .6
.RS 4n
Halt the specified zones. \fBhalt\fR bypasses running the shutdown scripts
inside the zone. It also removes run time resources of the zone.
+.sp
+The \fI-X\fR option enables debug for the zone's brand while halting.
+.sp
+Use:
+.sp
+.in +2
+.nf
+zlogin \fIzone\fR shutdown
+.fi
+.in -2
+.sp
+
+to cleanly shutdown the zone by running the shutdown scripts.
.RE
.sp
@@ -403,24 +419,28 @@ and normal restrictions for \fIzonepath\fR apply.
.sp
.ne 2
.na
-\fB\fBready\fR\fR
+\fB\fBready [\fB-X\fR]\fR\fR
.ad
.sp .6
.RS 4n
Prepares a zone for running applications but does not start any user processes
in the zone.
+.sp
+The \fI-X\fR option enables debug for the zone's brand while readying.
.RE
.sp
.ne 2
.na
-\fB\fBreboot\fR\ [\fB--\fR \fIboot_options\fR]]\fR
+\fB\fBreboot\fR\ [\fB-X\fR] [\fB--\fR \fIboot_options\fR]]\fR
.ad
.sp .6
.RS 4n
Restart the zones. This is equivalent to a \fBhalt\fR \fBboot\fR sequence. This
subcommand fails if the specified zones are not active. See \fIboot\fR subcommand
for the boot options.
+.sp
+The \fI-X\fR option enables debug for the zone's brand while rebooting.
.RE
.sp
diff --git a/usr/src/man/man1m/zonecfg.1m b/usr/src/man/man1m/zonecfg.1m
index 32285e1fc3..bb1b72ac37 100644
--- a/usr/src/man/man1m/zonecfg.1m
+++ b/usr/src/man/man1m/zonecfg.1m
@@ -1,6 +1,6 @@
'\" te
.\" Copyright (c) 2004, 2009 Sun Microsystems, Inc. All Rights Reserved.
-.\" Copyright 2013 Joyent, Inc. All Rights Reserved.
+.\" Copyright 2015 Joyent, Inc.
.\" Copyright 2017 Peter Tribble
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
.\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the
@@ -11,17 +11,17 @@ zonecfg \- set up zone configuration
.SH SYNOPSIS
.LP
.nf
-\fBzonecfg\fR \fB-z\fR \fIzonename\fR
+\fBzonecfg\fR {\fB-z\fR \fIzonename\fR | \fB-u\fR \fIuuid\fR}
.fi
.LP
.nf
-\fBzonecfg\fR \fB-z\fR \fIzonename\fR \fIsubcommand\fR
+\fBzonecfg\fR {\fB-z\fR \fIzonename\fR | \fB-u\fR \fIuuid\fR} \fIsubcommand\fR
.fi
.LP
.nf
-\fBzonecfg\fR \fB-z\fR \fIzonename\fR \fB-f\fR \fIcommand_file\fR
+\fBzonecfg\fR {\fB-z\fR \fIzonename\fR | \fB-u\fR \fIuuid\fR} \fB-f\fR \fIcommand_file\fR
.fi
.LP
@@ -43,7 +43,8 @@ The following synopsis of the \fBzonecfg\fR command is for interactive usage:
.sp
.in +2
.nf
-zonecfg \fB-z\fR \fIzonename subcommand\fR
+{\fB-z\fR \fIzonename\fR | \fB-u\fR \fIuuid\fR}
+zonecfg {\fB-z\fR \fIzonename | \fB-u\fR \fIuuid} subcommand\fR
.fi
.in -2
.sp
@@ -355,6 +356,16 @@ The following properties are supported:
.sp
.ne 2
.na
+\fB(global)\fR
+.ad
+.sp .6
+.RS 4n
+\fBzfs-io-priority\fR
+.RE
+
+.sp
+.ne 2
+.na
\fB\fBfs\fR\fR
.ad
.sp .6
@@ -369,7 +380,7 @@ The following properties are supported:
.ad
.sp .6
.RS 4n
-\fBaddress\fR, \fBallowed-address\fR, \fBphysical\fR, \fBdefrouter\fR
+\fBaddress\fR, \fBallowed-address\fR, \fBdefrouter\fR, \fBglobal-nic\fR, \fBmac-addr\fR, \fBphysical\fR, \fBproperty\fR, \fBvlan-id\fR
.RE
.sp
@@ -652,7 +663,17 @@ Values needed to determine how, where, and so forth to mount file systems. See
.sp
.ne 2
.na
-\fB\fBnet\fR: address, allowed-address, physical, defrouter\fR
+\fB\fBinherit-pkg-dir\fR: dir\fR
+.ad
+.sp .6
+.RS 4n
+The directory path.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fBnet\fR: address, allowed-address, defrouter, global-nic, mac-addr, physical, property, vlan-id\fR
.ad
.sp .6
.RS 4n
@@ -691,6 +712,10 @@ zone. However, if the interface is not used by the global zone, it should be
configured \fBdown\fR in the global zone, and the default router for the
interface should be specified here.
.sp
+The global-nic is used for exclusive stack zones which will use a VNIC on-demand. When the zone boots, a VNIC named using the physical property will be created on the global NIC. If provided, the mac-addr and vlan-id will be set on this VNIC.
+.sp
+The \fBproperty\fR setting is a resource which can be used to set arbitrary name/value pairs on the network. These name/value pairs are made available to the zone's brand, which can use them as needed to set up the network interface.
+.sp
For an exclusive-IP zone, the physical property must be set and the address and
default router properties cannot be set.
.sp
@@ -828,7 +853,7 @@ property is not specified, the scheduling class is established as follows:
.ie t \(bu
.el o
If the \fBcpu-shares\fR property or equivalent rctl is set, the scheduling
-class FSS is used.
+class \fBFSS\fR is used.
.RE
.RS +4
.TP
@@ -844,10 +869,15 @@ used.
.el o
Under any other conditions, the system default scheduling class is used.
.RE
+.sp
+If the \fBFX\fR scheduling class is specified, then the optional
+\fBfixed-hi-pri\fR attribute can be set to \fBtrue\fR. This causes all of the
+processes in the zone to run at the highest \fBFX\fR priority. By default
+processes under \fBFX\fR run at the lowest priority. See \fBpriocntl\fR(2)
+for details on each scheduling class.
.RE
-
.sp
.ne 2
.na
@@ -957,6 +987,16 @@ is not supported.
.RE
.sp
+.ne 2
+.na
+\fBglobal: \fBzfs-io-priority\fR\fR
+.ad
+.sp .6
+.RS 4n
+Specifies a priority for this zone's ZFS I/O. The priority is used by the ZFS I/O scheduler as in input to determine how to schedule I/O across zones. By default all zones have a priority of 1. The value can be increased for zones whose I/O is more critical. This property is the preferred way to set the \fBzone.zfs-io-priority\fR rctl.
+.RE
+
+.sp
.LP
The following table summarizes resources, property-names, and types:
.sp
@@ -979,13 +1019,22 @@ resource property-name type
(global) max-shm-ids simple
(global) max-shm-memory simple
(global) scheduling-class simple
+(global) zfs-io-priority simple
fs dir simple
special simple
raw simple
type simple
options list of simple
net address simple
+ allowed-address simple
+ defrouter simple
+ global-nic simple
+ mac-addr simple
physical simple
+ property list of complex
+ name simple
+ value simple
+ vlan-id simple
device match simple
rctl name simple
value list of complex
@@ -1201,6 +1250,16 @@ name \fBglobal\fR and all names beginning with \fBSUNW\fR are reserved and
cannot be used.
.RE
+.sp
+.ne 2
+.na
+\fB\fB-u\fR \fIuuid\fR\fR
+.ad
+.sp .6
+.RS 4n
+Specify the uuid of a zone instead of the Zone name.
+.RE
+
.SH SUBCOMMANDS
.LP
You can use the \fBadd\fR and \fBselect\fR subcommands to select a specific
@@ -1290,8 +1349,7 @@ correct to be committed, this operation automatically does a verify.
.sp
.ne 2
.na
-\fB\fBcreate [\fR\fB-F\fR\fB] [\fR \fB-a\fR \fIpath\fR |\fB-b\fR \fB|\fR
-\fB-t\fR \fItemplate\fR\fB]\fR\fR
+\fB\fBcreate [\fR\fB-F\fR\fB] [\fR \fB-a\fR \fIpath\fR |\fB-b\fR \fB|\fR \fB-t\fR \fItemplate\fR\fB] [\fR\fB-X\fR\fB]\fR\fR
.ad
.sp .6
.RS 4n
@@ -1313,6 +1371,8 @@ configured, it should be installed using the "\fBzoneadm attach\fR" command
.sp
Use the \fB-b\fR option to create a blank configuration. Without arguments,
\fBcreate\fR applies the Sun default settings.
+.sp
+Use the \fB-X\fR option to facilitate creating a zone whose XML definition already exists on the host. The zone will be atomically added to the zone index file.
.RE
.sp
@@ -1392,18 +1452,21 @@ which is currently being added or modified.
.sp
.ne 2
.na
-\fB\fBremove\fR \fIresource-type\fR\fB{\fR\fIproperty-name\fR\fB=\fR\fIproperty
--value\fR\fB}\fR(global scope)\fR
+\fB\fBremove\fR [\fR\fB-F\fR\fB] \fIresource-type\fR\fB [\fR\fIproperty-name\fR\fB=\fR\fIproperty-value\fR\fB]* \fR(global scope)\fR
+.br
+\fB\fBremove\fR \fR\fIproperty-name\fR\fB \fR\fIproperty-value\fR\fB \fR(resource scope)\fR
.ad
.sp .6
.RS 4n
In the global scope, removes the specified resource. The \fB[]\fR syntax means
-0 or more of whatever is inside the square braces. If you want only to remove a
+0 or more property name-value pairs. If you want to only remove a
single instance of the resource, you must specify enough property name-value
pairs for the resource to be uniquely identified. If no property name-value
pairs are specified, all instances will be removed. If there is more than one
-pair is specified, a confirmation is required, unless you use the \fB-F\fR
-option.
+pair specified, a confirmation is required, unless you use the \fB-F\fR
+option. Likewise, the \fB-F\fR option can be used to remove a resource that
+does not exist (that is, no error will occur). In the resource scope, remove
+the specified name-value pair.
.RE
.sp
diff --git a/usr/src/man/man1m/zpool.1m b/usr/src/man/man1m/zpool.1m
index baa534a31e..72ef9064d1 100644
--- a/usr/src/man/man1m/zpool.1m
+++ b/usr/src/man/man1m/zpool.1m
@@ -20,6 +20,7 @@
.\"
.\"
.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright (c) 2013, Joyent, Inc. All Rights Reserved.
.\" Copyright (c) 2013 by Delphix. All rights reserved.
.\" Copyright 2017 Nexenta Systems, Inc.
.\" Copyright (c) 2017 Datto Inc.
diff --git a/usr/src/man/man3c/Makefile b/usr/src/man/man3c/Makefile
index 47443e6fd8..b3387a412f 100644
--- a/usr/src/man/man3c/Makefile
+++ b/usr/src/man/man3c/Makefile
@@ -211,6 +211,9 @@ MANFILES= __fbufsize.3c \
imaxdiv.3c \
index.3c \
initgroups.3c \
+ inotify_init.3c \
+ inotify_add_watch.3c \
+ inotify_rm_watch.3c \
insque.3c \
is_system_labeled.3c \
isaexec.3c \
diff --git a/usr/src/man/man3c/inotify_add_watch.3c b/usr/src/man/man3c/inotify_add_watch.3c
new file mode 100644
index 0000000000..4f79e03c82
--- /dev/null
+++ b/usr/src/man/man3c/inotify_add_watch.3c
@@ -0,0 +1,120 @@
+'\" te
+.\" Copyright (c) 2014, Joyent, Inc. All Rights Reserved.
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.TH INOTIFY_ADD_WATCH 3C "Sep 17, 2014"
+.SH NAME
+inotify_add_watch \- add a watch to an inotify instance
+.SH SYNOPSIS
+
+.LP
+.nf
+#include <sys/inotify.h>
+
+\fBint\fR \fBinotify_add_watch\fR(\fBint\fR \fIfd\fR, \fBconst char *\fR\fIpathname\fR, \fBuint32_t\fR \fImask\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBinotify_add_watch()\fR function adds a watch for the file or
+directory specified by \fIpathname\fR to the inotify instance
+specified by \fIfd\fR for the events specified by \fImask\fR. See
+\fBinotify\fR(5) for details on the meaning of \fImask\fR, how
+it affects the interpretation of \fIpathname\fR, and how
+events for the watched file or directory are subsequently
+retrieved via \fBread\fR(2).
+
+.SH RETURN VALUES
+.sp
+.LP
+Upon succesful completion, \fBinotify_add_watch()\fR returns the
+watch descriptor associated with the new watch.
+If an error occurs, -1 is returned and errno is set to indicate
+the error.
+
+.SH ERRORS
+.sp
+.LP
+\fBinotify_add_watch()\fR will fail if:
+.sp
+.ne 2
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 10n
+\fIpathname\fR could not be opened for reading.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fBEBADF\fR\fR
+.ad
+.RS 10n
+The \fIfd\fR argument is not a valid open file descriptor.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+The memory associated with \fIpathname\fR was not mapped.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+The \fIfd\fR argument does not correspond to an
+\fBinotify\fR(5) instance as initialized with
+\fBinotify_init\fR(3C) or \fBinotify_init1\fR(3C).
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fBENOSPC\fR\fR
+.ad
+.RS 10n
+The number of watches on the specified instance would exceed the
+maximum number of watches per \fBinotify\fR(5) instance.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fBENOTDIR\fR\fR
+.ad
+.RS 10n
+\fIpathname\fR does not correspond to a directory and
+\fBIN_ONLYDIR\fR was specified in \fImask\fR.
+.RE
+
+.sp
+.SH NOTES
+.sp
+.LP
+
+While the \fBinotify\fR(5) facility is implemented for purposes of
+offering compatibility for Linux-borne applications, native
+applications may opt to use it instead of (or in addition to) the
+\fBPORT_SOURCE_FILE\fR capability of event ports. See
+\fBinotify\fR(5) for details and restrictions.
+
+.SH SEE ALSO
+.sp
+.LP
+\fBinotify_init\fR(3C), \fBinotify_init1\fR(3C),
+\fBport_create\fR(3C), \fBport_associate\fR(3C), \fBport_get\fR(3C),
+\fBinotify\fR(5)
diff --git a/usr/src/man/man3c/inotify_init.3c b/usr/src/man/man3c/inotify_init.3c
new file mode 100644
index 0000000000..551a2ca798
--- /dev/null
+++ b/usr/src/man/man3c/inotify_init.3c
@@ -0,0 +1,107 @@
+'\" te
+.\" Copyright (c) 2014, Joyent, Inc. All Rights Reserved.
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.TH INOTIFY_INIT 3C "Sep 17, 2014"
+.SH NAME
+inotify_init, inotify_init1 \- initialize an inotify instance
+.SH SYNOPSIS
+
+.LP
+.nf
+#include <sys/inotify.h>
+
+\fBint\fR \fBinotify_init\fR(\fBvoid\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBinotify_init1\fR(\fBint\fR \fIflags\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBinotify_init()\fR and \fBinotify_init1()\fR functions both create an
+\fBinotify\fR(5) instance that can be operated upon via
+\fBinotify_add_watch\fR(3C), \fBinotify_rm_watch\fR(3C) and \fBread\fR(2).
+\fBinotify\fR instances are
+represented as file descriptors, and should be closed via \fBclose\fR(2).
+
+The only difference between the two functions is their signature;
+\fBinotify_init()\fR takes no arguments,
+while \fBinotify_init1()\fR takes a \fIflags\fR argument that can have
+any of the following values:
+
+.sp
+.ne 2
+.na
+\fBIN_CLOEXEC\fR
+.ad
+.RS 12n
+Instance should be closed upon an
+\fBexec\fR(2); see \fBopen\fR(2)'s description of \fBO_CLOEXEC\fR.
+.RE
+
+.sp
+.ne 2
+.na
+\fBIN_NONBLOCK\fR
+.ad
+.RS 12n
+Instance will be set to be non-blocking. A \fBread\fR(2) on an
+\fBinotify\fR instance that has been initialized with
+\fBIN_NONBLOCK\fR will return \fBEAGAIN\fR if there are
+no events enqueued in lieu of blocking.
+.RE
+
+.SH RETURN VALUES
+.sp
+.LP
+Upon succesful completion, 0 is returned. Otherwise, -1 is returned and errno
+is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBinotify_init()\fR and \fBinotify_init1()\fR functions will fail if:
+.sp
+.ne 2
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+The \fIflags\fR are invalid (\fBinotify_init1()\fR).
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fBEMFILE\fR\fR
+.ad
+.RS 10n
+There are currently {\fBOPEN_MAX\fR} file descriptors open in the calling
+process, or the maximum number of \fBinotify\fR instances for the user
+would be exceeded.
+.RE
+
+.sp
+.SH NOTES
+.sp
+.LP
+
+While the \fBinotify\fR(5) facility is implemented for purposes of
+offering compatibility for Linux-borne applications, native
+applications may opt to use it instead of (or in addition to) the
+\fBPORT_SOURCE_FILE\fR capability of event ports. See
+\fBinotify\fR(5) for details and restrictions.
+
+.SH SEE ALSO
+.sp
+.LP
+\fBinotiy_add_watch\fR(3C), \fBinotify_rm_watch\fR(3C), \fBinotify\fR(5)
diff --git a/usr/src/man/man3c/inotify_rm_watch.3c b/usr/src/man/man3c/inotify_rm_watch.3c
new file mode 100644
index 0000000000..de568f8e24
--- /dev/null
+++ b/usr/src/man/man3c/inotify_rm_watch.3c
@@ -0,0 +1,81 @@
+'\" te
+.\" Copyright (c) 2014, Joyent, Inc. All Rights Reserved.
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.TH INOTIFY_RM_WATCH 3C "Sep 17, 2014"
+.SH NAME
+inotify_rm_watch \- remove a watch from an inotify instance
+.SH SYNOPSIS
+
+.LP
+.nf
+#include <sys/inotify.h>
+
+\fBint\fR \fBinotify_rm_watch\fR(\fBint\fR \fIfd\fR, \fBint\fR \fIwd\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBinotify_rm_watch()\fR function removes the watch specified
+by \fIwd\fR from the inotify instance associated with \fIfd\fR.
+Removing a watch will induce an \fBIN_IGNORED\fR event; see
+\fBinotify\fR(5) for details.
+
+.SH RETURN VALUES
+.sp
+.LP
+Upon succesful completion, \fBinotify_add_watch()\fR returns the
+watch descriptor associated with the new watch.
+If an error occurs, -1 is returned and errno is set to indicate
+the error.
+
+.SH ERRORS
+.sp
+.LP
+\fBinotify_rm_watch()\fR will fail if:
+.sp
+.ne 2
+.na
+\fB\fBEBADF\fR\fR
+.ad
+.RS 10n
+The \fIfd\fR argument is not a valid open file descriptor.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+The \fIfd\fR argument does not correspond to an
+\fBinotify\fR(5) instance as initialized with
+\fBinotify_init\fR(3C) or \fBinotify_init1\fR(3C), or
+\fIwd\fR is not a valid watch for the specified inotify
+instance.
+.RE
+
+.sp
+.SH NOTES
+.sp
+.LP
+
+While the \fBinotify\fR(5) facility is implemented for purposes of
+offering compatibility for Linux-borne applications, native
+applications may opt to use it instead of (or in addition to) the
+\fBPORT_SOURCE_FILE\fR capability of event ports. See
+\fBinotify\fR(5) for details and restrictions.
+
+.SH SEE ALSO
+.sp
+.LP
+\fBinotify_init\fR(3C), \fBinotify_init1\fR(3C),
+\fBport_create\fR(3C), \fBport_associate\fR(3C), \fBport_get\fR(3C),
+\fBinotify\fR(5)
diff --git a/usr/src/man/man3c/psignal.3c b/usr/src/man/man3c/psignal.3c
index 20653e1f98..a977fb6df4 100644
--- a/usr/src/man/man3c/psignal.3c
+++ b/usr/src/man/man3c/psignal.3c
@@ -11,7 +11,7 @@ psignal, psiginfo \- system signal messages
.SH SYNOPSIS
.LP
.nf
-#include <siginfo.h>
+#include <signal.h>
\fBvoid\fR \fBpsignal\fR(\fBint\fR \fIsig\fR, \fBconst char *\fR\fIs\fR);
.fi
diff --git a/usr/src/man/man3c/timer_create.3c b/usr/src/man/man3c/timer_create.3c
index 2f93e954e3..f57bf1d25f 100644
--- a/usr/src/man/man3c/timer_create.3c
+++ b/usr/src/man/man3c/timer_create.3c
@@ -9,7 +9,7 @@
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH TIMER_CREATE 3C "Sep 15, 2015"
+.TH TIMER_CREATE 3C "Mar 24, 2016"
.SH NAME
timer_create \- create a timer
.SH SYNOPSIS
@@ -125,17 +125,6 @@ system.
The specified clock \fBID\fR, \fIclock_id\fR, is not defined.
.RE
-.sp
-.ne 2
-.na
-\fB\fBEPERM\fR\fR
-.ad
-.RS 10n
-The specified clock \fBID\fR, \fIclock_id\fR, is \fBCLOCK_HIGHRES\fR and the
-{\fBPRIV_PROC_CLOCK_HIGHRES\fR} is not asserted in the effective set of the
-calling process.
-.RE
-
.SH ATTRIBUTES
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
@@ -159,5 +148,4 @@ Standard See \fBstandards\fR(5).
.LP
\fBexec\fR(2), \fBfork\fR(2), \fBtime\fR(2), \fBclock_settime\fR(3C),
\fBsignal\fR(3C), \fBsignal.h\fR(3HEAD), \fBtimer_delete\fR(3C),
-\fBtimer_settime\fR(3C), \fBattributes\fR(5), \fBprivileges\fR(5),
-\fBstandards\fR(5)
+\fBtimer_settime\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)
diff --git a/usr/src/man/man3c/timer_settime.3c b/usr/src/man/man3c/timer_settime.3c
index 543f042aba..8ae32ccc91 100644
--- a/usr/src/man/man3c/timer_settime.3c
+++ b/usr/src/man/man3c/timer_settime.3c
@@ -1,5 +1,6 @@
'\" te
.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 2016, Joyent, Inc.
.\" Copyright 1989 AT&T
.\" Portions Copyright (c) 1992, X/Open Company Limited. All Rights Reserved.
.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
@@ -9,7 +10,7 @@
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH TIMER_SETTIME 3C "Feb 5, 2008"
+.TH TIMER_SETTIME 3C "Mar 24, 2016"
.SH NAME
timer_settime, timer_gettime, timer_getoverrun \- per-process timers
.SH SYNOPSIS
@@ -103,6 +104,12 @@ set to \fBDELAYTIMER_MAX\fR. The value returned by \fBtimer_getoverrun()\fR
applies to the most recent expiration signal delivery or acceptance for the
timer. If no expiration signal has been delivered for the timer, the meaning of
the overrun count returned is undefined.
+.sp
+.LP
+If the specified timer is of type \fBCLOCK_HIGHRES\fR and the time value is
+smaller than a system defined threshold, then {\fBPRIV_PROC_CLOCK_HIGHRES\fR}
+must be asserted in the effective set of the calling process or the time values
+will be adjusted up to the threshold value.
.SH RETURN VALUES
.sp
.LP
@@ -171,4 +178,5 @@ Standard See \fBstandards\fR(5).
.sp
.LP
\fBtime.h\fR(3HEAD), \fBclock_settime\fR(3C), \fBtimer_create\fR(3C),
-\fBtimer_delete\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)
+\fBtimer_delete\fR(3C), \fBattributes\fR(5), \fBprivileges\fR(5),
+\fBstandards\fR(5)
diff --git a/usr/src/man/man3dlpi/Makefile b/usr/src/man/man3dlpi/Makefile
index cdd24216bd..4c5448f0be 100644
--- a/usr/src/man/man3dlpi/Makefile
+++ b/usr/src/man/man3dlpi/Makefile
@@ -41,10 +41,12 @@ MANFILES= dlpi_arptype.3dlpi \
dlpi_walk.3dlpi
MANLINKS= dlpi_disabmulti.3dlpi \
+ dlpi_open_zone.3dlpi \
dlpi_promiscoff.3dlpi
dlpi_disabmulti.3dlpi := LINKSRC = dlpi_enabmulti.3dlpi
+dlpi_open_zone.3dlpi := LINKSRC = man3dlpi/dlpi_open.3dlpi
dlpi_promiscoff.3dlpi := LINKSRC = dlpi_promiscon.3dlpi
.KEEP_STATE:
diff --git a/usr/src/man/man3dlpi/dlpi_open.3dlpi b/usr/src/man/man3dlpi/dlpi_open.3dlpi
index 8129a75404..489f66066a 100644
--- a/usr/src/man/man3dlpi/dlpi_open.3dlpi
+++ b/usr/src/man/man3dlpi/dlpi_open.3dlpi
@@ -1,9 +1,10 @@
'\" te
.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved
+.\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH DLPI_OPEN 3DLPI "Nov 17, 2008"
+.TH DLPI_OPEN 3DLPI "Feb 24, 2014"
.SH NAME
dlpi_open \- open DLPI link
.SH SYNOPSIS
@@ -14,6 +15,9 @@ dlpi_open \- open DLPI link
\fBint\fR \fBdlpi_open\fR(\fBconst char *\fR\fIlinkname\fR, \fBdlpi_handle_t *\fR\fIdhp\fR,
\fBuint_t\fR \fIflags\fR);
+
+\fBint\fR \fBdlpi_open_zone\fR(\fBconst char *\fR\fIlinkname\fR, \fBconst char *\fR
+ \fIzonename\fR, \fBdlpi_handle_t *\fR\fIdhp\fR, \fBuint_t\fR \fIflags\fR);
.fi
.SH DESCRIPTION
@@ -114,6 +118,18 @@ value ensures that \fBDLPI_ETIMEDOUT\fR is returned from a \fBlibdlpi\fR
operation only in the event that the \fBDLPI\fR link becomes unresponsive. The
timeout value can be changed with \fBdlpi_set_timeout\fR(3DLPI), although this
should seldom be necessary.
+
+.sp
+.LP
+The \fBdlpi_open_zone()\fR function behaves as \fBdlpi_open()\fR, except that it
+looks for the link specified by \fBlinkname\fR in the specified zone
+\fBzonename\fR as opposed to the current zone. This function is only meaningful
+from the global zone. Instead of scanning \fB/dev/net\fR, \fBdlpi_open_zone()\fR
+scans \fB/dev/net/zone/<\fIzonename\fR> for the data link and
+\fB/dev/ipnet/zone/<\fIzonename\fR> when DLPI_DEVIPNET is present in
+\fBflags\fR. If a NULL or empty string is passed into \fBdlpi_open_zone()\fR, it
+will behave as though \fBdlpi_open\fR has been called.
+
.SH RETURN VALUES
.sp
.LP
@@ -124,7 +140,7 @@ section is returned.
.SH ERRORS
.sp
.LP
-The \fBdlpi_open()\fR function will fail if:
+The \fBdlpi_open()\fR and \fBdlpi_open_zone()\fR function will fail if:
.sp
.ne 2
.na
@@ -195,6 +211,17 @@ DLPI operation failed
See \fBattributes\fR(5) for description of the following attributes:
.sp
+.LP
+The \fBdlpi_open_zone()\fR function will fail if:
+.sp
+.ne 2
+.na
+\fB\fBDLPI_EZONENAMEINVAL\fR\fR
+.ad
+.RS 25n
+Invalid \fIzonename\fR argument
+.RE
+
.sp
.TS
box;
diff --git a/usr/src/man/man3lib/Makefile b/usr/src/man/man3lib/Makefile
index 220ed2ae3e..a470f408fa 100644
--- a/usr/src/man/man3lib/Makefile
+++ b/usr/src/man/man3lib/Makefile
@@ -105,6 +105,7 @@ MANFILES= libMPAPI.3lib \
libumem.3lib \
libuuid.3lib \
libvolmgt.3lib \
+ libvnd.3lib \
libw.3lib \
libxnet.3lib \
liby.3lib
diff --git a/usr/src/man/man3lib/libvnd.3lib b/usr/src/man/man3lib/libvnd.3lib
new file mode 100644
index 0000000000..ead69ff82e
--- /dev/null
+++ b/usr/src/man/man3lib/libvnd.3lib
@@ -0,0 +1,690 @@
+'\" te
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
+.\"
+.TH LIBVND 3LIB "Mar 06, 2014"
+.SH NAME
+libvnd \- vnd library
+
+.SH SYNOPSIS
+.LP
+.nf
+cc [ flag... ] file... -lvnd [ library... ]
+#include <libvnd.h>
+.fi
+
+.SH DESCRIPTION
+.LP
+The libvnd library provides a stable and programmatic interface to
+vnd(7D) devices. vnd devices provide the means for creating a layer two
+interface over a data link, similar to the use of libdlpi(3LIB) and
+IP(7P). In dlpi parlance, a vnd device obtains data from all service
+attachment points (SAP). For ethernet devices, this means that a vnd
+device sends and receives traffic for all ethertypes. It is intended to
+be used for services such as virtual machines which emulate layer two
+devices.
+
+.LP
+Handles to vnd(7D) devices are obtained through the use of vnd_create
+and vnd_open. With a handle, I/O can be performed and properties on the
+device can be set and retrieved. I/O on devices should be performed
+through the vnd_frameio_read and vnd_frameio_write functions. A file
+descriptor suitable for use with event ports and polling may be obtained
+through vnd_pollfd. Handles are relinquished through calls to vnd_close;
+however, devices will persist until vnd_unlink has been called.
+
+.LP
+The rest of this manual documents the interfaces, properties, errors,
+and threading model for libvnd. The in-depth description of individual
+interfaces, their arguments, and examples, are in manual pages for each
+provided interface.
+
+
+.SH INTERFACES
+.sp
+.LP
+
+The shared object libvnd.so.1 provides the public interfaces defined
+below. See Intro(3) for additional information on shared object
+interfaces. Individual functions are documented in their own manual
+pages.
+
+.sp
+.TS
+l l
+l l .
+vnd_create vnd_errno
+vnd_open vnd_syserrno
+vnd_unlink vnd_strerror
+vnd_close vnd_strsyserror
+vnd_pollfd vnd_walk
+vnd_prop_get vnd_prop_set
+vnd_prop_iter vnd_prop_writeable
+vnd_frameio_read vnd_frameio_write
+.TE
+
+.SH PROPERTIES
+
+.LP
+The following table summarizes properties of a vnd device. The
+properties can be retrieved and set with the functions
+vnd_prop_get(3VND) and vnd_prop_set(3VND). Following the table, the
+structures and properties are described in greater detail.
+
+.nf
+ +-------------------+---------------------+-------+
+ | PROPERTY | STRUCTURE | PERM |
+ +-------------------+---------------------+-------+
+ | VND_PROP_RXBUF | vnd_prop_buf_t | R/W |
+ +-------------------+---------------------+-------+
+ | VND_PROP_TXBUF | vnd_prop_buf_t | R/W |
+ +-------------------+---------------------+-------+
+ | VND_PROP_MAXBUF | vnd_prop_buf_t | R/- |
+ +-------------------+---------------------+-------+
+ | VND_PROP_MINTU | vnd_prop_buf_t | R/- |
+ +-------------------+---------------------+-------+
+ | VND_PROP_MAXTU | vnd_prop_buf_t | R/- |
+ +-------------------+---------------------+-------+
+.fi
+
+.SS Structures
+
+.LP
+The vnd_prop_buf_t structure has the following members:
+
+.in +2
+.nf
+uint64_t vpb_size;
+.fi
+.in -2
+
+.LP
+The vpb_size member refers to a size in bytes. When getting a property,
+it represents the size of that property, when setting a property, it is
+the size to set the property to.
+
+
+.SS Property Descriptions
+.sp
+.ne 2
+.na
+rxbuf
+.ad
+.sp .6
+.RS 4n
+A read/write property that controls the size of the receive buffer for
+the device. All received data enters the receive buffer until a consumer
+consumes it. If adding a received frame would exceed the size of the
+receive buffer, then that frame will be dropped. The maximum size of the
+buffer is limited by the 'maxsize' property.
+.RE
+
+.sp
+.ne 2
+.na
+txbuf
+.ad
+.sp .6
+.RS 4n
+A read/write property that controls the size of the transmit buffer. All
+in-flight transmitted data must be able to fix into the transmit buffer
+to deal with potential flow control events. If there is not enough space
+in the transmit buffer, transmit related I/O operations will either
+block or fail based on whether or not O_NONBLOCK or O_NDELAY were set
+with fcntl(2).
+.RE
+
+.sp
+.ne 2
+.na
+maxsize
+.ad
+.sp .6
+.RS 4n
+A read only property that describes the maximum size of buffers in the
+system. Properties such as rxbuf and txbuf cannot be set beyond this.
+.RE
+
+.sp
+.ne 2
+.na
+mintu
+.ad
+.sp .6
+.RS 4n
+A read only property that describes the minimum size of a frame
+transmitted to the underlying data link. Note that the minimum listed
+here may be less than the size of a valid layer two frame and therefore
+may be dropped. A frame smaller than this value will be rejected by vnd.
+.RE
+
+.sp
+.ne 2
+.na
+maxtu
+.ad
+.sp .6
+.RS 4n
+A read only property that describes the maximum size of
+a frame transmitted to the underlying data link. A frame
+larger than this value will be rejected by vnd.
+.RE
+
+
+.SH ERRORS
+.sp
+.LP
+Most interfaces provided by libvnd provide a means to retrieve a
+vnd_errno_t that describes an error that has occurred. The manuals for
+individual interfaces describe whether or not this additional error
+information is available and how to retrieve it. The following is a
+complete list of the error numbers and their names as defined in
+<sys/vnd_errno.h>. Any entries not listed here are private to the
+implementation and may change at any time.
+
+.sp
+.ne 2
+.na
+0 VND_E_SUCCESS
+.ad
+.RS 23n
+no error
+.sp
+This indicates that the operation completed successfully.
+.RE
+
+.sp
+.ne 2
+.na
+1 VND_E_NOMEM
+.ad
+.RS 23n
+not enough memory available
+.sp
+Insufficient memory was available. This is the equivalent of the
+standard system errno ENOMEM.
+.RE
+
+.sp
+.ne 2
+.na
+2 VND_E_NODATALINK
+.ad
+.RS 23n
+no such datalink
+.sp
+The data link requested to be used as part of vnd_create does not exist
+in the requested zone.
+.RE
+
+.sp
+.ne 2
+.na
+3 VND_E_NOTETHER
+.ad
+.RS 23n
+datalink not of type DL_ETHER
+.sp
+The data link used as part of a call to vnd_create is not an Ethernet
+device. vnd_create only works with Ethernet devices at this time.
+.RE
+
+.sp
+.ne 2
+.na
+4 VND_E_DLPIINVAL
+.ad
+.RS 23n
+unknown dlpi failure
+.sp
+An unexpected DLPI message was received during vnd device
+initialization.
+.RE
+
+.sp
+.ne 2
+.na
+5 VND_E_ATTACHFAIL
+.ad
+.RS 23n
+DL_ATTACH_REQ failed
+.sp
+During vnd device initialization, the dlpi call to attach to the
+requested data link failed.
+.RE
+
+.sp
+.ne 2
+.na
+6 VND_E_BINDFAIL
+.ad
+.RS 23n
+DL_BIND_REQ failed
+.sp
+
+During vnd device initialization, the dlpi call to bind to a service
+attachment point on the data link failed.
+.RE
+
+.sp
+.ne 2
+.na
+7 VND_E_PROMISCFAIL
+.ad
+.RS 23n
+DL_PROMISCON_REQ failed
+.sp
+
+During vnd device initialization, the dlpi call to enable promiscuous
+mode on the underlying device failed.
+.RE
+
+.sp
+.ne 2
+.na
+8 VND_E_DIRECTFAIL
+.ad
+.RS 23n
+DLD_CAPAB_DIRECT enable failed
+.sp
+During vnd device initialization, the dlpi call to enable the DLD fast
+path failed.
+.RE
+
+.sp
+.ne 2
+.na
+9 VND_E_CAPACKINVAL
+.ad
+.RS 23n
+bad datalink capability
+.sp
+During vnd device initialization, the kernel responded with an invalid
+capability acknowledgement.
+.RE
+
+.sp
+.ne 2
+.na
+10 VND_E_SUBCAPINVAL
+.ad
+.RS 23n
+bad datalink subcapability
+.sp
+During vnd device initialization, the kernel responded with an invalid
+sub-capability.
+.RE
+
+.sp
+.ne 2
+.na
+11 VND_E_DLDBADVERS
+.ad
+.RS 23n
+bad dld version
+.sp
+The vnd(7D) module does not support the version of the dld capability
+that the kernel sent. As such, the data path could not be brought up and
+the device could not be fully initialized.
+.RE
+
+.sp
+.ne 2
+.na
+12 VND_E_KSTATCREATE
+.ad
+.RS 23n
+failed to create kstats
+.sp
+During vnd device initialization, the necessary kstats could not be
+created.
+.RE
+
+.sp
+.ne 2
+.na
+13 VND_E_NODEV
+.ad
+.RS 23n
+no such vnd link
+.sp
+During device initialization, the requested character device did not
+exist.
+.RE
+
+.sp
+.ne 2
+.na
+14 VND_E_NONETSTACK
+.ad
+.RS 23n
+netstack doesn't exist
+.sp
+During device initialization, the networking stack for the device did
+not exist.
+.RE
+
+.sp
+.ne 2
+.na
+15 VND_E_ASSOCIATED
+.ad
+.RS 23n
+device already associated
+.sp
+During vnd device initialization, the vnd STREAMS device was already
+associated with another vnd device.
+.RE
+
+.sp
+.ne 2
+.na
+16 VND_E_ATTACHED
+.ad
+.RS 23n
+device already attached
+.sp
+The given vnd device has already been created over a data link and
+cannot be created over another one.
+.RE
+
+.sp
+.ne 2
+.na
+17 VND_E_LINKED
+.ad
+.RS 23n
+device already linked
+.sp
+The given vnd device has already been given a name and bound into the
+file system name space.
+.RE
+
+.sp
+.ne 2
+.na
+18 VND_E_BADNAME
+.ad
+.RS 23n
+invalid name
+.sp
+The requested name is not a valid name. Valid names are alphanumeric
+ascii names, along with the following ascii characters: ':', '\-', and
+\'_'. Names must be less than LIBVND_NAMELEN bytes including the null
+terminator.
+.RE
+
+.sp
+.ne 2
+.na
+19 VND_E_PERM
+.ad
+.RS 23n
+permission denied
+.sp
+A request was made from a non-global zone to manipulate a vnd device
+that belongs to a different zone.
+.RE
+
+.sp
+.ne 2
+.na
+20 VND_E_NOZONE
+.ad
+.RS 23n
+no such zone
+.sp
+A request was made which targeted a zone that did not exist.
+.RE
+
+.sp
+.ne 2
+.na
+21 VND_E_STRINIT
+.ad
+.RS 23n
+failed to initialize vnd stream module
+.sp
+During vnd device initialization, the vnd STREAMS module could not be
+pushed onto the data link's stream head.
+.RE
+
+.sp
+.ne 2
+.na
+22 VND_E_NOTATTACHED
+.ad
+.RS 23n
+device not attached
+.sp
+A request was made that requires a vnd device be attached to a data
+link, such as a call to change a property. The device was not attached
+to a data link.
+.RE
+
+.sp
+.ne 2
+.na
+23 VND_E_NOTLINKED
+.ad
+.RS 23n
+device not linked
+.sp
+A request was made to a vnd device that requires the vnd device to be
+named and present in /dev. The given device was not linked into /dev at
+the time of the call.
+.RE
+
+.sp
+.ne 2
+.na
+24 VND_E_LINKEXISTS
+.ad
+.RS 23n
+another device has the same link name
+.sp
+When trying to link a given vnd device into a zones /dev name space,
+another device already exists with the same name.
+.RE
+
+.sp
+.ne 2
+.na
+25 VND_E_MINORNODE
+.ad
+.RS 23n
+failed to create minor node
+.sp
+While trying to link a vnd device into the /devices and /dev name space,
+the call to ddi_create_minor_node() failed.
+.RE
+
+.sp
+.ne 2
+.na
+26 VND_E_BUFTOOBIG
+.ad
+.RS 23n
+requested buffer size is too large
+.sp
+The requested buffer size exceeds the maximum valid value for the given
+property.
+.RE
+
+.sp
+.ne 2
+.na
+27 VND_E_BUFTOOSMALL
+.ad
+.RS 23n
+requested buffer size is too small
+.sp
+The requested buffer size is less than the minimum buffer size. This
+generally occurs when making the buffer size less than the maximum
+transmission unit.
+.RE
+
+.sp
+.ne 2
+.na
+28 VND_E_DLEXCL
+.ad
+.RS 23n
+unable to obtain exclusive access to dlpi link, link busy
+.sp
+When a vnd device is created, it expects exclusive active access to the
+device. If any other active dlpi consumers, such as IP, are already
+using the device, then the vnd device will not be created. Passive
+consumers, such as snoop, can still use a device that has been
+exclusively opened.
+.RE
+
+.sp
+.ne 2
+.na
+28 VND_E_DIRECTNOTSUP
+.ad
+.RS 23n
+DLD direct capability not supported over data link
+.sp
+The data link that the vnd device was created over does not supported
+the DLD Direct capability. As such, the data path could not be
+initialized.
+.RE
+
+.sp
+.ne 2
+.na
+30 VND_E_BADPROPSIZE
+.ad
+.RS 23n
+invalid property size
+.sp
+The size of the data passed into vnd_prop_get or vnd_prop_set is
+incorrect and does not match the expected data size.
+.RE
+
+.sp
+.ne 2
+.na
+31 VND_E_BADPROP
+.ad
+.RS 23n
+invalid property
+.sp
+An unknown property identifier was specified. For a list of valid
+properties, see the section above entitled "PROPERTIES".
+.RE
+
+.sp
+.ne 2
+.na
+32 VND_E_PROPRDONLY
+.ad
+.RS 23n
+property is read only
+.sp
+An operation tried to update the value of a read only property. For a
+list of which properties are read only and which are readable and
+writeable, see the section above entitled "PROPERTIES".
+.RE
+
+.sp
+.ne 2
+.na
+33 VND_E_SYS
+.ad
+.RS 23n
+unexpected system error
+.sp
+This indicates that there is no vnd specific error available and that
+the system errno is valid. The system errno can be obtained and printed
+through vnd_syserrno and vnd_strsyserror. The possible values and their
+meanings are documented in Intro(2).
+.RE
+
+.sp
+.ne 2
+.na
+34 VND_E_CAPABPASS
+.ad
+.RS 23n
+capabilities invalid, pass-through module detected
+.sp
+While negotiating capabilities, a pass-through module was detected and
+the capability had to be discarded. Because of this, the data path could
+not be initialized.
+.RE
+
+
+.SH THREADING
+
+.LP
+The libvnd library is not truly MT-safe. MT-safety is provided on
+the granularity of a given vnd_handle_t. Operations on a single
+vnd_handle_t are unsafe; however, operations on different handles are
+MT-safe. If a single vnd_handle_t is used by multiple threads, it
+is the caller's responsibility to provide locking to ensure that
+multiple threads aren't simultaneously calling into libvnd on a
+single handle.
+
+
+.SH FILES
+.sp
+.ne 2
+.na
+/usr/lib/libvnd.so.1
+.ad
+.RS 27n
+shared object
+.RE
+
+.sp
+.ne 2
+.na
+/usr/lib/64/libvnd.so.1
+.ad
+.RS 27n
+64-bit shared object
+.RE
+
+.SH ATTRIBUTES
+
+.sp
+.LP
+See attributes(5) for descriptions of the following attributes:
+
+.sp
+.TS
+box;
+c | c
+l | l .
+ATTRIBUTE TYPE ATTRIBUTE VALUE
+_
+Stability Committed
+_
+MT-Level See "THREADING"
+.TE
+
+.SH SEE ALSO
+
+.sp
+.LP
+attributes(5), Intro(2), fcntl(2), Intro(3), fcntl.h(3HEAD), libdlpi(3LIB), port_create(3C), vnd(7D)
+.sp
+.LP
+vnd_close(3VND), vnd_create(3VND), vnd_errno(3VND),
+vnd_frameio_read(3VND), vnd_frameio_write(3VND), vnd_open(3VND)
+vnd_pollfd(3VND), vnd_prop_get(3VND), vnd_prop_iter(3VND),
+vnd_prop_set(3VND),
+vnd_prop_writeable(3VND), vnd_walk(3VND)
diff --git a/usr/src/man/man3nsl/t_bind.3nsl b/usr/src/man/man3nsl/t_bind.3nsl
index 5d3855e3dd..5df45954b0 100644
--- a/usr/src/man/man3nsl/t_bind.3nsl
+++ b/usr/src/man/man3nsl/t_bind.3nsl
@@ -1,4 +1,3 @@
-'\" te
.\" Copyright 1994, The X/Open Company Ltd., All Rights Reserved. Portions Copyright 1989 AT&T. Portions Copyright (c) 1998, Sun Microsystems, Inc. , All Rights Reserved
.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
.\" http://www.opengroup.org/bookstore/.
@@ -7,308 +6,405 @@
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH T_BIND 3NSL "Dec 27, 2013"
-.SH NAME
-t_bind \- bind an address to a transport endpoint
-.SH SYNOPSIS
-.LP
-.nf
-#include <xti.h>
-
-
-
-
-\fBint\fR \fBt_bind\fR(\fBint\fR \fIfd\fR, \fBconst struct t_bind *\fR\fIreq\fR, \fBstruct t_bind *\fR\fIret\fR);
-.fi
-
-.SH DESCRIPTION
-.sp
-.LP
-This routine is part of the \fBXTI\fR interfaces that evolved from the
-\fBTLI\fR interfaces. \fBXTI\fR represents the future evolution of these
-interfaces. However, \fBTLI\fR interfaces are supported for compatibility. When
-using a \fBTLI\fR routine that has the same name as an \fBXTI\fR routine, the
-\fBtiuser.h\fR header file must be used. Refer to the \fBTLI\fR
-\fBCOMPATIBILITY\fR section for a description of differences between the two
+.\"
+.\" Copyright 2017 Joyent, Inc.
+.\"
+.Dd Sep 28, 2017
+.Dt T_BIND 3NSL
+.Os
+.Sh NAME
+.Nm t_bind
+.Nd bind an address to a tansport endpoint
+.Sh SYNOPSIS
+.Lb libnsl
+.In xti.h
+.Ft int
+.Fo t_bind
+.Fa "int fd"
+.Fa "const struct t_bind *req"
+.Fa "stuct t_bind *ret"
+.Fc
+.Sh DESCRIPTION
+This routine is part of the
+.Sy XTI
+interfaces that evolved from the
+.Sy TLI
interfaces.
-.sp
-.LP
+.Sy XTI
+represents the future evolution of these
+interfaces.
+However,
+.Sy TLI
+interfaces are supported for compatibility.
+When using a
+.Sy TLI
+routine that has the same name as an
+.Sy XTI
+routine, the
+.In tiuser.h
+header file must be used.
+Refer to the
+.Sx "TLI COMPATIBILITY"
+section for a description of differences between the two interfaces.
+.Pp
This function associates a protocol address with the transport endpoint
-specified by \fIfd\fR and activates that transport endpoint. In connection
-mode, the transport provider may begin enqueuing incoming connect indications,
-or servicing a connection request on the transport endpoint. In
-connectionless-mode, the transport user may send or receive data units through
+specified by
+.Fa fd
+and activates that transport endpoint.
+In connection mode, the transport provider may begin enqueuing incoming
+connect indications, or servicing a connection request on the transport
+endpoint.
+In connectionless-mode, the transport user may send or receive data units
+through the transport endpoint.
+.Pp
+The
+.Fa req
+and
+.Fa ret
+arguments point to a
+.Vt t_bind
+structure containing the following members:
+.Pp
+.Bl -item -offset indent -compact
+.It
+struct netbuf addr;
+.It
+unsigned qlen;
+.El
+.Pp
+The
+.Sy addr
+field of the
+.Vt t_bind
+structure specifies a protocol address, and the
+.Sy qlen
+field is used to indicate the maximum number of outstanding connection
+indications.
+.Pp
+The parameter
+.Fa req
+is used to request that an address, represented by the
+.Vt netbuf
+structure, be bound to the given transport endpoint.
+The parameter
+.Sy len
+specifies the number of bytes in the address, and
+.Sy buf
+points to the address buffer.
+For
+.Xr tcp 7P
+and
+.Xr udp 7P
+transports,
+.Sy buf
+points to a
+.Xr sockaddr 3SOCKET
+buffer \(em either
+.Vt "struct sockaddr_in"
+or
+.Vt "struct sockaddr_in6"
+(depending on if IPv4 or IPv6 is being used).
+The parameter
+.Sy maxlen
+has no meaning for the
+.Fa req
+argument.
+.Pp
+On return,
+.Fa ret
+contains an encoding for the address that the transport provider actually
+bound to the transport endpoint; if an address was specified in
+.Fa req ,
+this will be an encoding of the same address.
+In
+.Fa ret ,
+the user specifies
+.Sy maxlen ,
+which is the maximum size of the address buffer, and
+.Sy buf
+which points to the buffer where the address is to be placed.
+On return,
+.Sy len
+specifies the number of bytes in the bound address, and
+.Sy buf
+points to the bound address.
+If
+.Sy maxlen
+equals zero, no address is returned.
+If
+.Sy maxlen
+is greater than zero and less than the length of the address,
+.Fn t_bind
+fails with
+.Va t_errno
+set to
+.Er TBUFOVFLW .
+.Pp
+If the requested address is not available,
+.Fn t_bind
+will return -1 with
+.Va t_errno
+set as appropriate.
+If no address is specified in
+.Fa req
+(the
+.Sy len
+field of
+.Sy addr
+in
+.Fa req
+is zero or
+.Fa req
+is
+.Sy NULL ) ,
+the transport provider will assign an appropriate address to be
+bound, and will return that address in the
+.Sy addr
+field of
+.Fa ret .
+If the transport provider could not allocate an address,
+.Fn t_bind
+will fail
+with
+.Va t_errno
+set to
+.Er TNOADDR .
+.Pp
+The parameter
+.Fa req
+may be a null pointer if the user does not wish to
+specify an address to be bound.
+Here, the value of
+.Sy qlen
+is assumed to be zero, and the transport provider will assign an address to
the transport endpoint.
-.sp
-.LP
-The \fIreq\fR and \fIret\fR arguments point to a \fBt_bind\fR structure
-containing the following members:
-.sp
-.in +2
-.nf
-struct netbuf addr;
-unsigned qlen;
-.fi
-.in -2
-
-.sp
-.LP
-The \fIaddr\fR field of the \fBt_bind\fR structure specifies a protocol
-address, and the \fIqlen\fR field is used to indicate the maximum number of
-outstanding connection indications.
-.sp
-.LP
-The parameter \fIreq\fR is used to request that an address, represented by the
-\fBnetbuf\fR structure, be bound to the given transport endpoint. The parameter
-\fIlen\fR specifies the number of bytes in the address, and \fIbuf\fR points to
-the address buffer. The parameter \fImaxlen\fR has no meaning for the \fIreq\fR
-argument. On return, \fIret\fR contains an encoding for the address that the
-transport provider actually bound to the transport endpoint; if an address was
-specified in \fIreq\fR, this will be an encoding of the same address. In
-\fIret\fR, the user specifies \fImaxlen,\fR which is the maximum size of the
-address buffer, and \fIbuf\fR which points to the buffer where the address is
-to be placed. On return, \fIlen\fR specifies the number of bytes in the bound
-address, and \fIbuf\fR points to the bound address. If \fImaxlen\fR equals
-zero, no address is returned. If \fImaxlen\fR is greater than zero and less
-than the length of the address, \fBt_bind()\fR fails with \fBt_errno\fR set to
-\fBTBUFOVFLW\fR.
-.sp
-.LP
-If the requested address is not available, \fBt_bind()\fR will return -1 with
-\fBt_errno\fR set as appropriate. If no address is specified in \fIreq\fR (the
-\fIlen\fR field of \fIaddr\fR in \fIreq\fR is zero or \fIreq\fR is
-\fBNULL),\fR the transport provider will assign an appropriate address to be
-bound, and will return that address in the \fIaddr\fR field of \fIret\fR. If
-the transport provider could not allocate an address, \fBt_bind()\fR will fail
-with \fBt_errno\fR set to \fBTNOADDR\fR.
-.sp
-.LP
-The parameter \fIreq\fR may be a null pointer if the user does not wish to
-specify an address to be bound. Here, the value of \fIqlen\fR is assumed to be
-zero, and the transport provider will assign an address to the transport
-endpoint. Similarly, \fIret\fR may be a null pointer if the user does not care
+Similarly,
+.Fa ret
+may be a null pointer if the user does not care
what address was bound by the provider and is not interested in the negotiated
-value of \fIqlen\fR. It is valid to set \fIreq\fR and \fIret\fR to the null
-pointer for the same call, in which case the provider chooses the address to
-bind to the transport endpoint and does not return that information to the
-user.
-.sp
-.LP
-The \fIqlen\fR field has meaning only when initializing a connection-mode
-service. It specifies the number of outstanding connection indications that the
-transport provider should support for the given transport endpoint. An
-outstanding connection indication is one that has been passed to the transport
-user by the transport provider but which has not been accepted or rejected. A
-value of \fIqlen\fR greater than zero is only meaningful when issued by a
-passive transport user that expects other users to call it. The value of
-\fIqlen\fR will be negotiated by the transport provider and may be changed if
+value of
+.Sy qlen .
+It is valid to set
+.Fa req
+and
+.Fa ret
+to the null pointer for the same call, in which case the provider chooses the
+address to bind to the transport endpoint and does not return that information
+to the user.
+.Pp
+The
+.Sy qlen
+field has meaning only when initializing a connection-mode
+service.
+It specifies the number of outstanding connection indications that the
+transport provider should support for the given transport endpoint.
+An outstanding connection indication is one that has been passed to the
+transport user by the transport provider but which has not been accepted or
+rejected.
+A value of
+.Sy qlen
+greater than zero is only meaningful when issued by a
+passive transport user that expects other users to call it.
+The value of
+.Sy qlen
+will be negotiated by the transport provider and may be changed if
the transport provider cannot support the specified number of outstanding
-connection indications. However, this value of \fIqlen\fR will never be
-negotiated from a requested value greater than zero to zero. This is a
-requirement on transport providers; see \fBWARNINGS\fR below. On return, the
-\fIqlen\fR field in \fIret\fR will contain the negotiated value.
-.sp
-.LP
-If \fIfd\fR refers to a connection-mode service, this function allows more than
-one transport endpoint to be bound to the same protocol address. It is not
+connection indications.
+However, this value of
+.Sy qlen
+will never be negotiated from a requested value greater than zero to zero.
+This is a requirement on transport providers; see
+.Sx WARNINGS
+below.
+On return, the
+.Sy qlen
+field in
+.Fa ret
+will contain the negotiated value.
+.Pp
+If
+.Fa fd
+refers to a connection-mode service, this function allows more than
+one transport endpoint to be bound to the same protocol address.
+It is not
possible to bind more than one protocol address to the same transport endpoint.
-However, the transport provider must also support this capability. If a user
-binds more than one transport endpoint to the same protocol address, only one
-endpoint can be used to listen for connection indications associated with that
-protocol address. In other words, only one \fBt_bind()\fR for a given protocol
-address may specify a value of \fIqlen\fR greater than zero. In this way, the
+However, the transport provider must also support this capability.
+If a user binds more than one transport endpoint to the same protocol address,
+only one endpoint can be used to listen for connection indications associated
+with that protocol address.
+In other words, only one
+.Fn t_bind
+for a given protocol address may specify a value of
+.Sy qlen
+greater than zero.
+In this way, the
transport provider can identify which transport endpoint should be notified of
-an incoming connection indication. If a user attempts to bind a protocol
-address to a second transport endpoint with a value of \fIqlen\fR greater than
-zero, \fBt_bind()\fR will return -1 and set \fBt_errno\fR to \fBTADDRBUSY\fR.
+an incoming connection indication.
+If a user attempts to bind a protocol address to a second transport endpoint
+with a value of
+.Sy qlen
+greater than zero,
+.Fn t_bind
+will return -1 and set
+.Va t_errno
+to
+.Er TADDRBUSY .
When a user accepts a connection on the transport endpoint that is being used
as the listening endpoint, the bound protocol address will be found to be busy
-for the duration of the connection, until a \fBt_unbind\fR(3NSL) or
-\fBt_close\fR(3NSL) call has been issued. No other transport endpoints may be
-bound for listening on that same protocol address while that initial listening
-endpoint is active (in the data transfer phase or in the \fBT_IDLE\fR state).
-This will prevent more than one transport endpoint bound to the same protocol
-address from accepting connection indications.
-.sp
-.LP
-If \fIfd\fR refers to connectionless mode service, this function allows for
+for the duration of the connection, until a
+.Xr t_unbind 3NSL
+or
+.Xr t_close 3NSL
+call has been issued.
+No other transport endpoints may be bound for listening on that same protocol
+address while that initial listening endpoint is active (in the data transfer
+phase or in the
+.Sy T_IDLE
+state).
+This will prevent more than one transport endpoint bound to the same
+protocol address from accepting connection indications.
+.Pp
+If
+.Fa fd
+refers to connectionless mode service, this function allows for
more than one transport endpoint to be associated with a protocol address,
where the underlying transport provider supports this capability (often in
-conjunction with value of a protocol-specific option). If a user attempts to
-bind a second transport endpoint to an already bound protocol address when such
-capability is not supported for a transport provider, \fBt_bind()\fR will
-return -1 and set \fBt_errno\fR to \fBTADDRBUSY\fR.
-.SH RETURN VALUES
-.sp
-.LP
-Upon successful completion, a value of 0 is returned. Otherwise, a value of
--1 is returned and \fBt_errno\fR is set to indicate an error.
-.SH VALID STATES
-.sp
-.LP
-\fBT_UNBND\fR
-.SH ERRORS
-.sp
-.LP
-On failure, \fBt_errno\fR is set to one of the following:
-.sp
-.ne 2
-.na
-\fB\fBTACCES\fR\fR
-.ad
-.RS 13n
+conjunction with value of a protocol-specific option).
+If a user attempts to bind a second transport endpoint to an already bound
+protocol address when such capability is not supported for a transport provider,
+.Fn t_bind
+will
+return -1 and set
+.Va t_errno
+to
+.Er TADDRBUSY .
+.Sh RETURN VALUES
+Upon successful completion, a value of 0 is returned.
+Otherwise, a value of
+-1 is returned and
+.Va t_errno
+is set to indicate an error.
+.Sh VALID STATES
+.Sy T_UNBND
+.Sh ERRORS
+On failure,
+.Va t_errno
+is set to one of the following:
+.Bl -tag -width Er
+.It Er TACCES
The user does not have permission to use the specified address.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBTADDRBUSY\fR\fR
-.ad
-.RS 13n
+.It Er TADDRBUSY
The requested address is in use.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBTBADADDR\fR\fR
-.ad
-.RS 13n
+.It Er TBADADDR
The specified protocol address was in an incorrect format or contained illegal
information.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBTBADF\fR\fR
-.ad
-.RS 13n
+.It Er TBADF
The specified file descriptor does not refer to a transport endpoint.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBTBUFOVFLW\fR\fR
-.ad
-.RS 13n
-The number of bytes allowed for an incoming argument \fI(maxlen)\fR is greater
-than 0 but not sufficient to store the value of that argument. The provider's
-state will change to \fBT_IDLE\fR and the information to be returned in
-\fIret\fR will be discarded.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBTOUTSTATE\fR\fR
-.ad
-.RS 13n
-The communications endpoint referenced by \fIfd\fR is not in one of the states
-in which a call to this function is valid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBTNOADDR\fR\fR
-.ad
-.RS 13n
+.It Er TBUFOVFLW
+The number of bytes allowed for an incoming argument
+.Pa Sy maxlen
+is greater than 0 but not sufficient to store the value of that argument.
+The provider's state will change to
+.Sy T_IDLE
+and the information to be returned in
+.Fa ret
+will be discarded.
+.It Er TOUTSTATE
+The communications endpoint referenced by
+.Fa fd
+is not in one of the states in which a call to this function is valid.
+.It Er TNOADDR
The transport provider could not allocate an address.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBTPROTO\fR\fR
-.ad
-.RS 13n
+.It Er TPROTO
This error indicates that a communication problem has been detected between XTI
and the transport provider for which there is no other suitable XTI error
-\fB(t_errno)\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBTSYSERR\fR\fR
-.ad
-.RS 13n
+.Pq Va t_errno .
+.It Er TSYSERR
A system error has occurred during execution of this function.
-.RE
-
-.SH TLI COMPATIBILITY
-.sp
-.LP
-The \fBXTI\fR and \fBTLI\fR interface definitions have common names but use
-different header files. This, and other semantic differences between the two
-interfaces are described in the subsections below.
-.SS "Interface Header"
-.sp
-.LP
-The \fBXTI\fR interfaces use the header file, \fBxti.h\fR. \fBTLI\fR interfaces
-should \fInot\fR use this header. They should use the header:
-.sp
-.LP
-\fB#include\fR \fB<tiuser.h>\fR
-.SS "Address Bound"
-.sp
-.LP
-The user can compare the addresses in \fIreq\fR and \fIret\fR to determine
-whether the transport provider bound the transport endpoint to a different
-address than that requested.
-.SS "Error Description Values"
-.sp
-.LP
-The \fBt_errno\fR values \fBTPROTO\fR and \fBTADDRBUSY\fR can be set by the
-\fBXTI\fR interface but cannot be set by the \fBTLI\fR interface.
-.sp
-.LP
-A \fBt_errno\fR value that this routine can return under different
-circumstances than its \fBXTI\fR counterpart is \fBTBUFOVFLW\fR. It can be
-returned even when the \fBmaxlen\fR field of the corresponding buffer has been
-set to zero.
-.SH ATTRIBUTES
-.sp
-.LP
-See \fBattributes\fR(5) for descriptions of the following attributes:
-.sp
-
-.sp
-.TS
-box;
-c | c
-l | l .
-ATTRIBUTE TYPE ATTRIBUTE VALUE
-_
-MT Level Safe
-.TE
-
-.SH SEE ALSO
-.sp
-.LP
-\fBt_accept\fR(3NSL), \fBt_alloc\fR(3NSL), \fBt_close\fR(3NSL),
-\fBt_connect\fR(3NSL), \fBt_unbind\fR(3NSL), \fBattributes\fR(5)
-.SH WARNINGS
-.sp
-.LP
-The requirement that the value of \fIqlen\fR never be negotiated from a
-requested value greater than zero to zero implies that transport providers,
-rather than the XTI implementation itself, accept this restriction.
-.sp
-.LP
+.El
+.Sh TLI COMPATIBILITY
+The
+.Sy XTI
+and
+.Sy TLI
+interface definitions have common names but use different header files.
+This, and other semantic differences between the two interfaces are described
+in the subsections below.
+.Ss "Interface Header"
+The
+.Sy XTI
+interfaces use the header file,
+.In xti.h .
+.Sy TLI
+interfaces should
+.Em not
+use this header.
+They should use the header:
+.In tiuser.h
+.Ss "Address Bound"
+The user can compare the addresses in
+.Fa req
+and
+.Fa ret
+to determine whether the transport provider bound the transport endpoint to a
+different address than that requested.
+.Ss "Error Description Values"
+The
+.Va t_errno
+values
+.Er TPROTO
+and
+.Er TADDRBUSY
+can be set by the
+.Sy XTI
+interface but cannot be set by the
+.Sy TLI
+interface.
+.Pp
+A
+.Va t_errno
+value that this routine can return under different circumstances than its
+.Sy XTI
+counterpart is
+.Er TBUFOVFLW .
+It can be returned even when the
+.Sy maxlen
+field of the corresponding buffer has been set to zero.
+.Sh MT-LEVEL
+Safe
+.Sh SEE ALSO
+.Xr t_accept 3NSL ,
+.Xr t_alloc 3NSL ,
+.Xr t_close 3NSL ,
+.Xr t_connect 3NSL ,
+.Xr t_unbind 3NSL ,
+.Xr sockaddr 3SOCKET ,
+.Xr attributes 5
+.Sh WARNINGS
+The requirement that the value of
+.Sy qlen
+never be negotiated from a requested value greater than zero to zero implies
+that transport providers, rather than the XTI implementation itself, accept
+this restriction.
+.Pp
An implementation need not allow an application explicitly to bind more than
one communications endpoint to a single protocol address, while permitting more
-than one connection to be accepted to the same protocol address. That means
-that although an attempt to bind a communications endpoint to some address with
-\fIqlen=0\fR might be rejected with \fBTADDRBUSY\fR, the user may nevertheless
+than one connection to be accepted to the same protocol address.
+That means that although an attempt to bind a communications endpoint to some
+address with
+.Sy qlen=0
+might be rejected with
+.Er TADDRBUSY ,
+the user may nevertheless
use this (unbound) endpoint as a responding endpoint in a call to
-\fBt_accept\fR(3NSL). To become independent of such implementation differences,
-the user should supply unbound responding endpoints to \fBt_accept\fR(3NSL).
-.sp
-.LP
+.Xr t_accept 3NSL .
+To become independent of such implementation differences,
+the user should supply unbound responding endpoints to
+.Xr t_accept 3NSL .
+.Pp
The local address bound to an endpoint may change as result of a
-\fBt_accept\fR(3NSL) or \fBt_connect\fR(3NSL) call. Such changes are not
-necessarily reversed when the connection is released.
+.Xr t_accept 3NSL
+or
+.Xr t_connect 3NSL
+call.
+Such changes are not necessarily reversed when the connection is released.
diff --git a/usr/src/man/man3vnd/Makefile b/usr/src/man/man3vnd/Makefile
new file mode 100644
index 0000000000..64abf9dcd6
--- /dev/null
+++ b/usr/src/man/man3vnd/Makefile
@@ -0,0 +1,70 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet
+# at http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright (c) 2014, Joyent, Inc. All rights reserved.
+#
+
+include $(SRC)/Makefile.master
+
+MANSECT= 3vnd
+
+MANFILES= vnd_create.3vnd \
+ vnd_errno.3vnd \
+ vnd_frameio_read.3vnd \
+ vnd_pollfd.3vnd \
+ vnd_prop_get.3vnd \
+ vnd_prop_iter.3vnd \
+ vnd_prop_writeable.3vnd \
+ vnd_walk.3vnd
+
+MANLINKS= frameio_t.3vnd \
+ framevec_t.3vnd \
+ vnd_close.3vnd \
+ vnd_frameio_write.3vnd \
+ vnd_open.3vnd \
+ vnd_prop_set.3vnd \
+ vnd_prop_iter_f.3vnd \
+ vnd_strerror.3vnd \
+ vnd_strsyserror.3vnd \
+ vnd_syserrno.3vnd \
+ vnd_unlink.3vnd \
+ vnd_walk_cb_f.3vnd
+
+# vnd_create.3vnd
+vnd_open.3vnd := LINKSRC = vnd_create.3vnd
+vnd_unlink.3vnd := LINKSRC = vnd_create.3vnd
+vnd_close.3vnd := LINKSRC = vnd_create.3vnd
+
+# vnd_errno.3vnd
+vnd_strerror.3vnd := LINKSRC = vnd_errno.3vnd
+vnd_syserrno.3vnd := LINKSRC = vnd_errno.3vnd
+vnd_strsyserror.3vnd := LINKSRC = vnd_errno.3vnd
+
+# vnd_frameio_read.3vnd
+vnd_frameio_write.3vnd := LINKSRC = vnd_frameio_read.3vnd
+framevec_t.3vnd := LINKSRC = vnd_frameio_read.3vnd
+frameio_t.3vnd := LINKSRC = vnd_frameio_read.3vnd
+
+# vnd_prop_get.3vnd
+vnd_prop_set.3vnd := LINKSRC = vnd_prop_get.3vnd
+
+# vnd_prop_iter.3vnd
+vnd_prop_iter_f.3vnd := LINKSRC = vnd_prop_iter.3vnd
+
+# vnd_walk.3vnd
+vnd_walk_cb_f.3vnd := LINKSRC = vnd_walk.3vnd
+
+.KEEP_STATE:
+
+include $(SRC)/man/Makefile.man
+
+install: $(ROOTMANFILES) $(ROOTMANLINKS)
diff --git a/usr/src/man/man3vnd/vnd_create.3vnd b/usr/src/man/man3vnd/vnd_create.3vnd
new file mode 100644
index 0000000000..d29237a60c
--- /dev/null
+++ b/usr/src/man/man3vnd/vnd_create.3vnd
@@ -0,0 +1,280 @@
+'\" te
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
+.\"
+.TH VND_CREATE 3VND "Feb 21, 2014"
+
+.SH NAME
+
+vnd_create, vnd_open, vnd_unlink, vnd_close \- create, open, and destroy
+vnd devices
+
+.SH SYNOPSIS
+
+.LP
+.nf
+cc [ flag... ] file... -lvnd [ library... ]
+#include <libvnd.h>
+
+vnd_handle_t *vnd_create(const char *zonename, const char *datalink,
+ const char *linkname, vnd_errno_t *vnderr, int *syserr);
+
+vnd_handle_t *vnd_open(const char *zonename, const char *linkname,
+ vnd_errno_t *vnderr, int *syserr);
+
+int vnd_unlink(vnd_handle_t *vhp);
+
+void vnd_close(vnd_handle_t *vhp);
+.fi
+
+
+.SH DESCRIPTION
+.LP
+These functions create vnd devices, obtain handles to extant vnd
+devices, and close handles to vnd devices, for use with the rest of
+libvnd(3LIB).
+
+.LP
+The vnd_create function creates a new vnd device in the zone specified
+by zonename. The zone name argument may be null, in which case the
+caller's current zone is used instead. The vnd device and data link it
+is created over must both be in the same zone. The datalink argument
+indicates the name of the DLPI data link to create the vnd device over.
+The linkname argument indicates the name of the new vnd device. The
+linkname argument must be less than VND_NAMELEN characters long,
+excluding the null terminator. It should be an alphanumeric string. The
+only non-alphanumeric characters allowed are ':', '-', and \'_'.
+Neither the datalink argument nor linkname argument may be NULL. A
+handle to the created device is returned to the caller. Once the
+vnd_create function returns, the device can be subsequently opened with
+a call to vnd_open. The named device persists until a call to vnd_unlink
+or the containing zone is halted. Creating a vnd device requires
+PRIV_SYS_NET_CONFIG as well as PRIV_RAWACCESS. The arguments vnderr and
+syserr are used to obtain errors in the cases where the call to
+vnd_create fails. Both arguments may be NULL pointers, in which case the
+more detailed error information is discarded.
+
+.LP
+The vnd_open function opens an existing vnd device and returns a
+unique handle to that device. The vnd device to open is specified by
+both zonename and linkname. The zonename argument specifies what zone
+to look for the vnd device in. The linkname specifies the name of the
+link. The zonename argument may be NULL. If it is, the current zone is
+used. Similar to vnd_create, the integer values pointed to by the
+arguments vnderr and syserr will be filled in with additional error
+information in the cases where a call to vnd_open fails. Both
+arguments may be NULL to indicate that the error information is not
+requested, though this is not recommended.
+
+.LP
+The vnd_unlink function unlinks the vnd device specified by the vnd
+handle vhp. This unlink is similar to the use of unlink in a file
+system. After a call to unlink, the vnd device will no longer be
+accessible by callers to vnd_open and the name will be available for
+use in vnd_create. However, the device will continue to exist until
+all handles to the device have been closed.
+
+.LP
+The vnd_close function relinquishes the vnd device referenced by the
+handle vhp. After a call to vnd_close, the handle is invalidated and
+must not be used by the consumer again. The act of calling vnd_close
+on a handle does not remove the device. The device is persisted as
+long as vnd_unlink has not been called on the device or the containing
+zone has not been destroyed.
+
+.SH RETURN VALUES
+
+.LP
+Upon successful completion, the functions vnd_create and vnd_open
+return a pointer to a vnd_handle_t. This handle is used for all
+subsequent library operations. If either function fails, then a NULL
+pointer is returned and more detailed error information is filled into
+the integers pointed to by vnderr and syserr. The vnderr and syserr
+correspond to the values that would normally be returned by a call to
+vnd_errno(3VND) and vnd_syserrno(3VND). For the full list of possible
+errors see libvnd(3LIB).
+
+.LP
+The vnd_unlink function returns zero on success and -1 on failure. On
+failure, the vnd and system errnos are updated and available through
+the vnd_errno(3VND) and vnd_syserrno(3VND) functions.
+
+.LP
+The vnd_close function does not return any values nor does it set
+vnderr or syserr. The handle passed to vnd_close can no longer be
+used.
+
+.SH EXAMPLES
+.LP
+Example 1 Creating a device
+.sp
+.LP
+
+The following sample C program shows how to create a vnd device over
+an existing datalink named "net0" that other applications can open
+and use as "vnd0".
+
+.sp
+.in +2
+.nf
+#include <libvnd.h>
+#include <stdio.h>
+
+int
+main(void)
+{
+ vnd_handle_t *vhp;
+ vnd_errno_t vnderr;
+ int syserr;
+
+ /* Errors are considered fatal */
+ vhp = vnd_create(NULL, "net0", "vnd0", &vnderr, &syserr);
+
+ if (vhp == NULL) {
+ if (vnderr == VND_E_SYS)
+ (void) fprintf(stderr, "failed to create device: %s",
+ vnd_strsyserror(syserr));
+ else
+ (void) fprintf(stderr, "failed to create device: %s",
+ vnd_strerror(vnderr));
+ return (1);
+ }
+
+ (void) printf("successfully created vnd0\n");
+ vnd_close(vhp);
+ return (0);
+}
+.fi
+.in -2
+
+.LP
+Example 2 Opening an existing device in another zone
+.sp
+.LP
+
+The following sample C program opens the device named "vnd1" in the zone
+named "turin" for further use.
+
+.sp
+.in +2
+.nf
+#include <libvnd.h>
+#include <stdio.h>
+
+int
+main(void)
+{
+ vnd_handle_t *vhp;
+ vnd_errno_t vnderr;
+ int syserr, ret;
+
+ vhp = vnd_open("turin", "vnd1", &vnderr, &syserr);
+ if (vhp != NULL) {
+ if (vnderr == VND_E_SYS)
+ (void) fprintf(stderr, "failed to open device: %s",
+ vnd_strsyserror(syserr));
+ else
+ (void) fprintf(stderr, "failed to open device: %s",
+ vnd_strerror(vnderr));
+ return (1);
+ }
+
+ /*
+ * Use the device vnd1 with the handle vhp with any of
+ * the other interfaces documented in libvnd(3LIB) here.
+ *
+ * After an arbitrary amount of code, the program will
+ * set the variable ret with the exit code for the
+ * program and should execute the following code before
+ * returning.
+ */
+ vnd_close(vhp);
+ return (ret);
+}
+.fi
+.in -2
+
+
+.LP
+Example 3 Removing a device
+.sp
+.LP
+
+The following sample C program removes a vnd device named vnd0. This
+program makes it so no additional programs can access the device.
+However, if anyone is actively using it, it will still exist,
+similar to calling unlink(2).
+
+.sp
+.in +2
+.nf
+#include <libvnd.h>
+#include <stdio.h>
+
+int
+main(void)
+{
+ vnd_handle_t *vhp;
+ vnd_errno_t vnderr;
+ int syserr, ret;
+
+ vhp = vnd_open(NULL, "vnd0", &vnderr, &syserr);
+ if (vhp != NULL) {
+ if (vnderr == VND_E_SYS)
+ (void) fprintf(stderr, "failed to open device: %s",
+ vnd_strsyserror(syserr));
+ else
+ (void) fprintf(stderr, "failed to open device: %s",
+ vnd_strerror(vnderr));
+ return (1);
+ }
+
+ if (vnd_unlink(vhp) != 0) {
+ if (vnderr == VND_E_SYS)
+ (void) fprintf(stderr, "failed to unlink device: %s",
+ vnd_strsyserror(syserr));
+ else
+ (void) fprintf(stderr, "failed to unlink device: %s",
+ vnd_strerror(vnderr));
+ ret = 1;
+ } else {
+ (void) printf("successfully unlinked vnd0!\n");
+ ret = 0;
+ }
+
+ vnd_close(vhp);
+ return (ret);
+}
+.fi
+.in -2
+
+.SH ATTRIBUTES
+.sp
+.LP
+See attributes(5) for descriptions of the following attributes:
+
+.sp
+.TS
+box;
+c | c
+l | l .
+ATTRIBUTE TYPE ATTRIBUTE VALUE
+_
+Stability Committed
+_
+MT-Level See "THREADING" in libvnd(3LIB)
+.TE
+
+.SH SEE ALSO
+
+libvnd(3LIB), vnd_errno(3VND), vnd_syserrno(3VND), attributes(5), privileges(5)
diff --git a/usr/src/man/man3vnd/vnd_errno.3vnd b/usr/src/man/man3vnd/vnd_errno.3vnd
new file mode 100644
index 0000000000..ddd6126dd1
--- /dev/null
+++ b/usr/src/man/man3vnd/vnd_errno.3vnd
@@ -0,0 +1,170 @@
+'\" te
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
+.\"
+.TH VND_ERRNO 3VND "Feb 21, 2014"
+
+.SH NAME
+
+vnd_errno, vnd_syserrno, vnd_strerror, vnd_strsyserror \- obtain and
+translate vnd errors
+
+
+.SH SYNOPSIS
+
+.LP
+.nf
+cc [ flag... ] file... -lvnd [ library... ]
+#include <libvnd.h>
+
+uint32_t vnd_errno(vnd_handle_t *vhp);
+
+const char *vnd_strerror(vnd_errno_t err);
+
+int vnd_syserrno(vnd_handle_t *vhp);
+
+const char *vnd_strsyserror(int syserr);
+.fi
+
+.SH DESCRIPTION
+
+.LP
+The libvnd(3LIB) library supports a complementary array of errors that
+give more specific error information than the traditional set of
+system errors available via errno(3C). When an error occurs, consumers
+should call the vnd_errno function first and check its value. If the
+value of the vnd_errno_t is VND_E_SYS, then the system errno should be
+checked. If the vnd_errno_t is not VND_E_SYS, then the contents of the
+system errno returned from vnd_syserrno are undefined. Both the vnd
+and system errors are only valid for a given handle after a libvnd
+library function returned an error and before another libvnd library
+function is called on the same handle. The act of making an additional
+function call with the same vnd_handle_t invalidates any prior vnd or
+system error numbers. For the full list of valid vnd errors see
+libvnd(3LIB). For the full list of valid system errors, see Intro(2).
+
+.LP
+The vnd_errno and vnd_syserrno functions retrieve the most recent vnd
+and syserr error number respectively from a vnd handle vhp.
+
+.LP
+The vnd_strerror function translates a vnd_errno_t err to a
+corresponding string and returns a pointer to that constant string.
+
+.LP
+The vnd_syserrno function is analogous to the vnd_strerror function,
+except that it translates a system error back to a string.
+
+
+.SH RETURN VALUES
+
+.LP
+The vnd_errno function returns a vnd_errno_t which contains the vnd
+error information.
+
+.LP
+The vnd_syserror function returns an integer which contains the system
+error information. These values are the same as those returned by
+errno(3C).
+
+.LP
+The vnd_strerror function returns a pointer to a constant string. If
+the error passed in is unknown, the string "unknown error" is
+returned.
+
+.LP
+The vnd_strsyserror function returns a pointer to the translated
+constant string. If an unknown error number is passed, it returns the
+string "Unknown error". If an error occurs, it returns a NULL pointer.
+
+.SH EXAMPLES
+
+.LP
+Example 1 Obtaining errors from a vnd_handle_t
+
+.sp
+.LP
+The following sample C function, which can be incorporated into a larger
+program, shows how to obtain the vnd and system errors from a
+vnd_handle_t after a vnd interface on a handle failed.
+
+.sp
+.in +2
+.nf
+#include <libvnd.h>
+
+static void
+print_errnos(vnd_handle_t *vhp)
+{
+ vnd_errno_t vnderr;
+ int syserr;
+
+ vnderr = vnd_errno(vhp);
+ syserr = vnd_syserrno(vhp);
+
+ (void) printf("vnd err: %d, sys err: %d\n",
+ vnderr, syserr);
+}
+.fi
+.in -2
+
+.LP
+Example 2 A perror-like function
+
+.sp
+.LP
+The following sample C function which can be incorporated into a
+larger program shows how to write a perror-like function to print
+out error messages for a vnd device.
+
+.sp
+.in +2
+.nf
+#include <libvnd.h>
+
+static void
+sample_perror(const char *msg, vnd_error_t vnderr, int syserr)
+{
+ (void) fprintf(stderr, "%s: %s", msg,
+ vnderr != VND_E_SYS ? vnd_strerror(vnderr) :
+ vnd_strsyserror(syserr));
+}
+.fi
+.in -2
+
+.SH ATTRIBUTES
+.sp
+.LP
+See attributes(5) for descriptions of the following attributes:
+
+.sp
+.TS
+box;
+c | c
+l | l .
+ATTRIBUTE TYPE ATTRIBUTE VALUE
+_
+Stability Committed
+_
+MT-Level See below
+.TE
+
+.LP
+The MT-Level of the functions vnd_strerror and vnd_strsyserror is
+MT-Safe. See "THREADING" in libvnd(3LIB) for a discussion of the
+MT-Level of vnd_errno and vnd_syserrno.
+
+
+.SH SEE ALSO
+
+Intro(2), errno(3C), libvnd(3LIB), attributes(5)
diff --git a/usr/src/man/man3vnd/vnd_frameio_read.3vnd b/usr/src/man/man3vnd/vnd_frameio_read.3vnd
new file mode 100644
index 0000000000..5fc65c96a3
--- /dev/null
+++ b/usr/src/man/man3vnd/vnd_frameio_read.3vnd
@@ -0,0 +1,705 @@
+'\" te
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
+.\"
+.TH VND_FRAMEIO_READ 3VND "Mar 06, 2014"
+
+.SH NAME
+
+vnd_frameio_read, vnd_frameio_write \- perform framed I/O to a vnd device
+
+.SH SYNOPSIS
+
+.LP
+.nf
+cc [ flag... ] file... -lvnd [ library... ]
+#include <libvnd.h>
+
+int vnd_frameio_read(vnd_handle_t *vhp, frameio_t *fiop);
+
+int vnd_frameio_write(vnd_handle_t *vhp, frameio_t *fiop);
+.fi
+
+.SH DESCRIPTION
+.LP
+Framed I/O is a general means to manipulate data that is inherently
+framed, meaning that there is a maximum frame size, but the data may
+often be less than that size. As an example, an Ethernet device's MTU
+describes the maximum frame size, but the size of an individual frame
+is often much less. You can read a single frame at a time, or you can
+read multiple frames in a single call.
+
+In addition, framed I/O allows the consumer to break individual frames
+into a series of vectors. This is analogous to the use of an iovec(9S)
+with readv(2) and writev(2).
+
+vnd_frameio_read performs a framed I/O read of the device represented by
+the handle vhp, with the framed I/O data described by fiop.
+vnd_frameio_write works in the same manner, except performing a write
+instead of a read.
+
+.LP
+The basic vector component of the frameio_t is the framevec_t. Each
+framevec_t represents a single vector entry. An array of these is
+present in the frameio_t. The framevec_t structure has the following
+members:
+
+.in +2
+.nf
+void *fv_buf /* data buffer */
+size_t fv_buflen; /* total size of buffer */
+size_t fv_actlen; /* amount of buffer consumed */
+.fi
+.in -2
+
+.LP
+The fv_buf member points to a buffer which contains the data for this
+individual vector. When reading, data is consumed from fv_buf. When
+writing, data is written into fv_buf.
+
+The fv_buflen should indicate the total amount of data that is in the
+buffer. When reading, it indicates the size of the buffer. It must be
+set prior to calling vnd_frameio_read(). When writing, it indicates the
+amount of data that is valid in the buffer.
+
+The fv_actlen is a read-only member. It is set on successful return of
+the functions vnd_frameio_read and vnd_frameio_write. When reading, it
+is updated with the amount of data that was read into fv_buf. When
+writing, it is instead updated with the amount of data from fv_buf that
+was actually consumed. Generally when writing data, a framevec_t will
+either be entirely consumed or it will not be consumed at all.
+
+
+.LP
+A series of framevec_t's is encapsulated in a frameio_t. The frameio_t
+structure has the following members:
+
+.in +2
+.nf
+uint_t fio_version; /* current version */
+uint_t fio_nvpf; /* number of vectors in one frame */
+uint_t fio_nvecs; /* The total number of vectors */
+framevec_t fio_vecs[]; /* vectors */
+.fi
+.in -2
+
+.LP
+The fio_version member represents the current version of the frameio_t.
+The fio_version should be set to the macro FRAMEIO_CURRENT_VERSION,
+which is currently 1.
+
+The members fio_nvpf and fio_nvecs describe the number of frames that
+exist. fio_nvecs describes the total number of vectors that are present
+in fio_vecs. The upper bound on this is described by FRAMEIO_NVECS_MAX
+which is currently 32. fio_nvpf describe the number of vectors that
+should be used to make up each frame. By setting fio_vecs to be an even
+multiple of fio_nvpf, multiple frames can be read or written in a single
+call.
+
+After a call to vnd_frameio_read or vnd_frameio_write fio_nvecs is
+updated with total number of vectors read or written to. This value can
+be divided by fio_nvpf to determine the total number of frames that were
+written or read.
+
+.LP
+Each frame can be broken down into a series of multiple vectors. As an
+example, someone might want to break Ethernet frames into mac headers
+and payloads. The value of fio_nvpf would be set to two, to indicate
+that a single frame consists of two different vector components. The
+member fio_nvecs describes the total number of frames. As such, the
+value of fio_vecs divided by fio_nvpf describes the total number of
+frames that can be consumed in one call. As a result of this, fio_nvpf
+must evenly divide fio_vecs. If fio_nvpf is set to two and
+fio_nvecs is set to ten, then a total of five frames can be processed
+at once, each frame being broken down into two different vector
+components.
+
+A given frame will never overflow the number of vectors described by
+fio_nvpf. Consider the case where each vector component has a buffer
+sized to 1518 bytes, fio_nvpf is set to one, and fio_nvecs is set to
+three. If a call to vnd_frameio_read is made and four 500 byte Ethernet
+frames come in, then each frame will be mapped to a single vector. The
+500 bytes will be copied into fio_nvecs[i]->fio_buf and
+fio_nvecs[i]->fio_actlen will be set to 500. To contrast this, if
+readv(2) had been called, the first three frames would all be in the
+first iov and the fourth frame's first eight bytes would be in the first
+iov and the remaining in the second.
+
+.LP
+The user must properly initialize fio_nvecs framevec_t's worth of the
+fio_vecs array. When multiple vectors comprise a frame, fv_buflen data
+is consumed before moving onto the next vector. Consider the case
+where the user wants to break a vector into three different
+components, an 18 byte vector for an Ethernet VLAN header, a 20 byte
+vector for an IPv4 header, and a third 1500 byte vector for the
+remaining payload. If a frame was received that only had 30 bytes,
+then the first 18 bytes would fill up the first vector, the remaining
+12 bytes would fill up the IPv4 header. If instead a 524 byte frame
+came in, then the first 18 bytes would be placed in the first vector,
+the next 24 bytes would be placed in the next vector, and the remaining
+500 bytes in the third.
+
+.LP
+The functions vnd_frameio_read and vnd_frameio_write operate in both
+blocking and non-blocking mode. If either O_NONBLOCK or O_NDELAY have
+been set on the file descriptor, then the I/O will behave in
+non-blocking mode. When in non-blocking mode, if no data is available
+when vnd_frameio_read is called, EAGAIN is returned. When
+vnd_frameio_write is called in non-blocking mode, if sufficient buffer
+space to hold all of the output frames is not available, then
+vnd_frameio_write will return EAGAIN. To know when the given vnd device
+has sufficient space, the device fires POLLIN/POLLRDNORM when data is
+available for read and POLLOUT/POLLRDOUT when space in the buffer has
+opened up for write. These events can be watched for through
+port_associate(3C) and similar routines with a file descriptor returned
+from vnd_polfd(3VND).
+
+.LP
+When non-blocking mode is disabled, calls to vnd_frameio_read will
+block until some amount of data is available. Calls to
+vnd_frameio_write will block until sufficient buffer space is
+available.
+
+.LP
+Similar to read(2) and write(2), vnd_frameio_read and
+vnd_frameio_write make no guarantees about the ordering of data when
+multiple threads simultaneously call the interface. While the data
+itself will be atomic, the ordering of multiple simultaneous calls is
+not defined.
+
+.SH RETURN VALUES
+
+.LP
+The vnd_frameio_read function returns zero on success. The member
+fio_nvecs of fiop is updated with the total number of vectors that had
+data read into them. Each updated framevec_t will have the buffer
+pointed to by fv_buf filled in with data, and fv_actlen will be
+updated with the amount of valid data in fv_buf.
+
+.LP
+The vnd_frameio_write function returns zero on success. The member
+fio_nvecs of fiop is updated with the total number of vectors that
+were written out to the underlying datalink. The fv_actlen of each
+vector is updated to indicate the amount of data that was written from
+that buffer.
+
+.LP
+On failure, both vnd_frameio_read and vnd_frameio_write return -1. The
+vnd and system error numbers are updated and available via
+vnd_errno(3VND) and vnd_syserrno(3VND). See ERRORS below for a list of
+errors and their meaning.
+
+
+.SH ERRORS
+.LP
+The functions vnd_frameio_read and vnd_frameio_write always set the
+vnd error to VND_E_SYS. The following system errors will be
+encountered:
+
+.sp
+.ne 2
+.na
+EAGAIN
+.ad
+.RS 10n
+Insufficient system memory was available for the operation.
+.sp
+Non-blocking mode was enabled and during the call to vnd_frameio_read,
+no data was available. Non-blocking mode was enabled and during the call
+to vnd_frameio_write, insufficient buffer space was available.
+.RE
+
+.sp
+.ne 2
+.na
+ENXIO
+.ad
+.RS 10n
+The vnd device referred to by vhp is not currently attached to an
+underlying data link and cannot send data.
+.RE
+
+.sp
+.ne 2
+.na
+EFAULT
+.ad
+.RS 10n
+The fiop argument points to an illegal address or the fv_buf members of
+the framevec_t's associated with the fiop member fio_vecs point to
+illegal addresses.
+.RE
+
+.sp
+.ne 2
+.na
+EINVAL
+.ad
+.RS 10n
+The fio_version member of fiop was unknown, the number of vectors
+specified by fio_nvecs is zero or greater than FRAMEIO_NVECS_MAX,
+fio_nvpf equals zero, fio_nvecs is not evenly divisible by fio_nvpf, or
+a buffer in fio_vecs[] has set fv_buf or fv_buflen to zero.
+.RE
+
+
+.sp
+.ne 2
+.na
+EINTR
+.ad
+.RS 10n
+A signal was caught during vnd_frameio_read or vnd_frameio_write, and no
+data was transferred.
+.RE
+
+
+.sp
+.ne 2
+.na
+EOVERFLOW
+.ad
+.RS 10n
+During vnd_frameio_read, the size of a frame specified by fiop->fio_nvpf
+and fiop->fio_vecs[].fv_buflen cannot contain a frame.
+.sp
+In a ILP32 environment, more data than UINT_MAX would be set in
+fv_actlen.
+.RE
+
+
+.sp
+.ne 2
+.na
+ERANGE
+.ad
+.RS 10n
+During vnd_frameio_write, the size of a frame is less than the device's
+minimum transmission unit or it is larger than the size of the maximum
+transmission unit.
+.RE
+
+
+.SH EXAMPLES
+
+.LP
+Example 1 Read a single frame with a single vector
+
+.sp
+.LP
+The following sample C program opens an existing vnd device named
+"vnd0" in the current zone and performs a blocking read of a single
+frame from it.
+
+.sp
+.in +2
+.nf
+#include <libvnd.h>
+#include <stdio.h>
+
+int
+main(void)
+{
+ vnd_handle_t *vhp;
+ vnd_errno_t vnderr;
+ int syserr, i;
+ frameio_t *fiop;
+
+ fiop = malloc(sizeof (frameio_t) + sizeof (framevec_t));
+ if (fiop == NULL) {
+ perror("malloc frameio_t");
+ return (1);
+ }
+ fiop->fio_version = FRAMEIO_CURRENT_VERSION;
+ fiop->fio_nvpf = 1;
+ fiop->fio_nvecs = 1;
+ fiop->fio_vecs[0].fv_buf = malloc(1518);
+ fiop->fio_vecs[0].fv_buflen = 1518;
+ if (fiop->fio_vecs[0].fv_buf == NULL) {
+ perror("malloc framevec_t.fv_buf");
+ free(fiop);
+ return (1);
+ }
+
+ vhp = vnd_open(NULL, "vnd1", &vnderr, &syserr);
+ if (vhp != NULL) {
+ if (vnderr == VND_E_SYS)
+ (void) fprintf(stderr, "failed to open device: %s",
+ vnd_strsyserror(syserr));
+ else
+ (void) fprintf(stderr, "failed to open device: %s",
+ vnd_strerror(vnderr));
+ free(fiop->fio_vecs[0].fv_buf);
+ free(fiop);
+ return (1);
+ }
+
+ if (frameio_read(vhp, fiop) != 0) {
+ vnd_errno_t vnderr = vnd_errno(vhp);
+ int syserr = vnd_syserrno(vhp);
+
+ /* Most consumers should retry on EINTR */
+ if (vnderr == VND_E_SYS)
+ (void) fprintf(stderr, "failed to read: %s",
+ vnd_strsyserror(syserr));
+ else
+ (void) fprintf(stderr, "failed to read: %s",
+ vnd_strerror(vnderr));
+ vnd_close(vhp);
+ free(fiop->fio_vecs[0].fv_buf);
+ free(fiop);
+ return (1);
+ }
+
+
+ /* Consume the data however it's desired */
+ (void) printf("received %d bytes\n", fiop->fio_vecs[0].fv_actlen);
+ for (i = 0; i < fiop->fio_vecs[0].fv_actlen)
+ (void) printf("%x ", fiop->fio_vecs[0].fv_buf[i]);
+
+ vnd_close(vhp);
+ free(fiop->fio_vecs[0].fv_buf);
+ free(viop);
+ return (0);
+}
+.fi
+.in -2
+
+.LP
+Example 2 Write a single frame with a single vector
+.sp
+.LP
+The following sample C program opens an existing vnd device named
+"vnd0" in the current zone and performs a blocking write of a single
+frame to it.
+
+.sp
+.in +2
+.nf
+#include <libvnd.h>
+#include <stdio.h>
+#include <string.h>
+
+int
+main(void)
+{
+ vnd_handle_t *vhp;
+ vnd_errno_t vnderr;
+ int syserr;
+ frameio_t *fiop;
+
+ fiop = malloc(sizeof (frameio_t) + sizeof (framevec_t));
+ if (fiop == NULL) {
+ perror("malloc frameio_t");
+ return (1);
+ }
+ fiop->fio_version = FRAMEIO_CURRENT_VERSION;
+ fiop->fio_nvpf = 1;
+ fiop->fio_nvecs = 1;
+ fiop->fio_vecs[0].fv_buf = malloc(1518);
+ if (fiop->fio_vecs[0].fv_buf == NULL) {
+ perror("malloc framevec_t.fv_buf");
+ free(fiop);
+ return (1);
+ }
+
+ /*
+ * Fill in your data however you desire. This is an entirely
+ * invalid frame and while the frameio write may succeed, the
+ * networking stack will almost certainly drop it.
+ */
+ (void) memset(fiop->fio_vecs[0].fv_buf, 'r', 1518);
+ fiop->fio_vecs[0].fv_buflen = 1518;
+
+ vhp = vnd_open(NULL, "vnd0", &vnderr, &syserr);
+ if (vhp != NULL) {
+ if (vnderr == VND_E_SYS)
+ (void) fprintf(stderr, "failed to open device: %s",
+ vnd_strsyserror(syserr));
+ else
+ (void) fprintf(stderr, "failed to open device: %s",
+ vnd_strerror(vnderr));
+ free(fiop->fio_vecs[0].fv_buf);
+ free(fiop);
+ return (1);
+ }
+
+ if (frameio_write(vhp, fiop) != 0) {
+ /* Most consumers should retry on EINTR */
+ if (vnderr == VND_E_SYS)
+ (void) fprintf(stderr, "failed to write: %s",
+ vnd_strsyserror(syserr));
+ else
+ (void) fprintf(stderr, "failed to write: %s",
+ vnd_strerror(vnderr));
+ vnd_close(vhp);
+ free(fiop->fio_vecs[0].fv_buf);
+ free(fiop);
+ return (1);
+ }
+
+
+ (void) printf("wrote %d bytes\n", fiop->fio_vecs[0].fv_actlen);
+
+ vnd_close(vhp);
+ free(fiop->fio_vecs[0].fv_buf);
+ free(viop);
+ return (0);
+}
+.fi
+.in -2
+
+.LP
+Example 3 Read frames comprised of multiple vectors
+.sp
+.LP
+The following sample C program is similar to example 1, except instead
+of reading a single frame consisting of a single vector it reads
+multiple frames consisting of two vectors. The first vector has room for
+an 18 byte VLAN enabled Ethernet header and the second vector has room
+for a 1500 byte payload.
+
+.sp
+.in +2
+.nf
+#include <libvnd.h>
+#include <stdio.h>
+
+int
+main(void)
+{
+ vnd_handle_t *vhp;
+ vnd_errno_t vnderr;
+ int syserr, i, nframes;
+ frameio_t *fiop;
+
+ /* Allocate enough framevec_t's for 5 frames */
+ fiop = malloc(sizeof (frameio_t) + sizeof (framevec_t) * 10);
+ if (fiop == NULL) {
+ perror("malloc frameio_t");
+ return (1);
+ }
+ fiop->fio_version = FRAMEIO_CURRENT_VERSION;
+ fiop->fio_nvpf = 2;
+ fiop->fio_nvecs = 10;
+ for (i = 0; i < 10; i += 2) {
+ fiop->fio_vecs[i].fv_buf = malloc(18);
+ fiop->fio_vecs[i].fv_buflen = 18;
+ if (fiop->fio_vecs[i].fv_buf == NULL) {
+ perror("malloc framevec_t.fv_buf");
+ /* Perform appropriate memory cleanup */
+ return (1);
+ }
+ fiop->fio_vecs[i+1].fv_buf = malloc(1500);
+ fiop->fio_vecs[i+1].fv_buflen = 1500;
+ if (fiop->fio_vecs[i+1].fv_buf == NULL) {
+ perror("malloc framevec_t.fv_buf");
+ /* Perform appropriate memory cleanup */
+ return (1);
+ }
+ }
+
+ vhp = vnd_open(NULL, "vnd1", &vnderr, &syserr);
+ if (vhp != NULL) {
+ if (vnderr == VND_E_SYS)
+ (void) fprintf(stderr, "failed to open device: %s",
+ vnd_strsyserror(syserr));
+ else
+ (void) fprintf(stderr, "failed to open device: %s",
+ vnd_strerror(vnderr));
+ /* Perform appropriate memory cleanup */
+ return (1);
+ }
+
+ if (frameio_read(vhp, fiop) != 0) {
+ /* Most consumers should retry on EINTR */
+ if (vnderr == VND_E_SYS)
+ (void) fprintf(stderr, "failed to read: %s",
+ vnd_strsyserror(syserr));
+ else
+ (void) fprintf(stderr, "failed to read: %s",
+ vnd_strerror(vnderr));
+ vnd_close(vhp);
+ /* Perform appropriate memory cleanup */
+ return (1);
+ }
+
+ /* Consume the data however it's desired */
+ nframes = fiop->fio_nvecs / fiop->fio_nvpf;
+ (void) printf("consumed %d frames!\n", nframes);
+ for (i = 0; i < nframes; i++) {
+ (void) printf("received %d bytes of Ethernet Header\n",
+ fiop->fio_vecs[i].fv_actlen);
+ (void) printf("received %d bytes of payload\n",
+ fiop->fio_vecs[i+1].fv_actlen);
+ }
+
+ vnd_close(vhp);
+ /* Do proper memory cleanup */
+ return (0);
+}
+.fi
+.in -2
+
+.LP
+Example 4 Perform non-blocking reads of multiple frames with a
+single vector
+.sp
+.LP
+In this sample C program, opens an existing vnd device named "vnd0" in
+the current zone, ensures that it is in non-blocking mode, and uses
+event ports to do device reads.
+
+.sp
+.in +2
+.nf
+#include <libvnd.h>
+#include <stdio.h>
+#include <port.h>
+#include <unistd.h>
+#include <errno.h>
+#include <sys/tpyes.h>
+#include <fcntl.h>
+
+int
+main(void)
+{
+ vnd_handle_t *vhp;
+ vnd_errno_t vnderr;
+ int syserr, i, nframes, port, vfd;
+ frameio_t *fiop;
+
+ port = port_create();
+ if (port < 0) {
+ perror("port_create");
+ return (1);
+ }
+ /* Allocate enough framevec_t's for 10 frames */
+ fiop = malloc(sizeof (frameio_t) + sizeof (framevec_t) * 10);
+ if (fiop == NULL) {
+ perror("malloc frameio_t");
+ (void) close(port);
+ return (1);
+ }
+ fiop->fio_version = FRAMEIO_CURRENT_VERSION;
+ fiop->fio_nvpf = 1;
+ fiop->fio_nvecs = 10;
+ for (i = 0; i < 10; i++) {
+ fiop->fio_vecs[i].fv_buf = malloc(1518);
+ fiop->fio_vecs[i].fv_buflen = 1518;
+ if (fiop->fio_vecs[i].fv_buf == NULL) {
+ perror("malloc framevec_t.fv_buf");
+ /* Perform appropriate memory cleanup */
+ (void) close(port);
+ return (1);
+ }
+ }
+
+ vhp = vnd_open(NULL, "vnd1", &vnderr, &syserr);
+ if (vhp != NULL) {
+ if (vnderr == VND_E_SYS)
+ (void) fprintf(stderr, "failed to open device: %s",
+ vnd_strsyserror(syserr));
+ else
+ (void) fprintf(stderr, "failed to open device: %s",
+ vnd_strerror(vnderr));
+ /* Perform appropriate memory cleanup */
+ (void) close(port);
+ return (1);
+ }
+ vfd = vnd_pollfd(vhp);
+ if (fcntl(fd, F_SETFL, O_NONBLOCK) != 0) {
+ (void) fprintf(stderr, "failed to enable non-blocking mode: %s",
+ strerrror(errno));
+ }
+
+ for (;;) {
+ port_event_t pe;
+
+ if (port_associate(port, PORT_SOURCE_FD, vfd, POLLIN,
+ vhp) != 0) {
+ perror("port_associate");
+ vnd_close(vhp);
+ /* Perform appropriate memory cleanup */
+ (void) close(port);
+ return (1);
+ }
+
+ if (port_get(port, &pe, NULL) != 0) {
+ if (errno == EINTR)
+ continue;
+ perror("port_associate");
+ vnd_close(vhp);
+ /* Perform appropriate memory cleanup */
+ (void) close(port);
+ return (1);
+ }
+
+ /*
+ * Most real applications will need to compare the file
+ * descriptor and switch on it. In this case, assume
+ * that the fd in question that is readable is 'vfd'.
+ */
+ if (frameio_read(pe.portev_user, fiop) != 0) {
+ vnd_errno_t vnderr = vnd_errno(vhp);
+ int syserr = vnd_syserrno(vhp);
+
+ if (vnderr == VND_E_SYS && (syserr == EINTR ||
+ syserr == EAGAIN))
+ continue;
+ (void) fprintf(stderr, "failed to get read: %s",
+ vnd_strsyserror(vnderr));
+ vnd_close(vhp);
+ /* Perform appropriate memory cleanup */
+ (void) close(port);
+ return (1);
+ }
+
+ /* Consume the data however it's desired */
+ nframes = fiop->fio_nvecs / fiop->fio_nvpf;
+ for (i = 0; i < nframes; i++) {
+ (void) printf("frame %d is %d bytes large\n", i,
+ fiop->fio_vecs[i].fv_actlen);
+ }
+
+ }
+
+ vnd_close(vhp);
+ /* Do proper memory cleanup */
+ return (0);
+}
+.fi
+.in -2
+
+.SH ATTRIBUTES
+.LP
+See attributes(5) for descriptions of the following attributes:
+
+.sp
+.TS
+box;
+c | c
+l | l .
+ATTRIBUTE TYPE ATTRIBUTE VALUE
+_
+Stability Committed
+_
+MT-Level See "THREADING" in libvnd(3LIB)
+.TE
+
+
+.SH SEE ALSO
+
+Intro(2), getmsg(2), read(2), readv(2), write(2), writev(2),
+libvnd(3VND), vnd_errno(3VND), vnd_pollfd(3VND), vnd_syserrno(3VND),
+iovec(9S)
diff --git a/usr/src/man/man3vnd/vnd_pollfd.3vnd b/usr/src/man/man3vnd/vnd_pollfd.3vnd
new file mode 100644
index 0000000000..500d3bac99
--- /dev/null
+++ b/usr/src/man/man3vnd/vnd_pollfd.3vnd
@@ -0,0 +1,155 @@
+'\" te
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
+.\"
+.TH VND_POLLFD 3VND "Feb 21, 2014"
+
+.SH NAME
+
+vnd_pollfd \- get file descriptor for polling
+
+.SH SYNOPSIS
+
+.LP
+.nf
+cc [ flag... ] file... -lvnd [ library... ]
+#include <libvnd.h>
+
+int vnd_pollfd(vnd_handle_t *vhp);
+.fi
+
+.SH DESCRIPTION
+.LP
+The vnd_pollfd() function returns an integer id which corresponds to
+the file descriptor that represents the underlying device that is
+associated with the vnd handle vhp. This file descriptor is suitable
+for use with port_associate(3C) and similar polling techniques such as
+poll(2). Use of the file descriptor outside of these uses may cause
+undocumented behavior from the rest of the library.
+
+.LP
+The file descriptor in question is still managed by libvnd. The caller
+must not call close(2) on it. Once vnd_close(3VND) has been called,
+any further use of the file descriptor is undefined behavior.
+
+
+.SH RETURN VALUES
+.LP
+The function returns the integer id of the file descriptor that
+corresponds to the underlying vnd device.
+
+.SH EXAMPLES
+
+.LP
+Example 1 Use event ports for vnd notifications
+.sp
+.LP
+The following sample C program shows how to use the vnd_pollfd
+function with event ports to be notified whenever there is data
+available to be read. This program assumes that a vnd device named
+"vnd0" exists in the current zone. For an example of creating the
+device, see Example 1 in vnd_create(3VND).
+
+.sp
+.in +2
+.nf
+#include <libvnd.h>
+#include <port.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+int
+main(void)
+{
+ vnd_handle_t *vhp;
+ vnd_errno_t vnderr;
+ int port, syserr, vfd, ret;
+
+ port = port_create();
+ if (port < 0) {
+ perror("port_create");
+ return (1);
+ }
+
+ vhp = vnd_open(NULL, "vnd0", &vnderr, &syserr);
+ if (vhp == NULL) {
+ if (vnderr == VND_E_SYS)
+ (void) fprintf(stderr, "failed to open device: %s",
+ vnd_strsyserror(syserr));
+ else
+ (void) fprintf(stderr, "failed to open device: %s",
+ vnd_strerror(vnderr));
+ (void) close(port);
+ return (1);
+ }
+
+ vfd = vnd_pollfd(vhp);
+ if (fcntl(vfd, F_SETFL, O_NONBLOCK) != 0) {
+ perror("fcntl");
+ vnd_close(vhp);
+ (void) close(port);
+ return (1);
+ }
+
+ if (port_associate(port, PORT_SOURCE_FD, vfd, POLLIN, NULL) != 0) {
+ perror("port_associate");
+ vnd_close(vhp);
+ (void) close(port);
+ return (1);
+ }
+
+ for (;;) {
+ port_event_t pe;
+
+
+ if (port_get(port, &pe, NULL) != 0) {
+ if (errno == EINTR)
+ continue;
+ perror("port_get");
+ vnd_close(vhp);
+ (void) close(port);
+ return (1);
+ }
+
+ /*
+ * Read the data with vnd_frameio_read(3VND) and
+ * optionally break out of the loop or continue to the
+ * next iteration and reassociate vfd with the event
+ * port.
+ */
+ }
+}
+.fi
+.in -2
+
+.SH ATTRIBUTES
+.sp
+.LP
+See attributes(5) for descriptions of the following attributes:
+
+.sp
+.TS
+box;
+c | c
+l | l .
+ATTRIBUTE TYPE ATTRIBUTE VALUE
+_
+Stability Committed
+_
+MT-Level See "THREADING" in libvnd(3LIB)
+.TE
+
+.SH SEE ALSO
+
+close(2), poll(2), port_create(3C), libvnd(3LIB), vnd_close(3VND)
diff --git a/usr/src/man/man3vnd/vnd_prop_get.3vnd b/usr/src/man/man3vnd/vnd_prop_get.3vnd
new file mode 100644
index 0000000000..e47698c85e
--- /dev/null
+++ b/usr/src/man/man3vnd/vnd_prop_get.3vnd
@@ -0,0 +1,242 @@
+'\" te
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
+.\"
+.TH VND_PROP_GET 3VND "Feb 21, 2014"
+
+.SH NAME
+
+vnd_prop_get, vnd_prop_set \- get and set vnd properties
+
+.SH SYNOPSIS
+
+.LP
+.nf
+cc [ flag... ] file... -lvnd [ library... ]
+#include <libvnd.h>
+
+int vnd_prop_get(vnd_handle_t *vhp, vnd_prop_t prop, void *buf, size_t len);
+
+int vnd_prop_set(vnd_handle_t *vhp, vnd_prop_t prop, void *buf, size_t len);
+.fi
+
+.SH DESCRIPTION
+.LP
+The vnd_prop_get and vnd_prop_set functions are used to retrieve
+and set property values on the vnd_handle_t referred to by vhp. The
+property to get or set is specified by the argument prop. The
+argument buf and the size of buf, in len, should be a pointer to the
+appropriate structure for the property as defined in libvnd(3LIB).
+
+.LP
+All of the supported properties are listed and described in the
+libvnd(3LIB) manual page.
+
+
+.SH RETURN VALUES
+.LP
+On success, the vnd_prop_get and vnd_prop_set functions return zero.
+On failure, they return -1 and additional error information is
+available through vnd_errno(3VND) and vnd_syserrno(3VND).
+
+.LP
+When vnd_prop_get returns successfully, the contents of buf are
+filled in with the value of the corresponding property. The contents
+of buf should not change across a call to vnd_prop_set.
+
+.SH EXAMPLES
+
+.LP
+Example 1 Getting the value of the rxbuf property
+.LP
+The following sample C program retrieves the value of the
+rxbuf property and prints it to standard out.
+
+.sp
+.in +2
+.nf
+#include <libvnd.h>
+#include <stdio.h>
+
+int
+main(void)
+{
+ vnd_handle_t *vhp;
+ vnd_errno_t vnderr;
+ int syserr;
+ vnd_prop_buf_t vpb;
+
+ vhp = vnd_open(NULL, "vnd1", &vnderr, &syserr);
+ if (vhp != NULL) {
+ if (vnderr == VND_E_SYS)
+ (void) fprintf(stderr, "failed to open device: %s",
+ vnd_strsyserror(syserr));
+ else
+ (void) fprintf(stderr, "failed to open device: %s",
+ vnd_strerror(vnderr));
+ return (1);
+ }
+
+ if (vnd_prop_get(vhp, VND_PROP_RXBUF, &vpn, sizeof (vpn)) != 0) {
+ vnderr = vnd_errno(vhp);
+ syserr = vnd_syserrno(vhp);
+ if (vnderr == VND_E_SYS)
+ (void) fprintf(stderr, "failed to get VND_PROP_RXBUF: %s",
+ vnd_strsyserror(syserr));
+ else
+ (void) fprintf(stderr, "failed to get VND_PROP_RXBUF: %s",
+ vnd_strerror(vnderr));
+ return (1);
+ }
+
+ (void) printf("recieve buffer size is %d bytes\n", vpb.vpb_size);
+
+ vnd_close(vnd);
+ return (0);
+}
+.fi
+.in -2
+
+.LP
+EXAMPLE 2 Setting a property
+.LP
+This sample C program sets the property VND_PROP_RXBUF to the value of
+4200 bytes.
+
+.sp
+.in +2
+.nf
+#include <libvnd.h>
+#include <stdio.h>
+
+int
+main(void)
+{
+ vnd_handle_t *vhp;
+ vnd_errno_t vnderr;
+ int syserr;
+ vnd_prop_buf_t vpb;
+
+ vhp = vnd_open(NULL, "vnd1", &vnderr, &syserr);
+ if (vhp != NULL) {
+ if (vnderr == VND_E_SYS)
+ (void) fprintf(stderr, "failed to open device: %s",
+ vnd_strsyserror(syserr));
+ else
+ (void) fprintf(stderr, "failed to open device: %s",
+ vnd_strerror(vnderr));
+ return (1);
+ }
+
+ vpb.vpb_size = 4200;
+ if (vnd_prop_set(vhp, VND_PROP_RXBUF, &vpb, sizeof (vpb)) != 0) {
+ vnderr = vnd_errno(vhp);
+ syserr = vnd_syserrno(vhp);
+ if (vnderr == VND_E_SYS)
+ (void) fprintf(stderr, "failed to set VND_PROP_RXBUF: %s",
+ vnd_strsyserror(syserr));
+ else
+ (void) fprintf(stderr, "failed to set VND_PROP_RXBUF: %s",
+ vnd_strerror(vnderr));
+ return (1);
+ }
+
+ (void) printf("successfully set VND_PROP_RXBUF to 4200\n");
+
+ vnd_close(vnd);
+ return (0);
+}
+.fi
+.in -2
+
+.LP
+Example 3 Setting a property to the value of another.
+.LP
+In this sample C program, we set the VND_PROP_TXBUF to the maximum
+allowable size as determined by the read-only property VND_PROP_MAXBUF.
+
+.sp
+.in +2
+.nf
+#include <libvnd.h>
+#include <stdio.h>
+
+int
+main(void)
+{
+ vnd_handle_t *vhp;
+ vnd_errno_t vnderr;
+ int syserr;
+ vnd_prop_buf_t vpb;
+
+ vhp = vnd_open(NULL, "vnd1", &vnderr, &syserr);
+ if (vhp != NULL) {
+ if (vnderr == VND_E_SYS)
+ (void) fprintf(stderr, "failed to open device: %s",
+ vnd_strsyserror(syserr));
+ else
+ (void) fprintf(stderr, "failed to open device: %s",
+ vnd_strerror(vnderr));
+ return (1);
+ }
+
+ if (vnd_prop_get(vhp, VND_PROP_MAXBUF, &vpb, sizeof (vpb)) != 0) {
+ vnderr = vnd_errno(vhp);
+ syserr = vnd_syserrno(vhp);
+ if (vnderr == VND_E_SYS)
+ (void) fprintf(stderr, "failed to get VND_PROP_MAXBUF: %s",
+ vnd_strsyserror(syserr));
+ else
+ (void) fprintf(stderr, "failed to get VND_PROP_MAXBUF: %s",
+ vnd_strerror(vnderr));
+ return (1);
+ }
+
+ if (vnd_prop_set(vhp, VND_PROP_TXBUF, &vpb, sizeof (vpb)) != 0) {
+ vnderr = vnd_errno(vhp);
+ syserr = vnd_syserrno(vhp);
+ if (vnderr == VND_E_SYS)
+ (void) fprintf(stderr, "failed to set VND_PROP_TXBUF: %s",
+ vnd_strsyserror(syserr));
+ else
+ (void) fprintf(stderr, "failed to set VND_PROP_TXBUF: %s",
+ vnd_strerror(vnderr));
+ return (1);
+ }
+
+ (void) printf("successfully set VND_PROP_TXBUF to %d\n", vpb.vpb_size);
+
+ vnd_close(vnd);
+ return (0);
+}
+.fi
+
+.SH ATTRIBUTES
+.sp
+.LP
+See attributes(5) for descriptions of the following attributes:
+
+.sp
+.TS
+box;
+c | c
+l | l .
+ATTRIBUTE TYPE ATTRIBUTE VALUE
+_
+Stability Committed
+_
+MT-Level See "THREADING" in libvnd(3LIB)
+.TE
+
+.SH SEE ALSO
+libvnd(3VND), vnd_errno(3VND, vnd_syserrno(3VND)
diff --git a/usr/src/man/man3vnd/vnd_prop_iter.3vnd b/usr/src/man/man3vnd/vnd_prop_iter.3vnd
new file mode 100644
index 0000000000..29221734c5
--- /dev/null
+++ b/usr/src/man/man3vnd/vnd_prop_iter.3vnd
@@ -0,0 +1,148 @@
+'\" te
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
+.\"
+.TH VND_PROP_ITER 3VND "Feb 21, 2014"
+
+.SH NAME
+
+vnd_prop_iter \- iterate vnd properties
+
+.SH SYNOPSIS
+
+.LP
+.nf
+cc [ flag... ] file... -lvnd [ library... ]
+#include <libvnd.h>
+
+typedef int (vnd_prop_iter_f)(vnd_handle_t *vhp, vnd_prop_t prop,
+ void *cbarg);
+
+int vnd_prop_iter(vnd_handle_t *vhp, vnd_prop_iter_f cb,
+ void *arg);
+.fi
+
+.SH DESCRIPTION
+.LP
+The vnd_prop_iter function iterates over all the available properties
+for the vnd handle vhp and calls the user supplied callback function
+cb. The argument arg is passed directly to the callback function.
+
+.LP
+The function specified by cb receives three arguments. The first, vhp,
+is the same vnd library handle that was passed to vnd_prop_iter. During
+the callback, the consumer should not call vnd_close(3VND). Doing so
+will lead to undefined and undocumented behavior. The second argument,
+prop, is the current property. While vnd_prop_iter guarantees that all
+properties will be recieved, it does not guarantee the order of them.
+The final argument, cbarg, is the same argument that the caller passed
+in during arg.
+
+.LP
+The return value of the callback function cb indicates whether or not
+property iteration should continue. To continue iteration, the
+function cb should return zero. Otherwise, to stop property iteration
+it should return non-zero.
+
+.SH RETURN VALUES
+
+.LP
+On success, the function vnd_prop_iter returns zero. If the callback
+function returned non-zero to terminate iteration, vnd_prop_iter will
+instead return one. In the case of library failure, vnd_prop_iter will
+return -1. In such cases, the vnd and system errors will be updated
+and available via vnd_errno(3VND) and vnd_syserrno(3VND).
+
+.SH EXAMPLES
+
+.LP
+Example 1 Print writeable properties
+
+.LP
+The following sample C program walks over every vnd property and
+prints out whether the property is read-only or read-write for the
+vnd device "vnd1" in the current zone.
+
+.sp
+.in +2
+.nf
+#include <libvnd.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+static int
+print_prop(vnd_handle_t *vhp, vnd_prop_t prop, void *unused)
+{
+ boolean_t canwrite;
+
+ if (vnd_prop_writeable(vhp, &canwrite) != 0)
+ abort();
+
+ (void) printf("prop %d is %s", prop, canwrite == B_TRUE ? "rw" : "r-");
+ return (0);
+}
+
+int
+main(void)
+{
+ vnd_handle_t *vhp;
+ vnd_errno_t vnderr;
+ int syserr;
+
+ vhp = vnd_open(NULL, "vnd1", &vnderr, &syserr);
+ if (vhp != NULL) {
+ if (vnderr == VND_E_SYS)
+ (void) fprintf(stderr, "failed to open device: %s",
+ vnd_strsyserror(syserr));
+ else
+ (void) fprintf(stderr, "failed to open device: %s",
+ vnd_strerror(vnderr));
+ return (1);
+ }
+
+ if (vnd_prop_iter(vhp, print_prop, NULL) != 0) {
+ vnderr = vnd_errno(vhp);
+ syserr = vnd_syserrno(vhp);
+ if (vnderr == VND_E_SYS)
+ (void) fprintf(stderr, "failed to open device: %s",
+ vnd_strsyserror(syserr));
+ else
+ (void) fprintf(stderr, "failed to open device: %s",
+ vnd_strerror(vnderr));
+ return (1);
+ }
+
+ vnd_close(vnd);
+ return (0);
+}
+.fi
+.in -2
+
+.SH ATTRIBUTES
+.sp
+.LP
+See attributes(5) for descriptions of the following attributes:
+
+.sp
+.TS
+box;
+c | c
+l | l .
+ATTRIBUTE TYPE ATTRIBUTE VALUE
+_
+Stability Committed
+_
+MT-Level See "THREADING" in libvnd(3LIB)
+.TE
+
+libvnd(3LIB), vnd_close(3VND), vnd_errno(3VND), vnd_syserrno(3VND)
diff --git a/usr/src/man/man3vnd/vnd_prop_writeable.3vnd b/usr/src/man/man3vnd/vnd_prop_writeable.3vnd
new file mode 100644
index 0000000000..c23414718b
--- /dev/null
+++ b/usr/src/man/man3vnd/vnd_prop_writeable.3vnd
@@ -0,0 +1,101 @@
+'\" te
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
+.\"
+.TH VND_PROP_WRITEABLE 3VND "Feb 21, 2014"
+
+.SH NAME
+
+vnd_prop_writeable \- determine if a vnd property can be updated
+
+.SH SYNOPSIS
+
+.LP
+.nf
+cc [ flag... ] file... -lvnd [ library... ]
+#include <libvnd.h>
+
+int vnd_prop_writeable(vnd_prop_t prop, boolean_t *wp);
+.fi
+
+
+.SH DESCRIPTION
+.LP
+The vnd_prop_writeable function is used as a programmatic means to
+determine whether a given vnd property is writeable or not. The
+property to check is specified in prop and should be from the list
+described in libvnd(3VND). The argument wp is a pointer to a boolean_t
+which will be updated upon the successful completion of the function.
+The argument wp must be a valid pointer. If a property is writeable
+than the value pointed to by wp is set to B_TRUE. If the property is
+read-only, then the value is set to B_FALSE.
+
+
+.SH RETURN VALUES
+.LP
+On success, vnd_prop_writeable returns zero and the value pointed to
+by wp is updated with whether the property is writeable. If the
+property prop does not exist, then vnd_prop_writeable will return -1.
+
+.SH EXAMPLES
+.LP
+Example 1 Check whether the property VND_PROP_TXBUF is writable
+.LP
+The following sample C program checks whether the vnd property
+VND_PROP_TXBUF is writeable or not.
+
+.sp
+.in +2
+.nf
+#include <libvnd.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main(void)
+{
+ boolean_t canwrite;
+
+ if (vnd_prop_writeable(VND_PROP_TXBUF, &prop) != 0)
+ abort();
+
+ if (canwrite == B_TRUE)
+ (void) printf("VND_PROP_TXBUF is writeable\n");
+ else
+ (void) printf("VND_PROP_TXBUF is read only\n");
+
+ return (0);
+}
+.fi
+.in -2
+
+.SH ATTRIBUTES
+.sp
+.LP
+See attributes(5) for descriptions of the following attributes:
+
+.sp
+.TS
+box;
+c | c
+l | l .
+ATTRIBUTE TYPE ATTRIBUTE VALUE
+_
+Stability Committed
+_
+MT-Level MT-Safe
+.TE
+
+.SH SEE ALSO
+
+vndadm(1M), libvnd(3VND)
diff --git a/usr/src/man/man3vnd/vnd_walk.3vnd b/usr/src/man/man3vnd/vnd_walk.3vnd
new file mode 100644
index 0000000000..bed53130d3
--- /dev/null
+++ b/usr/src/man/man3vnd/vnd_walk.3vnd
@@ -0,0 +1,155 @@
+'\" te
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
+.\"
+.TH VND_CREATE 3VND "Feb 21, 2014"
+
+.SH NAME
+
+vnd_walk \- walk all vnd devices
+
+
+.SH SYNOPSIS
+
+.LP
+.nf
+cc [ flag... ] file... -lvnd [ library... ]
+#include <libvnd.h>
+
+typedef int (*vnd_walk_cb_f)(vnd_info_t *viip, void *cbarg);
+
+int vnd_walk(vnd_walk_cb_t cb, void *arg, vnd_errno_t *vnderr, int *syserr);
+.fi
+
+
+.SH DESCRIPTION
+.LP
+The vnd_walk() function fires the callback function cb once for every
+vnd device that is visible in the current zone. If the caller is in
+the global zone, then all vnd devices in all zones will be walked. If
+the caller is in a non-global zone, then only the devices in that zone
+will be visible.
+
+.LP
+The function cb will be called with two arguments. The first argument,
+viip, is a pointer to a structure that contains information about the
+link. The second argument to the function cb, cbarg, is the same
+argument that is passed to the function vnd_walk as arg. To continue
+the function cb should return zero. If the function cb returns
+non-zero the walk will terminate.
+
+.LP
+As the vnd_walk function does not have a handle, errors are returned
+in vnderr and syserr. Both vnderr and syserr are allowed to be NULL
+pointers. If either one is a NULL pointer, then error information for
+that class of error will not be returned. It is not recommended that
+consumers supply NULL pointers.
+
+.LP
+The vnd_info_t structure contains the following members:
+
+.in +2
+.nf
+uint32_t vi_version
+zoneid_t vi_zone
+char vi_name[LIBVND_NAMELEN];
+char vi_datalink[LIBVND_NAMELEN];
+.fi
+.in -2
+
+.LP
+The member vi_version is guaranteed to be the first member of the
+structure. This number indicates the current revision of the structure
+and is set to the integer value 1. More properties may be added in
+future releases. Those properties will be tied to a greater version
+number so software knows whether or not it is legal to access them.
+
+.LP
+The vi_zone field indicates the zone id that the vnd device exists in.
+The vi_name field is the name of the vnd device. If the vnd_device is
+not linked, the name field is set to "<unknown>". The vi_datalink
+field is filled in with the name of the data link the vnd device is on
+top of.
+
+
+.SH RETURN VALUES
+
+.LP
+The vnd_walk function will return zero on success. If the consumer
+supplied callback function returned non-zero, then the vnd_walk
+function will return 1. If an error occurred, -1 is returned, and if
+vnderr and syserr are non-null, they are filled in with their
+respective error values. See vnd_errno(3VND) for more information on
+these errors.
+
+.SH EXAMPLES
+
+.LP
+Example 1 Walk all devices and print information about them
+
+.LP
+The following sample C program walks every vnd device and prints out
+information about them.
+
+.sp
+.in +2
+.nf
+#include <libvnd.h>
+#include <stdio.h>
+
+static int
+print_entry(vnd_info_t *viip, void *unused)
+{
+ (void) printf("device %s over data link %s in zone %d\n",
+ viip->vi_name, viip->vi_datalink, viip->vi_zone);
+ return (0);
+}
+
+int
+main(void)
+{
+ vnd_errno_t vnderr;
+ int syserr;
+
+ if (vnd_walk(print_entry, NULL, &vnderr, &syserr) != 0) {
+ (void) fprintf(stderr, "failed to walk vnd devices: %s\n",
+ vnderr != VND_E_SYS ? vnd_strerror(vnderr) :
+ vnd_strsyserror(syserr));
+ return (1);
+ }
+
+ return (0);
+}
+.fi
+.in -2
+
+.SH ATTRIBUTES
+.sp
+.LP
+See attributes(5) for descriptions of the following attributes:
+
+.sp
+.TS
+box;
+c | c
+l | l .
+ATTRIBUTE TYPE ATTRIBUTE VALUE
+_
+Stability Committed
+_
+MT-Level MT-Safe
+.TE
+
+.SH SEE ALSO
+
+libvnd(3VND), vnd_errno(3VND), attributes(5), zones(5)
diff --git a/usr/src/man/man3xnet/Makefile b/usr/src/man/man3xnet/Makefile
index 81cd96cba3..cc231f60c4 100644
--- a/usr/src/man/man3xnet/Makefile
+++ b/usr/src/man/man3xnet/Makefile
@@ -62,6 +62,7 @@ MANLINKS= getaddrinfo.3xnet \
getservbyname.3xnet \
getservbyport.3xnet \
getservent.3xnet \
+ htonll.3xnet \
htons.3xnet \
if_freenameindex.3xnet \
if_indextoname.3xnet \
@@ -73,6 +74,7 @@ MANLINKS= getaddrinfo.3xnet \
inet_ntoa.3xnet \
inet_pton.3xnet \
ntohl.3xnet \
+ ntohll.3xnet \
ntohs.3xnet \
sethostent.3xnet \
setnetent.3xnet \
@@ -97,6 +99,7 @@ getservbyname.3xnet := LINKSRC = endservent.3xnet
getservbyport.3xnet := LINKSRC = endservent.3xnet
getservent.3xnet := LINKSRC = endservent.3xnet
+htonll.3xnet := LINKSRC = htonl.3xnet
htons.3xnet := LINKSRC = htonl.3xnet
if_freenameindex.3xnet := LINKSRC = if_nametoindex.3xnet
@@ -112,6 +115,7 @@ inet_ntoa.3xnet := LINKSRC = inet_addr.3xnet
inet_pton.3xnet := LINKSRC = inet_ntop.3xnet
ntohl.3xnet := LINKSRC = htonl.3xnet
+ntohll.3xnet := LINKSRC = htonl.3xnet
ntohs.3xnet := LINKSRC = htonl.3xnet
sethostent.3xnet := LINKSRC = endhostent.3xnet
diff --git a/usr/src/man/man3xnet/htonl.3xnet b/usr/src/man/man3xnet/htonl.3xnet
index aa8470a28e..dda4586eb7 100644
--- a/usr/src/man/man3xnet/htonl.3xnet
+++ b/usr/src/man/man3xnet/htonl.3xnet
@@ -7,7 +7,8 @@
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH HTONL 3XNET "Jun 10, 2002"
+.\" Portions Copyright (c) 2012 Joyent, Inc. All rights reserved.
+.TH HTONL 3XNET "Jan 03, 2013"
.SH NAME
htonl, htons, ntohl, ntohs \- convert values between host and network byte
order
@@ -22,6 +23,11 @@ order
.LP
.nf
+\fBuint64_t\fR \fBhtonll\fR(\fBuint64_t\fR \fIhostlonglong\fR);
+.fi
+
+.LP
+.nf
\fBuint16_t\fR \fBhtons\fR(\fBuint16_t\fR \fIhostshort\fR);
.fi
@@ -32,18 +38,23 @@ order
.LP
.nf
+\fBuint64_t\fR \fBntohll\fR(\fBuint64_t\fR \fInetlonglong\fR);
+.fi
+
+.LP
+.nf
\fBuint16_t\fR \fBntohs\fR(\fBuint16_t\fR \fI netshort\fR);
.fi
.SH DESCRIPTION
.sp
.LP
-These functions convert 16-bit and 32-bit quantities between network byte order
-and host byte order.
+These functions convert 16-bit, 32-bit, and 64-bit quantities between network
+byte order and host byte order.
.sp
.LP
-The \fBuint32_t\fR and \fBuint16_t\fR types are made available by inclusion
-of \fB<inttypes.h>\fR\&.
+The \fBuint32_t\fR, \fBuint16_t\fR, and \fBuint64_t\fR types are made available
+by inclusion of \fB<inttypes.h>\fR\&.
.SH USAGE
.sp
.LP
@@ -56,12 +67,12 @@ value of their argument.
.SH RETURN VALUES
.sp
.LP
-The \fBhtonl()\fR and \fBhtons()\fR functions return the argument value
-converted from host to network byte order.
+The \fBhtonl()\fR, \fBhtonll()\fR, and \fBhtons()\fR functions return the
+argument value converted from host to network byte order.
.sp
.LP
-The \fBntohl()\fR and \fBntohs()\fR functions return the argument value
-converted from network to host byte order.
+The \fBntohl()\fR, \fBntohll()\fR, and \fBntohs()\fR functions return the
+argument value converted from network to host byte order.
.SH ERRORS
.sp
.LP
diff --git a/usr/src/man/man4/Makefile b/usr/src/man/man4/Makefile
index f4c4317405..fc5d06c2ff 100644
--- a/usr/src/man/man4/Makefile
+++ b/usr/src/man/man4/Makefile
@@ -133,6 +133,7 @@ _MANFILES= Intro.4 \
nsmbrc.4 \
nss.4 \
nsswitch.conf.4 \
+ overlay_files.4 \
packingrules.4 \
pam.conf.4 \
passwd.4 \
diff --git a/usr/src/man/man4/overlay_files.4 b/usr/src/man/man4/overlay_files.4
new file mode 100644
index 0000000000..b9e5387871
--- /dev/null
+++ b/usr/src/man/man4/overlay_files.4
@@ -0,0 +1,187 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright 2015, Joyent, Inc.
+.\"
+.Dd Apr 13, 2015
+.Dt OVERLAY_FILES 4
+.Os
+.Sh NAME
+.Nm overlay_files
+.Nd Overlay files plugin file format
+.Sh DESCRIPTION
+The
+.Sy files
+plugin provides a means for a dynamic overlay where the destinations are
+determined based on a static description contained in a
+.Sy JSON
+file.
+This manual describes the format of the file used by the
+.Sy files/config
+property.
+To create and manage overlays with the
+.Sy files
+plugin, use
+.Xr dladm 1M .
+For more information on overlays, see
+.Xr overlay 5 .
+.Pp
+Using the
+.Sy files
+module, a static and simple overlay network can be created.
+This network does not support the use of
+.Em broadcast
+or
+.Em multicast
+traffic.
+Both ARP and NDP traffic are proxied by the plugin itself.
+In addition, the plugin allows for DHCP.
+Instead of providing a traditional DHCP proxy, when an initial DHCP broadcast
+goes out to a broadcast address, it will get rewritten to target a specific MAC
+address.
+The
+.Sy files
+plugin is useful as proof of concept and for simple static networks
+where addresses do not need to be reconfigured.
+If more advanced topologies or more streamlined updates are required, consider
+a different plugin.
+.Pp
+The file format is encoded as a series of
+.Sy JSON
+objects.
+Each object has a key, which is a MAC address on the
+.Sy overlay
+network.
+It has multiple values, some required, some optional, which describe various
+properties.
+The valid properties are:
+.Bl -hang -width Ds
+.It Sy ip
+.Bd -filled -compact
+The
+.Sy ip
+key indicates the IP address on the
+.Sy underlay
+network that houses the MAC address in question.
+Packets directed for the MAC address will be encapsulated and set to this
+address.
+This field is required.
+.Pp
+The value is a
+.Em JSON String .
+Both IPv4 and IPv6 addresses are supported and should be written out in their
+traditional forms.
+Follow the guidelines for writing addresses in
+.Xr inet_aton 3SOCKET .
+.Ed
+.It Sy port
+.Bd -filled -compact
+The
+.Sy port
+key indicates the port on the
+.Sy underlay
+network that houses the MAC address in question.
+This property is required if the encapsulation module requires a port for its
+destination.
+The value is a
+.Em JSON Number .
+.Ed
+.It Sy arp
+.Bd -filled -compact
+The
+.Sy arp
+key stores the IPv4 address that corresponds to this MAC address on the
+.Sy overlay
+network.
+This will be used to respond to ARP queries that would traditionally have been
+received by the OS kernel.
+If this address is not present, no IPv4 packets directed to this IP address will
+be received by the network interface that has this MAC address, regardless of
+what is configured on top of it.
+.Pp
+The value is a
+.Em JSON String
+and should be written out following the guidelines for IPv4 addresses in
+.Xr inet_aton 3SOCKET .
+.Ed
+.It Sy ndp
+.Bd -filled -compact
+The
+.Sy ndp
+key stores the IPv6 address that corresponds to this MAC address on the
+.Sy overlay
+network.
+This will be used to respond to NDP queries that would traditionally have been
+received by the OS kernel.
+If this address is not present, no IPv6 packets directed to this IP address will
+be received by the network interface that has this MAC address, regardless of
+what is configured on top of it.
+.Pp
+The value is a
+.Em JSON String
+and should be written out following the guidelines for IPv6 addresses in
+.Xr inet_aton 3SOCKET .
+.Ed
+.It Sy dhcp-proxy
+.Bd -filled -compact
+The
+.Sy dhcp-proxy
+key stores a MAC address that DHCP messages directed to a broadcast address get
+rewritten to be sent to.
+This can be viewed as a form of proxy DHCP, but is different in mechanism from a
+traditional proxy.
+The value is a
+.Em JSON String
+and should be written as a traditional MAC address string as described by
+.Xr ether_aton 3SOCKET .
+.Ed
+.El
+.Sh EXAMPLES
+.Sy Example 1
+Sample configuration file
+.Pp
+This configuration file provides information for three different MAC
+addresses.
+Each MAC address has an entry which describes what its IPv4
+and IPv6 address is, as well as the IP address and port of the host on
+the underlay network.
+Finally, one host has a DHCP proxy entry to demonstrate how one might
+configure DHCP.
+.Bd -literal -offset indent
+{
+ "de:ad:be:ef:00:00": {
+ "arp": "10.55.55.2",
+ "ip": "10.88.88.69",
+ "ndp": "fe80::3",
+ "port": 4789
+ },
+ "de:ad:be:ef:00:01": {
+ "arp": "10.55.55.3",
+ "dhcp-proxy": "de:ad:be:ef:00:00",
+ "ip": "10.88.88.70",
+ "ndp": "fe80::4",
+ "port": 4789
+ },
+ "de:ad:be:ef:00:02": {
+ "arp": "10.55.55.4",
+ "ip": "10.88.88.71",
+ "ndp": "fe80::5",
+ "port": 4789
+ }
+}
+.Ed
+.Sh STABILITY
+This file format is
+.Sy committed ;
+however, keys that are not listed here are reserved for future use.
+.Sh SEE ALSO
+.Xr dladm 1M ,
+.Xr overlay 5
diff --git a/usr/src/man/man4/proc.4 b/usr/src/man/man4/proc.4
index 59fd43f9a0..3e5a9bb95f 100644
--- a/usr/src/man/man4/proc.4
+++ b/usr/src/man/man4/proc.4
@@ -1,241 +1,394 @@
'\" te
.\" Copyright 1989 AT&T
.\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved.
-.\" Copyright (c) 2013, Joyent, Inc. All rights reserved.
+.\" Copyright 2017, Joyent, Inc.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH PROC 4 "Jun 6, 2016"
-.SH NAME
-proc \- /proc, the process file system
-.SH DESCRIPTION
-.LP
-\fB/proc\fR is a file system that provides access to the state of each process
-and light-weight process (lwp) in the system. The name of each entry in the
-\fB/proc\fR directory is a decimal number corresponding to a process-ID. These
-entries are themselves subdirectories. Access to process state is provided by
-additional files contained within each subdirectory; the hierarchy is described
-more completely below. In this document, ``\fB/proc\fR file'' refers to a
-non-directory file within the hierarchy rooted at \fB/proc\fR. The owner of
-each \fB/proc\fR file and subdirectory is determined by the user-ID of the
-process.
-.sp
-.LP
-\fB/proc\fR can be mounted on any mount point, in addition to the standard
-\fB/proc\fR mount point, and can be mounted several places at once. Such
-additional mounts are allowed in order to facilitate the confinement of
-processes to subtrees of the file system via \fBchroot\fR(1M) and yet allow
-such processes access to commands like \fBps\fR(1).
-.sp
-.LP
-Standard system calls are used to access \fB/proc\fR files: \fBopen\fR(2),
-\fBclose\fR(2), \fBread\fR(2), and \fBwrite\fR(2) (including \fBreadv\fR(2),
-\fBwritev\fR(2), \fBpread\fR(2), and \fBpwrite\fR(2)). Most files describe
-process state and can only be opened for reading. \fBctl\fR and \fBlwpctl\fR
+.Dd Jun 24, 2016
+.Dt PROC 4
+.Os
+.Sh NAME
+.Nm proc
+.Nd /proc, the process file system
+.Sh DESCRIPTION
+.Pa /proc
+is a file system that provides access to the state of each process
+and light-weight process (lwp) in the system.
+The name of each entry in the
+.Pa /proc
+directory is a decimal number corresponding to a process-ID.
+These entries are themselves subdirectories.
+Access to process state is provided by additional files contained within each
+subdirectory; the hierarchy is described more completely below.
+In this document,
+.Dq Pa /proc file
+refers to a non-directory file within the hierarchy rooted at
+.Pa /proc .
+The owner of each
+.Pa /proc
+file and subdirectory is determined by the user-ID of the process.
+.Pp
+.Pa /proc
+can be mounted on any mount point, in addition to the standard
+.Pa /proc
+mount point, and can be mounted several places at once.
+Such additional mounts are allowed in order to facilitate the confinement of
+processes to subtrees of the file system via
+.Xr chroot 2
+and yet allow such processes access to commands like
+.Xr ps 1 .
+.Pp
+Standard system calls are used to access
+.Pa /proc
+files:
+.Xr open 2 ,
+.Xr close 2 ,
+.Xr read 2 ,
+and
+.Xr write 2
+(including
+.Xr readv 2 ,
+.Xr writev 2 ,
+.Xr pread 2 ,
+and
+.Xr pwrite 2 ) .
+Most files describe process state and can only be opened for reading.
+.Pa ctl
+and
+.Pa lwpctl
(control) files permit manipulation of process state and can only be opened for
-writing. \fBas\fR (address space) files contain the image of the running
-process and can be opened for both reading and writing. An open for writing
-allows process control; a read-only open allows inspection but not control. In
-this document, we refer to the process as open for reading or writing if any of
-its associated \fB/proc\fR files is open for reading or writing.
-.sp
-.LP
-In general, more than one process can open the same \fB/proc\fR file at the
-same time. \fIExclusive\fR \fIopen\fR is an advisory mechanism provided to
-allow controlling processes to avoid collisions with each other. A process can
-obtain exclusive control of a target process, with respect to other cooperating
-processes, if it successfully opens any \fB/proc\fR file in the target process
-for writing (the \fBas\fR or \fBctl\fR files, or the \fBlwpctl\fR file of any
-lwp) while specifying \fBO_EXCL\fR in the \fBopen\fR(2). Such an open will fail
-if the target process is already open for writing (that is, if an \fBas\fR,
-\fBctl\fR, or \fBlwpctl\fR file is already open for writing). There can be any
-number of concurrent read-only opens; \fBO_EXCL\fR is ignored on opens for
-reading. It is recommended that the first open for writing by a controlling
-process use the \fBO_EXCL\fR flag; multiple controlling processes usually
-result in chaos.
-.sp
-.LP
-If a process opens one of its own \fB/proc\fR files for writing, the open
-succeeds regardless of \fBO_EXCL\fR and regardless of whether some other
-process has the process open for writing. Self-opens do not count when another
-process attempts an exclusive open. (A process cannot exclude a debugger by
-opening itself for writing and the application of a debugger cannot prevent a
-process from opening itself.) All self-opens for writing are forced to be
-close-on-exec (see the \fBF_SETFD\fR operation of \fBfcntl\fR(2)).
-.sp
-.LP
+writing.
+.Pa as
+(address space) files contain the image of the running process and can be
+opened for both reading and writing.
+An open for writing allows process control; a read-only open allows inspection
+but not control.
+In this document, we refer to the process as open for reading or writing if
+any of its associated
+.Pa /proc
+files is open for reading or writing.
+.Pp
+In general, more than one process can open the same
+.Pa /proc
+file at the same time. \fIExclusive\fR \fIopen\fR is an advisory mechanism provided to
+allow controlling processes to avoid collisions with each other.
+A process can obtain exclusive control of a target process, with respect to
+other cooperating processes, if it successfully opens any
+.Pa /proc
+file in the target process for writing (the
+.Pa as
+or
+.Pa ctl
+files, or the
+.Pa lwpctl
+file of any lwp) while specifying
+.Sy O_EXCL
+in the
+.Xr open 2 .
+Such an open will fail if the target process is already open for writing (that
+is, if an
+.Pa as ,
+.Pa ctl ,
+or
+.Pa lwpctl
+file is already open for writing).
+There can be any number of concurrent read-only opens;
+.Sy O_EXCL
+is ignored on opens for reading.
+It is recommended that the first open for writing by a controlling
+process use the
+.Sy O_EXCL
+flag; multiple controlling processes usually result in chaos.
+.Pp
+If a process opens one of its own
+.Pa /proc
+files for writing, the open
+succeeds regardless of
+.Sy O_EXCL
+and regardless of whether some other process has the process open for writing.
+Self-opens do not count when another process attempts an exclusive open.
+(A process cannot exclude a debugger by opening itself for writing and the
+application of a debugger cannot prevent a process from opening itself.)
+All self-opens for writing are forced to be close-on-exec (see the
+.Sy F_SETFD
+operation of
+.Xr fcntl 2 ) .
+.Pp
Data may be transferred from or to any locations in the address space of the
-traced process by applying \fBlseek\fR(2) to position the \fBas\fR file at the
-virtual address of interest followed by \fBread\fR(2) or \fBwrite\fR(2) (or by
-using \fBpread\fR(2) or \fBpwrite\fR(2) for the combined operation). The
-address-map files \fB/proc/\fR\fIpid\fR\fB/map\fR and
-\fB/proc/\fR\fIpid\fR\fB/xmap\fR can be read to determine the accessible areas
-(mappings) of the address space. \fBI/O\fR transfers may span contiguous
-mappings. An \fBI/O\fR request extending into an unmapped area is truncated at
-the boundary. A write request beginning at an unmapped virtual address fails
-with \fBEIO\fR; a read request beginning at an unmapped virtual address returns
-zero (an end-of-file indication).
-.sp
-.LP
+traced process by applying
+.Xr lseek 2
+to position the
+.Pa as
+file at the virtual address of interest followed by
+.Xr read 2
+or
+.Xr write 2
+(or by using
+.Xr pread 2
+or
+.Xr pwrite 2
+for the combined operation).
+The address-map files
+.Pa /proc/ Ns Em pid Ns Pa /map
+and
+.Pa /proc/ Ns Em pid Ns Pa /xmap
+can be read to determine the accessible areas (mappings) of the address space.
+.Sy I/O
+transfers may span contiguous mappings.
+An
+.Sy I/O
+request extending into an unmapped area is truncated at the boundary.
+A write request beginning at an unmapped virtual address fails with
+.Er EIO ;
+a read request beginning at an unmapped virtual address returns zero (an
+end-of-file indication).
+.Pp
Information and control operations are provided through additional files.
-\fB<procfs.h>\fR contains definitions of data structures and message formats
-used with these files. Some of these definitions involve the use of sets of
-flags. The set types \fBsigset_t\fR, \fBfltset_t\fR, and \fBsysset_t\fR
+.In procfs.h
+contains definitions of data structures and message formats
+used with these files.
+Some of these definitions involve the use of sets of flags.
+The set types
+.Sy sigset_t ,
+.Sy fltset_t ,
+and
+.Sy sysset_t
correspond, respectively, to signal, fault, and system call enumerations
-defined in \fB<sys/signal.h>\fR, \fB<sys/fault.h>\fR, and
-\fB<sys/syscall.h>\fR\&. Each set type is large enough to hold flags for its
-own enumeration. Although they are of different sizes, they have a common
+defined in
+.In sys/signal.h ,
+.In sys/fault.h ,
+and
+.In sys/syscall.h .
+Each set type is large enough to hold flags for its own enumeration.
+Although they are of different sizes, they have a common
structure and can be manipulated by these macros:
-.sp
-.in +2
-.nf
+.Bd -literal -offset indent
prfillset(&set); /* turn on all flags in set */
premptyset(&set); /* turn off all flags in set */
praddset(&set, flag); /* turn on the specified flag */
prdelset(&set, flag); /* turn off the specified flag */
r = prismember(&set, flag); /* != 0 iff flag is turned on */
-.fi
-.in -2
-
-.sp
-.LP
-One of \fBprfillset()\fR or \fBpremptyset()\fR must be used to initialize
-\fBset\fR before it is used in any other operation. \fBflag\fR must be a member
-of the enumeration corresponding to \fBset\fR.
-.sp
-.LP
-Every process contains at least one \fIlight-weight process\fR, or \fIlwp\fR.
+.Ed
+.Pp
+One of
+.Fn prfillset
+or
+.Fn premptyset
+must be used to initialize
+.Fa set
+before it is used in any other operation.
+.Fa flag
+must be a member of the enumeration corresponding to
+.Fa set .
+.Pp
+Every process contains at least one
+.Em light-weight process ,
+or
+.Sy lwp .
Each lwp represents a flow of execution that is independently scheduled by the
-operating system. All lwps in a process share its address space as well as many
-other attributes. Through the use of \fBlwpctl\fR and \fBctl\fR files as
-described below, it is possible to affect individual lwps in a process or to
-affect all of them at once, depending on the operation.
-.sp
-.LP
+operating system.
+All lwps in a process share its address space as well as many other attributes.
+Through the use of
+.Pa lwpctl
+and
+.Pa ctl
+files as described below, it is possible to affect individual lwps in a
+process or to affect all of them at once, depending on the operation.
+.Pp
When the process has more than one lwp, a representative lwp is chosen by the
-system for certain process status files and control operations. The
-representative lwp is a stopped lwp only if all of the process's lwps are
+system for certain process status files and control operations.
+The representative lwp is a stopped lwp only if all of the process's lwps are
stopped; is stopped on an event of interest only if all of the lwps are so
-stopped (excluding \fBPR_SUSPENDED\fR lwps); is in a \fBPR_REQUESTED\fR stop
-only if there are no other events of interest to be found; or, failing
-everything else, is in a \fBPR_SUSPENDED\fR stop (implying that the process is
-deadlocked). See the description of the \fBstatus\fR file for definitions of
-stopped states. See the \fBPCSTOP\fR control operation for the definition of
-``event of interest''.
-.sp
-.LP
+stopped (excluding
+.Sy PR_SUSPENDED
+lwps); is in a
+.Sy PR_REQUESTED
+stop only if there are no other events of interest to be found; or, failing
+everything else, is in a
+.Sy PR_SUSPENDED
+stop (implying that the process is deadlocked).
+See the description of the
+.Pa status
+file for definitions of stopped states.
+See the
+.Sy PCSTOP
+control operation for the definition of
+.Dq event of interest .
+.Pp
The representative lwp remains fixed (it will be chosen again on the next
operation) as long as all of the lwps are stopped on events of interest or are
-in a \fBPR_SUSPENDED\fR stop and the \fBPCRUN\fR control operation is not
-applied to any of them.
-.sp
-.LP
-When applied to the process control file, every \fB/proc\fR control operation
+in a
+.Sy PR_SUSPENDED
+stop and the
+.Sy PCRUN
+control operation is not applied to any of them.
+.Pp
+When applied to the process control file, every
+.Pa /proc
+control operation
that must act on an lwp uses the same algorithm to choose which lwp to act
-upon. Together with synchronous stopping (see \fBPCSET\fR), this enables a
-debugger to control a multiple-lwp process using only the process-level status
-and control files if it so chooses. More fine-grained control can be achieved
-using the lwp-specific files.
-.sp
-.LP
+upon.
+Together with synchronous stopping (see
+.Sy PCSET ) ,
+this enables a debugger to control a multiple-lwp process using only the
+process-level status and control files if it so chooses.
+More fine-grained control can be achieved using the lwp-specific files.
+.Pp
The system supports two process data models, the traditional 32-bit data model
in which ints, longs and pointers are all 32 bits wide (the ILP32 data model),
and on some platforms the 64-bit data model in which longs and pointers, but
-not ints, are 64 bits in width (the LP64 data model). In the LP64 data model
-some system data types, notably \fBsize_t\fR, \fBoff_t\fR, \fBtime_t\fR and
-\fBdev_t\fR, grow from 32 bits to 64 bits as well.
-.sp
-.LP
-The \fB/proc\fR interfaces described here are available to both 32-bit and
-64-bit controlling processes. However, many operations attempted by a 32-bit
-controlling process on a 64-bit target process will fail with \fBEOVERFLOW\fR
+not ints, are 64 bits in width (the LP64 data model).
+In the LP64 data model some system data types, notably
+.Sy size_t ,
+.Sy off_t ,
+.Sy time_t
+and
+.Sy dev_t ,
+grow from 32 bits to 64 bits as well.
+.Pp
+The
+.Pa /proc
+interfaces described here are available to both 32-bit and
+64-bit controlling processes.
+However, many operations attempted by a 32-bit
+controlling process on a 64-bit target process will fail with
+.Er EOVERFLOW
because the address space range of a 32-bit process cannot encompass a 64-bit
process or because the data in some 64-bit system data type cannot be
compressed to fit into the corresponding 32-bit type without loss of
-information. Operations that fail in this circumstance include reading and
+information.
+Operations that fail in this circumstance include reading and
writing the address space, reading the address-map files, and setting the
-target process's registers. There is no restriction on operations applied by a
+target process's registers.
+There is no restriction on operations applied by a
64-bit process to either a 32-bit or a 64-bit target processes.
-.sp
-.LP
-The format of the contents of any \fB/proc\fR file depends on the data model of
-the observer (the controlling process), not on the data model of the target
-process. A 64-bit debugger does not have to translate the information it reads
-from a \fB/proc\fR file for a 32-bit process from 32-bit format to 64-bit
-format. However, it usually has to be aware of the data model of the target
-process. The \fBpr_dmodel\fR field of the \fBstatus\fR files indicates the
-target process's data model.
-.sp
-.LP
+.Pp
+The format of the contents of any
+.Pa /proc
+file depends on the data model of the observer (the controlling process), not
+on the data model of the target process.
+A 64-bit debugger does not have to translate the information it reads from a
+.Pa /proc
+file for a 32-bit process from 32-bit format to 64-bit format.
+However, it usually has to be aware of the data model of the target process.
+The
+.Sy pr_dmodel
+field of the
+.Pa status
+files indicates the target process's data model.
+.Pp
To help deal with system data structures that are read from 32-bit processes, a
64-bit controlling program can be compiled with the C preprocessor symbol
-\fB_SYSCALL32\fR defined before system header files are included. This makes
-explicit 32-bit fixed-width data structures (like \fBcstruct stat32\fR) visible
-to the 64-bit program. See \fBtypes32.h\fR(3HEAD).
-.SH DIRECTORY STRUCTURE
-.LP
-At the top level, the directory \fB/proc\fR contains entries each of which
-names an existing process in the system. These entries are themselves
-directories. Except where otherwise noted, the files described below can be
-opened for reading only. In addition, if a process becomes a \fIzombie\fR (one
-that has exited but whose parent has not yet performed a \fBwait\fR(3C) upon
-it), most of its associated \fB/proc\fR files disappear from the hierarchy;
-subsequent attempts to open them, or to read or write files opened before the
-process exited, will elicit the error \fBENOENT\fR.
-.sp
-.LP
-Although process state and consequently the contents of \fB/proc\fR files can
-change from instant to instant, a single \fBread\fR(2) of a \fB/proc\fR file is
-guaranteed to return a sane representation of state; that is, the read will be
-atomic with respect to the state of the process. No such guarantee applies to
-successive reads applied to a \fB/proc\fR file for a running process. In
-addition, atomicity is not guaranteed for \fBI/O\fR applied to the \fBas\fR
+.Dv _SYSCALL32
+defined before system header files are included.
+This makes explicit 32-bit fixed-width data structures (like
+.Sy struct stat32 )
+visible to the 64-bit program.
+See
+.Xr types32.h 3HEAD .
+.Sh DIRECTORY STRUCTURE
+At the top level, the directory
+.Pa /proc
+contains entries each of which names an existing process in the system.
+These entries are themselves directories.
+Except where otherwise noted, the files described below can be
+opened for reading only.
+In addition, if a process becomes a
+.Em zombie
+(one that has exited but whose parent has not yet performed a
+.Xr wait 3C
+upon it), most of its associated
+.Pa /proc
+files disappear from the hierarchy; subsequent attempts to open them, or to
+read or write files opened before the process exited, will elicit the error
+.Er ENOENT .
+.Pp
+Although process state and consequently the contents of
+.Pa /proc
+files can change from instant to instant, a single
+.Xr read 2
+of a
+.Pa /proc
+file is guaranteed to return a sane representation of state; that is, the read
+will be atomic with respect to the state of the process.
+No such guarantee applies to successive reads applied to a
+.Pa /proc
+file for a running process.
+In addition, atomicity is not guaranteed for
+.Sy I/O
+applied to the
+.Pa as
(address-space) file for a running process or for a process whose address space
contains memory shared by another running process.
-.sp
-.LP
-A number of structure definitions are used to describe the files. These
-structures may grow by the addition of elements at the end in future releases
-of the system and it is not legitimate for a program to assume that they will
-not.
-.SH STRUCTURE OF \fB/proc/\fR\fIpid\fR
-.LP
-A given directory \fB/proc/\fR\fIpid\fR contains the following entries. A
-process can use the invisible alias \fB/proc/self\fR if it wishes to open one
-of its own \fB/proc\fR files (invisible in the sense that the name ``self''
-does not appear in a directory listing of \fB/proc\fR obtained from
-\fBls\fR(1), \fBgetdents\fR(2), or \fBreaddir\fR(3C)).
-.SS "contracts"
-.LP
-A directory containing references to the contracts held by the process. Each
-entry is a symlink to the contract's directory under \fB/system/contract\fR.
-See \fBcontract\fR(4).
-.SS "as"
-.LP
+.Pp
+A number of structure definitions are used to describe the files.
+These structures may grow by the addition of elements at the end in future
+releases of the system and it is not legitimate for a program to assume that
+they will not.
+.Sh STRUCTURE OF Pa /proc/ Ns Em pid
+A given directory
+.Pa /proc/ Ns Em pid
+contains the following entries.
+A process can use the invisible alias
+.Pa /proc/self
+if it wishes to open one of its own
+.Pa /proc
+files (invisible in the sense that the name
+.Dq self
+does not appear in a directory listing of
+.Pa /proc
+obtained from
+.Xr ls 1 ,
+.Xr getdents 2 ,
+or
+.Xr readdir 3C ) .
+.Ss contracts
+A directory containing references to the contracts held by the process.
+Each entry is a symlink to the contract's directory under
+.Pa /system/contract .
+See
+.Xr contract 4 .
+.Ss as
Contains the address-space image of the process; it can be opened for both
-reading and writing. \fBlseek\fR(2) is used to position the file at the virtual
-address of interest and then the address space can be examined or changed
-through \fBread\fR(2) or \fBwrite\fR(2) (or by using \fBpread\fR(2) or
-\fBpwrite\fR(2) for the combined operation).
-.SS "ctl"
-.LP
+reading and writing.
+.Xr lseek 2
+is used to position the file at the virtual address of interest and then the
+address space can be examined or changed through
+.Xr read 2
+or
+.Xr write 2
+(or by using
+.Xr pread 2
+or
+.Xr pwrite 2
+for the combined operation).
+.Ss ctl
A write-only file to which structured messages are written directing the system
to change some aspect of the process's state or control its behavior in some
-way. The seek offset is not relevant when writing to this file. Individual lwps
-also have associated \fBlwpctl\fR files in the lwp subdirectories. A control
-message may be written either to the process's \fBctl\fR file or to a specific
-\fBlwpctl\fR file with operation-specific effects. The effect of a control
-message is immediately reflected in the state of the process visible through
-appropriate status and information files. The types of control messages are
-described in detail later. See \fBCONTROL MESSAGES\fR.
-.SS "status"
-.LP
-Contains state information about the process and the representative lwp. The
-file contains a \fBpstatus\fR structure which contains an embedded
-\fBlwpstatus\fR structure for the representative lwp, as follows:
-.sp
-.in +2
-.nf
+way.
+The seek offset is not relevant when writing to this file.
+Individual lwps also have associated
+.Pa lwpctl
+files in the lwp subdirectories.
+A control message may be written either to the process's
+.Pa ctl
+file or to a specific
+.Pa lwpctl
+file with operation-specific effects.
+The effect of a control message is immediately reflected in the state of the
+process visible through appropriate status and information files.
+The types of control messages are described in detail later.
+See
+.Sx CONTROL MESSAGES .
+.Ss status
+Contains state information about the process and the representative lwp.
+The file contains a
+.Sy pstatus
+structure which contains an embedded
+.Sy lwpstatus
+structure for the representative lwp, as follows:
+.Bd -literal -offset 2
typedef struct pstatus {
int pr_flags; /* flags (see below) */
int pr_nlwp; /* number of active lwps in the process */
@@ -265,204 +418,166 @@ typedef struct pstatus {
zoneid_t pr_zoneid; /* zone id */
lwpstatus_t pr_lwp; /* status of the representative lwp */
} pstatus_t;
-.fi
-.in -2
-
-.sp
-.LP
-\fBpr_flags\fR is a bit-mask holding the following process flags. For
-convenience, it also contains the lwp flags for the representative lwp,
+.Ed
+.Pp
+.Sy pr_flags
+is a bit-mask holding the following process flags.
+For convenience, it also contains the lwp flags for the representative lwp,
described later.
-.sp
-.ne 2
-.na
-\fB\fBPR_ISSYS\fR\fR
-.ad
-.RS 13n
-process is a system process (see \fBPCSTOP\fR).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPR_VFORKP\fR\fR
-.ad
-.RS 13n
-process is the parent of a vforked child (see \fBPCWATCH\fR).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPR_FORK\fR\fR
-.ad
-.RS 13n
-process has its inherit-on-fork mode set (see \fBPCSET\fR).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPR_RLC\fR\fR
-.ad
-.RS 13n
-process has its run-on-last-close mode set (see \fBPCSET\fR).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPR_KLC\fR\fR
-.ad
-.RS 13n
-process has its kill-on-last-close mode set (see \fBPCSET\fR).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPR_ASYNC\fR\fR
-.ad
-.RS 13n
-process has its asynchronous-stop mode set (see \fBPCSET\fR).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPR_MSACCT\fR\fR
-.ad
-.RS 13n
+.Bl -tag -width "PR_MSACCT" -offset indent
+.It Sy PR_ISSYS
+process is a system process (see
+.Sx PCSTOP ) .
+.It Sy PR_VFORKP
+process is the parent of a vforked child (see
+.Sx PCWATCH ) .
+.It Sy PR_FORK
+process has its inherit-on-fork mode set (see
+.Sx PCSET ) .
+.It Sy PR_RLC
+process has its run-on-last-close mode set (see
+.Sx PCSET ) .
+.It Sy PR_KLC
+process has its kill-on-last-close mode set (see
+.Sx PCSET ) .
+.It Sy PR_ASYNC
+process has its asynchronous-stop mode set (see
+.Sx PCSET ) .
+.It Sy PR_MSACCT
Set by default in all processes to indicate that microstate accounting is
-enabled. However, this flag has been deprecated and no longer has any effect.
+enabled.
+However, this flag has been deprecated and no longer has any effect.
Microstate accounting may not be disabled; however, it is still possible to
toggle the flag.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPR_MSFORK\fR\fR
-.ad
-.RS 13n
+.It Sy PR_MSFORK
Set by default in all processes to indicate that microstate accounting will be
-enabled for processes that this parent forks(). However, this flag has been
-deprecated and no longer has any effect. It is possible to toggle this flag;
-however, it is not possible to disable microstate accounting.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPR_BPTADJ\fR\fR
-.ad
-.RS 13n
-process has its breakpoint adjustment mode set (see \fBPCSET\fR).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPR_PTRACE\fR\fR
-.ad
-.RS 13n
-process has its ptrace-compatibility mode set (see \fBPCSET\fR).
-.RE
-
-.sp
-.LP
-\fBpr_nlwp\fR is the total number of active lwps in the process. pr_nzomb is
-the total number of zombie lwps in the process. A zombie lwp is a non-detached
-lwp that has terminated but has not been reaped with \fBthr_join\fR(3C) or
-\fBpthread_join\fR(3C).
-.sp
-.LP
-\fBpr_pid\fR, \fBpr_ppid\fR, \fBpr_pgid\fR, and \fBpr_sid\fR are, respectively,
-the process ID, the ID of the process's parent, the process's process group ID,
-and the process's session ID.
-.sp
-.LP
-\fBpr_aslwpid\fR is obsolete and is always zero.
-.sp
-.LP
-\fBpr_agentid\fR is the lwp-ID for the \fB/proc\fR agent lwp (see the
-\fBPCAGENT\fR control operation). It is zero if there is no agent lwp in the
-process.
-.sp
-.LP
-\fBpr_sigpend\fR identifies asynchronous signals pending for the process.
-.sp
-.LP
-\fBpr_brkbase\fR is the virtual address of the process heap and
-\fBpr_brksize\fR is its size in bytes. The address formed by the sum of these
-values is the process \fBbreak\fR (see \fBbrk\fR(2)). \fBpr_stkbase\fR and
-\fBpr_stksize\fR are, respectively, the virtual address of the process stack
-and its size in bytes. (Each lwp runs on a separate stack; the distinguishing
-characteristic of the process stack is that the operating system will grow it
-when necessary.)
-.sp
-.LP
-\fBpr_utime\fR, \fBpr_stime\fR, \fBpr_cutime\fR, and \fBpr_cstime\fR are,
-respectively, the user \fBCPU\fR and system \fBCPU\fR time consumed by the
-process, and the cumulative user \fBCPU\fR and system \fBCPU\fR time consumed
-by the process's children, in seconds and nanoseconds.
-.sp
-.LP
-\fBpr_sigtrace\fR and \fBpr_flttrace\fR contain, respectively, the set of
-signals and the set of hardware faults that are being traced (see
-\fBPCSTRACE\fR and \fBPCSFAULT\fR).
-.sp
-.LP
-\fBpr_sysentry\fR and \fBpr_sysexit\fR contain, respectively, the sets of
-system calls being traced on entry and exit (see \fBPCSENTRY\fR and
-\fBPCSEXIT\fR).
-.sp
-.LP
-\fBpr_dmodel\fR indicates the data model of the process. Possible values are:
-.sp
-.ne 2
-.na
-\fB\fBPR_MODEL_ILP32\fR\fR
-.ad
-.RS 19n
+enabled for processes that this parent forks().
+However, this flag has been deprecated and no longer has any effect.
+It is possible to toggle this flag; however, it is not possible to disable
+microstate accounting.
+.It Sy PR_BPTADJ
+process has its breakpoint adjustment mode set (see
+.Sx PCSET ) .
+.It Sy PR_PTRACE
+process has its ptrace-compatibility mode set (see
+.Sx PCSET ) .
+.El
+.Pp
+.Sy pr_nlwp
+is the total number of active lwps in the process.
+.Sy pr_nzomb
+is the total number of zombie lwps in the process.
+A zombie lwp is a non-detached lwp that has terminated but has not been reaped
+with
+.Xr thr_join 3
+or
+.Xr pthread_join 3C .
+.Pp
+.Sy pr_pid ,
+.Sy pr_ppi ,
+.Sy pr_pgid ,
+and
+.Sy pr_sid
+are, respectively, the process ID, the ID of the process's parent, the
+process's process group ID, and the process's session ID.
+.Pp
+.Sy pr_aslwpid
+is obsolete and is always zero.
+.Pp
+.Sy pr_agentid
+is the lwp-ID for the
+.Pa /proc
+agent lwp (see the
+.Sx PCAGENT
+control operation).
+It is zero if there is no agent lwp in the process.
+.Pp
+.Sy pr_sigpend
+identifies asynchronous signals pending for the process.
+.Pp
+.Sy pr_brkbase
+is the virtual address of the process heap and
+.Sy pr_brksize
+is its size in bytes.
+The address formed by the sum of these values is the process
+.Sy break
+(see
+.Xr brk 2 ) .
+.Sy pr_stkbase
+and
+.Sy pr_stksize
+are, respectively, the virtual address of the process stack and its size in
+bytes.
+(Each lwp runs on a separate stack; the distinguishing characteristic of the
+process stack is that the operating system will grow it when necessary.)
+.Pp
+.Sy pr_utime ,
+.Sy pr_stime ,
+.Sy pr_cutime ,
+.Sy and pr_cstime
+are, respectively, the user
+.Sy CPU
+and system
+.Sy CPU
+time consumed by the process, and the cumulative user
+.Sy CPU
+and system
+.Sy CPU
+time consumed by the process's children, in seconds and nanoseconds.
+.Pp
+.Sy pr_sigtrace
+and
+.Sy pr_flttrace
+contain, respectively, the set of signals and the set of hardware faults that
+are being traced (see
+.Sx PCSTRACE
+and
+.Sx PCSFAULT ) .
+.Pp
+.Sy pr_sysentry
+and
+.Sy pr_sysexit
+contain, respectively, the sets of system calls being traced on entry and exit
+(see
+.Sx PCSENTRY
+and
+.Sx PCSEXIT ) .
+.Pp
+.Sy pr_dmodel
+indicates the data model of the process.
+Possible values are:
+.Bl -tag -width "PR_MODEL_NATIVE" -offset indent
+.It Sy PR_MODEL_ILP32
process data model is ILP32.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPR_MODEL_LP64\fR\fR
-.ad
-.RS 19n
+.It Sy PR_MODEL_LP64
process data model is LP64.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPR_MODEL_NATIVE\fR\fR
-.ad
-.RS 19n
+.It Sy PR_MODEL_NATIVE
process data model is native.
-.RE
-
-.sp
-.LP
-The \fBpr_taskid\fR, \fBpr_projid\fR, and \fBpr_zoneid\fR fields contain
-respectively, the numeric \fBID\fRs of the task, project, and zone in which the
-process was running.
-.sp
-.LP
-The constant \fBPR_MODEL_NATIVE\fR reflects the data model of the controlling
-process, \fIthat is\fR, its value is \fBPR_MODEL_ILP32\fR or
-\fBPR_MODEL_LP64\fR according to whether the controlling process has been
+.El
+.Pp
+The
+.Sy pr_taskid ,
+.Sy pr_projid ,
+and
+.Sy pr_zoneid
+fields contain respectively, the numeric
+.Sy ID Ns s
+of the task, project, and zone in which the process was running.
+.Pp
+The constant
+.Sy PR_MODEL_NATIVE
+reflects the data model of the controlling process,
+.Em that is ,
+its value is
+.Sy PR_MODEL_ILP32
+or
+.Sy PR_MODEL_LP64
+according to whether the controlling process has been
compiled as a 32-bit program or a 64-bit program, respectively.
-.sp
-.LP
-\fBpr_lwp\fR contains the status information for the representative lwp:
-.sp
-.in +2
-.nf
+.Pp
+.Sy pr_lwp
+contains the status information for the representative lwp:
+.Bd -literal -offset 2
typedef struct lwpstatus {
int pr_flags; /* flags (see below) */
id_t pr_lwpid; /* specific lwp identifier */
@@ -490,382 +605,355 @@ typedef struct lwpstatus {
prgregset_t pr_reg; /* general registers */
prfpregset_t pr_fpreg; /* floating-point registers */
} lwpstatus_t;
-.fi
-.in -2
-
-.sp
-.LP
-\fBpr_flags\fR is a bit-mask holding the following lwp flags. For convenience,
-it also contains the process flags, described previously.
-.sp
-.ne 2
-.na
-\fB\fBPR_STOPPED\fR\fR
-.ad
-.RS 14n
+.Ed
+.Pp
+.Sy pr_flags
+is a bit-mask holding the following lwp flags.
+For convenience, it also contains the process flags, described previously.
+.Bl -tag -width "PR_STOPPED" -offset indent
+.It Sy PR_STOPPED
The lwp is stopped.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPR_ISTOP\fR\fR
-.ad
-.RS 14n
-The lwp is stopped on an event of interest (see \fBPCSTOP\fR).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPR_DSTOP\fR\fR
-.ad
-.RS 14n
-The lwp has a stop directive in effect (see \fBPCSTOP\fR).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPR_STEP\fR\fR
-.ad
-.RS 14n
-The lwp has a single-step directive in effect (see \fBPCRUN\fR).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPR_ASLEEP\fR\fR
-.ad
-.RS 14n
+.It Sy PR_ISTOP
+The lwp is stopped on an event of interest (see
+.Sx PCSTOP ) .
+.It Sy PR_DSTOP
+The lwp has a stop directive in effect (see
+.Sx PCSTOP ) .
+.It Sy PR_STEP
+The lwp has a single-step directive in effect (see
+.Sx PCRUN ) .
+.It Sy PR_ASLEEP
The lwp is in an interruptible sleep within a system call.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPR_PCINVAL\fR\fR
-.ad
-.RS 14n
-The lwp's current instruction (\fBpr_instr\fR) is undefined.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPR_DETACH\fR\fR
-.ad
-.RS 14n
-This is a detached lwp (see \fBpthread_create\fR(3C) and
-\fBpthread_join\fR(3C)).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPR_DAEMON\fR\fR
-.ad
-.RS 14n
-This is a daemon lwp (see \fBpthread_create\fR(3C)).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPR_ASLWP\fR\fR
-.ad
-.RS 14n
+.It Sy PR_PCINVAL
+The lwp's current instruction
+.Pq Sy pr_instr
+is undefined.
+.It Sy PR_DETACH
+This is a detached lwp (see
+.Xr pthread_create 3C
+and
+.Xr pthread_join 3C ) .
+.It Sy PR_DAEMON
+This is a daemon lwp (see
+.Xr pthread_create 3C ) .
+.It Sy PR_ASLWP
This flag is obsolete and is never set.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPR_AGENT\fR\fR
-.ad
-.RS 14n
-This is the \fB/proc\fR agent lwp for the process.
-.RE
-
-.sp
-.LP
-\fBpr_lwpid\fR names the specific lwp.
-.sp
-.LP
-\fBpr_why\fR and \fBpr_what\fR together describe, for a stopped lwp, the reason
-for the stop. Possible values of \fBpr_why\fR and the associated \fBpr_what\fR
+.It Sy PR_AGENT
+This is the
+.Pa /proc
+agent lwp for the process.
+.El
+.Pp
+.Sy pr_lwpid
+names the specific lwp.
+.Pp
+.Sy pr_why
+.Sy and
+pr_what
+together describe, for a stopped lwp, the reason for the stop.
+Possible values of
+.Sy pr_why
+and the associated
+.Sy pr_what
are:
-.sp
-.ne 2
-.na
-\fB\fBPR_REQUESTED\fR\fR
-.ad
-.RS 17n
+.Bl -tag -width "PR_JOBCONTROL" -offset left
+.It Sy PR_REQUESTED
indicates that the stop occurred in response to a stop directive, normally
-because \fBPCSTOP\fR was applied or because another lwp stopped on an event of
-interest and the asynchronous-stop flag (see \fBPCSET\fR) was not set for the
-process. \fBpr_what\fR is unused in this case.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPR_SIGNALLED\fR\fR
-.ad
-.RS 17n
-indicates that the lwp stopped on receipt of a signal (see \fBPCSTRACE\fR);
-\fBpr_what\fR holds the signal number that caused the stop (for a newly-stopped
-lwp, the same value is in \fBpr_cursig\fR).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPR_FAULTED\fR\fR
-.ad
-.RS 17n
+because
+.Sy PCSTOP
+was applied or because another lwp stopped on an event of interest and the
+asynchronous-stop flag (see
+.Sx PCSET )
+was not set for the process.
+.Sy pr_what
+is unused in this case.
+.It Sy PR_SIGNALLED
+indicates that the lwp stopped on receipt of a signal (see
+.Sx PCSTRACE ) ;
+.Sy pr_what
+holds the signal number that caused the stop (for a newly-stopped
+lwp, the same value is in
+.Sy pr_cursig ) .
+.It Sy PR_FAULTED
indicates that the lwp stopped on incurring a hardware fault (see
-\fBPCSFAULT\fR); \fBpr_what\fR holds the fault number that caused the stop.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPR_SYSENTRY\fR\fR
-.ad
-.br
-.na
-\fB\fBPR_SYSEXIT\fR\fR
-.ad
-.RS 17n
-indicate a stop on entry to or exit from a system call (see \fBPCSENTRY\fR and
-\fBPCSEXIT\fR); \fBpr_what\fR holds the system call number.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPR_JOBCONTROL\fR\fR
-.ad
-.RS 17n
+.Sx PCSFAULT ) ;
+.Sy pr_what
+holds the fault number that caused the stop.
+.It Sy PR_SYSENTRY
+.It Sy PR_SYSEXIT
+indicate a stop on entry to or exit from a system call (see
+.Sx PCSENTRY
+and
+.Sx PCSEXIT ) ;
+.Sy pr_what
+holds the system call number.
+.It Sy PR_JOBCONTROL
indicates that the lwp stopped due to the default action of a job control stop
-signal (see \fBsigaction\fR(2)); \fBpr_what\fR holds the stopping signal
-number.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPR_SUSPENDED\fR\fR
-.ad
-.RS 17n
+signal (see
+.Xr sigaction 2 ) ;
+.Sy pr_what
+holds the stopping signal number.
+.It Sy PR_SUSPENDED
indicates that the lwp stopped due to internal synchronization of lwps within
-the process. \fBpr_what\fR is unused in this case.
-.RE
-
-.sp
-.LP
-\fBpr_cursig\fR names the current signal, that is, the next signal to be
-delivered to the lwp, if any. \fBpr_info\fR, when the lwp is in a
-\fBPR_SIGNALLED\fR or \fBPR_FAULTED\fR stop, contains additional information
-pertinent to the particular signal or fault (see \fB<sys/siginfo.h>\fR).
-.sp
-.LP
-\fBpr_lwppend\fR identifies any synchronous or directed signals pending for the
-lwp. \fBpr_lwphold\fR identifies those signals whose delivery is being blocked
-by the lwp (the signal mask).
-.sp
-.LP
-\fBpr_action\fR contains the signal action information pertaining to the
-current signal (see \fBsigaction\fR(2)); it is undefined if \fBpr_cursig\fR is
-zero. \fBpr_altstack\fR contains the alternate signal stack information for the
-lwp (see \fBsigaltstack\fR(2)).
-.sp
-.LP
-\fBpr_oldcontext\fR, if not zero, contains the address on the lwp stack of a
-\fBucontext\fR structure describing the previous user-level context (see
-\fBucontext.h\fR(3HEAD)). It is non-zero only if the lwp is executing in the
-context of a signal handler.
-.sp
-.LP
-\fBpr_syscall\fR is the number of the system call, if any, being executed by
-the lwp; it is non-zero if and only if the lwp is stopped on \fBPR_SYSENTRY\fR
-or \fBPR_SYSEXIT\fR, or is asleep within a system call ( \fBPR_ASLEEP\fR is
-set). If \fBpr_syscall\fR is non-zero, \fBpr_nsysarg\fR is the number of
-arguments to the system call and \fBpr_sysarg\fR contains the actual arguments.
-.sp
-.LP
-\fBpr_rval1\fR, \fBpr_rval2\fR, and \fBpr_errno\fR are defined only if the lwp
-is stopped on \fBPR_SYSEXIT\fR or if the \fBPR_VFORKP\fR flag is set. If
-\fBpr_errno\fR is zero, \fBpr_rval1\fR and \fBpr_rval2\fR contain the return
-values from the system call. Otherwise, \fBpr_errno\fR contains the error
-number for the failing system call (see \fB<sys/errno.h>\fR).
-.sp
-.LP
-\fBpr_clname\fR contains the name of the lwp's scheduling class.
-.sp
-.LP
-\fBpr_tstamp\fR, if the lwp is stopped, contains a time stamp marking when the
+the process.
+.Sy pr_what
+is unused in this case.
+.It Sy PR_BRAND
+indicates that the lwp stopped for a brand-specific reason.
+Interpretation of the value of
+.Sy pr_what
+depends on which zone brand is in use.
+It is not generally expected that an lwp stopped in this state will be
+restarted by native
+.\" mandoc(1) doesn't like .Xr macros referring to itself, so this is
+.\" a bit of a hack.
+.Nm Ns Pq 4
+consumers.
+.El
+.Pp
+.Sy pr_cursig
+names the current signal, that is, the next signal to be delivered to the lwp,
+if any.
+.Sy pr_info ,
+when the lwp is in a
+.Sy PR_SIGNALLED
+or
+.Sy PR_FAULTED
+stop, contains additional information pertinent to the particular signal or
+fault (see
+.In sys/siginfo.h ) .
+.Pp
+.Sy pr_lwppend
+identifies any synchronous or directed signals pending for the lwp.
+.Sy pr_lwphold
+identifies those signals whose delivery is being blocked by the lwp (the
+signal mask).
+.Pp
+.Sy pr_action
+contains the signal action information pertaining to the current signal (see
+.Xr sigaction 2 ) ;
+it is undefined if
+.Sy pr_cursig
+is zero.
+.Sy pr_altstack
+contains the alternate signal stack information for the lwp (see
+.Xr sigaltstack 2 ) .
+.Pp
+.Sy pr_oldcontext ,
+if not zero, contains the address on the lwp stack of a
+.Sy ucontext
+structure describing the previous user-level context (see
+.Xr ucontext.h 3HEAD ) .
+It is non-zero only if the lwp is executing in the context of a signal handler.
+.Pp
+.Sy pr_syscall
+is the number of the system call, if any, being executed by
+the lwp; it is non-zero if and only if the lwp is stopped on
+.Sy PR_SYSENTRY
+or
+.Sy PR_SYSEXIT ,
+or is asleep within a system call
+.Pf ( Sy PR_ASLEEP
+is set).
+If
+.Sy pr_syscall
+is non-zero,
+.Sy pr_nsysarg
+is the number of arguments to the system call and
+.Sy pr_sysarg
+contains the actual arguments.
+.Pp
+.Sy pr_rval1 ,
+.Sy pr_rval2 ,
+and
+.Sy pr_errno
+are defined only if the lwp
+is stopped on
+.Sy PR_SYSEXIT
+or if the
+.Sy PR_VFORKP
+flag is set.
+If
+.Sy pr_errno
+is zero,
+.Sy pr_rval1
+and
+.Sy pr_rval2
+contain the return values from the system call.
+Otherwise,
+.Sy pr_errno
+contains the error number for the failing system call (see
+.In sys/errno.h ) .
+.Pp
+.Sy pr_clname
+contains the name of the lwp's scheduling class.
+.Pp
+.Sy pr_tstamp ,
+if the lwp is stopped, contains a time stamp marking when the
lwp stopped, in real time seconds and nanoseconds since an arbitrary time in
the past.
-.sp
-.LP
-\fBpr_utime\fR is the amount of user level CPU time used by this LWP.
-.sp
-.LP
-\fBpr_stime\fR is the amount of system level CPU time used by this LWP.
-.sp
-.LP
-\fBpr_ustack\fR is the virtual address of the \fBstack_t\fR that contains the
-stack boundaries for this LWP. See \fBgetustack\fR(2) and
-\fB_stack_grow\fR(3C).
-.sp
-.LP
-\fBpr_instr\fR contains the machine instruction to which the lwp's program
-counter refers. The amount of data retrieved from the process is
-machine-dependent. On SPARC based machines, it is a 32-bit word. On x86-based
-machines, it is a single byte. In general, the size is that of the machine's
-smallest instruction. If \fBPR_PCINVAL\fR is set, \fBpr_instr\fR is undefined;
-this occurs whenever the lwp is not stopped or when the program counter refers
-to an invalid virtual address.
-.sp
-.LP
-\fBpr_reg\fR is an array holding the contents of a stopped lwp's general
-registers.
-.sp
-.ne 2
-.na
-\fBSPARC\fR
-.ad
-.RS 21n
-On SPARC-based machines, the predefined constants \fBR_G0\fR ... \fBR_G7\fR,
-\fBR_O0\fR ... \fBR_O7\fR, \fBR_L0\fR ... \fBR_L7\fR, \fBR_I0\fR ...
-\fBR_I7\fR, \fBR_PC\fR, \fBR_nPC\fR, and \fBR_Y\fR can be used as indices to
-refer to the corresponding registers; previous register windows can be read
-from their overflow locations on the stack (however, see the \fBgwindows\fR
-file in the \fB/proc/\fR\fIpid\fR\fB/lwp/\fR\fIlwpid\fR subdirectory).
-.RE
-
-.sp
-.ne 2
-.na
-\fBSPARC V8 (32-bit)\fR
-.ad
-.RS 21n
+.Pp
+.Sy pr_utime
+is the amount of user level CPU time used by this LWP.
+.Pp
+.Sy pr_stime
+is the amount of system level CPU time used by this LWP.
+.Pp
+.Sy pr_ustack
+is the virtual address of the
+.Sy stack_t
+that contains the stack boundaries for this LWP.
+See
+.Xr getustack 2
+and
+.Xr _stack_grow 3C .
+.Pp
+.Sy pr_instr
+contains the machine instruction to which the lwp's program counter refers.
+The amount of data retrieved from the process is machine-dependent.
+On SPARC based machines, it is a 32-bit word.
+On x86-based machines, it is a single byte.
+In general, the size is that of the machine's smallest instruction.
+If
+.Sy PR_PCINVAL
+is set,
+.Sy pr_instr
+is undefined; this occurs whenever the lwp is not stopped or when the program
+counter refers to an invalid virtual address.
+.Pp
+.Sy pr_reg
+is an array holding the contents of a stopped lwp's general registers.
+.Bl -tag -offset left -width "SPARC V8 (32-bit)"
+.It Sy SPARC
+On SPARC-based machines, the predefined constants
+.Sy R_G0
+\&.\&.\&.
+.Sy R_G7 ,
+.Sy R_O0
+\&.\&.\&.
+.Sy R_O7 ,
+.Sy R_L0
+\&.\&.\&.
+.Sy R_L7 ,
+.Sy R_I0
+\&.\&.\&.
+.Sy R_I7 ,
+.Sy R_PC ,
+.Sy R_nPC ,
+and
+.Sy R_Y
+can be used as indices to refer to the corresponding registers; previous
+register windows can be read from their overflow locations on the stack
+(however, see the
+.Pa gwindows
+file in the
+.Pa /proc/ Ns Em pid Ns Pa /lwp/ Ns Em lwpid
+subdirectory).
+.It Sy SPARC V8 (32-bit)
For SPARC V8 (32-bit) controlling processes, the predefined constants
-\fBR_PSR\fR, \fBR_WIM\fR, and \fBR_TBR\fR can be used as indices to refer to
-the corresponding special registers. For SPARC V9 (64-bit) controlling
-processes, the predefined constants \fBR_CCR\fR, \fBR_ASI\fR, and \fBR_FPRS\fR
+.Sy R_PSR ,
+.Sy R_WIM ,
+and
+.Sy R_TBR
can be used as indices to refer to the corresponding special registers.
-.RE
-
-.sp
-.ne 2
-.na
-\fBx86 (32-bit)\fR
-.ad
-.RS 21n
+For SPARC V9 (64-bit) controlling processes, the predefined constants
+.Sy R_CCR ,
+.Sy R_ASI ,
+and
+.Sy R_FPRS
+can be used as indices to refer to the corresponding special registers.
+.It Sy x86 (32-bit)
For 32-bit x86 processes, the predefined constants listed belowcan be used as
indices to refer to the corresponding registers.
-.sp
-.in +2
-.nf
-SS
-UESP
-EFL
-CS
-EIP
-ERR
-TRAPNO
-EAX
-ECX
-EDX
-EBX
-ESP
-EBP
-ESI
-EDI
-DS
-ES
-GS
-.fi
-.in -2
-
-The preceding constants are listed in \fB<sys/regset.h>\fR\&.
-.sp
+.Bl -tag -width "TRAPNO" -offset indent -compact
+.It SS
+.It UESP
+.It EFL
+.It CS
+.It EIP
+.It ERR
+.It TRAPNO
+.It EAX
+.It ECX
+.It EDX
+.It EBX
+.It ESP
+.It EBP
+.It ESI
+.It EDI
+.It DS
+.It ES
+.It GS
+.El
+.Pp
+The preceding constants are listed in
+.In sys/regset.h .
+.Pp
Note that a 32-bit process can run on an x86 64-bit system, using the constants
listed above.
-.RE
-
-.sp
-.ne 2
-.na
-\fBx86 (64-bit)\fR
-.ad
-.RS 21n
-To read the registers of a 32- \fBor\fR a 64-bit process, a 64-bit x86 process
-should use the predefined constants listed below.
-.sp
-.in +2
-.nf
-REG_GSBASE
-REG_FSBASE
-REG_DS
-REG_ES
-REG_GS
-REG_FS
-REG_SS
-REG_RSP
-REG_RFL
-REG_CS
-REG_RIP
-REG_ERR
-REG_TRAPNO
-REG_RAX
-REG_RCX
-REG_RDX
-REG_RBX
-REG_RBP
-REG_RSI
-REG_RDI
-REG_R8
-REG_R9
-REG_R10
-REG_R11
-REG_R12
-REG_R13
-REG_R14
-REG_R15
-.fi
-.in -2
-
-The preceding constants are listed in \fB<sys/regset.h>\fR\&.
-.RE
-
-.sp
-.LP
-\fBpr_fpreg\fR is a structure holding the contents of the floating-point
-registers.
-.sp
-.LP
+.It Sy x86 (64-bit)
+To read the registers of a 32-
+.Em or
+a 64-bit process, a 64-bit x86 process should use the predefined constants
+listed below.
+.Bl -tag -width "REG_TRAPNO" -offset indent -compact
+.It REG_GSBASE
+.It REG_FSBASE
+.It REG_DS
+.It REG_ES
+.It REG_GS
+.It REG_FS
+.It REG_SS
+.It REG_RSP
+.It REG_RFL
+.It REG_CS
+.It REG_RIP
+.It REG_ERR
+.It REG_TRAPNO
+.It REG_RAX
+.It REG_RCX
+.It REG_RDX
+.It REG_RBX
+.It REG_RBP
+.It REG_RSI
+.It REG_RDI
+.It REG_R8
+.It REG_R9
+.It REG_R10
+.It REG_R11
+.It REG_R12
+.It REG_R13
+.It REG_R14
+.It REG_R15
+.El
+.Pp
+The preceding constants are listed in
+.In sys/regset.h .
+.El
+.Pp
+.Sy pr_fpreg
+is a structure holding the contents of the floating-point registers.
+.Pp
SPARC registers, both general and floating-point, as seen by a 64-bit
controlling process are the V9 versions of the registers, even if the target
-process is a 32-bit (V8) process. V8 registers are a subset of the V9
-registers.
-.sp
-.LP
+process is a 32-bit (V8) process.
+V8 registers are a subset of the V9 registers.
+.Pp
If the lwp is not stopped, all register values are undefined.
-.SS "psinfo"
-.LP
+.Ss psinfo
Contains miscellaneous information about the process and the representative lwp
-needed by the \fBps\fR(1) command. \fBpsinfo\fR remains accessible after a
-process becomes a \fIzombie\fR. The file contains a \fBpsinfo\fR structure
-which contains an embedded \fBlwpsinfo\fR structure for the representative lwp,
-as follows:
-.sp
-.in +2
-.nf
+needed by the
+.Xr ps 1
+command.
+.Sy psinfo
+remains accessible after a process becomes a
+.Em zombie .
+The file contains a
+.Sy psinfo
+structure which contains an embedded
+.Sy lwpsinfo
+structure for the representative lwp, as follows:
+.Bd -literal -offset 2
typedef struct psinfo {
int pr_flag; /* process flags (DEPRECATED: see below) */
int pr_nlwp; /* number of active lwps in the process */
@@ -901,34 +989,65 @@ typedef struct psinfo {
zoneid_t pr_zoneid; /* zone id */
ctid_t pr_contract; /* process contract id */
} psinfo_t;
-.fi
-.in -2
-
-.sp
-.LP
-Some of the entries in \fBpsinfo\fR, such as \fBpr_addr\fR, refer to internal
-kernel data structures and should not be expected to retain their meanings
-across different versions of the operating system.
-.sp
-.LP
-\fBpsinfo_t.pr_flag\fR is a deprecated interface that should no longer be used.
-Applications currently relying on the \fBSSYS\fR bit in \fBpr_flag\fR should
-migrate to checking \fBPR_ISSYS\fR in the \fBpstatus\fR structure's
-\fBpr_flags\fR field.
-.sp
-.LP
-\fBpr_pctcpu\fR and \fBpr_pctmem\fR are 16-bit binary fractions in the range
-0.0 to 1.0 with the binary point to the right of the high-order bit (1.0 ==
-0x8000). \fBpr_pctcpu\fR is the summation over all lwps in the process.
-.sp
-.LP
-\fBpr_lwp\fR contains the \fBps\fR(1) information for the representative lwp.
-If the process is a \fIzombie\fR, \fBpr_nlwp\fR, \fBpr_nzomb\fR, and
-\fBpr_lwp.pr_lwpid\fR are zero and the other fields of \fBpr_lwp\fR are
-undefined:
-.sp
-.in +2
-.nf
+.Ed
+.Pp
+Some of the entries in
+.Sy psinfo ,
+such as
+.Sy pr_addr ,
+refer to internal kernel data structures and should not be expected to retain
+their meanings across different versions of the operating system.
+.Pp
+.Sy psinfo_t.pr_flag
+is a deprecated interface that should no longer be used.
+Applications currently relying on the
+.Sy SSYS
+bit in
+.Sy pr_flag
+should migrate to checking
+.Sy PR_ISSYS
+in the
+.Sy pstatus
+structure's
+.Sy pr_flags
+field.
+.Pp
+.Sy pr_pctcpu
+and
+.Sy pr_pctmem
+are 16-bit binary fractions in the range 0.0 to 1.0 with the binary point to
+the right of the high-order bit (1.0 == 0x8000).
+.Sy pr_pctcpu
+is the summation over all lwps in the process.
+.Pp
+The
+.Sy pr_fname
+and
+.Sy pr_psargs
+are writable by the owner of the process.
+To write to them, the
+.Sy psinfo
+file should be open for writing and the desired value for the field should be
+written at the file offset that corresponds to the member of structure.
+No other entry may be written to; if a write is attempted to an offset that
+does not represent one of these two memers, or if the size of the write is not
+exactly the size of the member being written, no bytes will be written and
+zero will be returned.
+.Pp
+.Sy pr_lwp
+contains the
+.Xr ps 1
+information for the representative lwp.
+If the process is a
+.Em zombie ,
+.Sy pr_nlwp ,
+.Sy pr_nzomb ,
+and
+.Sy pr_lwp.pr_lwpid
+are zero and the other fields of
+.Sy pr_lwp
+are undefined:
+.Bd -literal -offset 2
typedef struct lwpsinfo {
int pr_flag; /* lwp flags (DEPRECATED: see below) */
id_t pr_lwpid; /* lwp id */
@@ -952,34 +1071,41 @@ typedef struct lwpsinfo {
psetid_t pr_bindpset; /* processor set to which lwp is bound */
lgrp_id_t pr_lgrp /* home lgroup */
} lwpsinfo_t;
-.fi
-.in -2
-
-.sp
-.LP
-Some of the entries in \fBlwpsinfo\fR, such as \fBpr_addr\fR, \fBpr_wchan\fR,
-\fBpr_stype\fR, \fBpr_state\fR, and \fBpr_name\fR, refer to internal kernel
-data structures and should not be expected to retain their meanings across
-different versions of the operating system.
-.sp
-.LP
-\fBlwpsinfo_t.pr_flag\fR is a deprecated interface that should no longer be
-used.
-.sp
-.LP
-\fBpr_pctcpu\fR is a 16-bit binary fraction, as described above. It represents
-the \fBCPU\fR time used by the specific lwp. On a multi-processor machine, the
-maximum value is 1/N, where N is the number of \fBCPU\fRs.
-.sp
-.LP
-\fBpr_contract\fR is the id of the process contract of which the process is a
-member. See \fBcontract\fR(4) and \fBprocess\fR(4).
-.SS "cred"
-.LP
+.Ed
+.Pp
+Some of the entries in
+.Sy lwpsinfo ,
+such as
+.Sy pr_addr ,
+.Sy pr_wchan ,
+.Sy pr_stype ,
+.Sy pr_state ,
+and
+.Sy pr_name ,
+refer to internal kernel data structures and should not be expected to retain
+their meanings across different versions of the operating system.
+.Pp
+.Sy lwpsinfo_t.pr_flag
+is a deprecated interface that should no longer be used.
+.Pp
+.Sy pr_pctcpu
+is a 16-bit binary fraction, as described above.
+It represents the
+.Sy CPU
+time used by the specific lwp.
+On a multi-processor machine, the maximum value is 1/N, where N is the number
+of
+.Sy CPU Ns s .
+.Pp
+.Sy pr_contract
+is the id of the process contract of which the process is a member.
+See
+.Xr contract 4
+and
+.Xr process 4 .
+.Ss cred
Contains a description of the credentials associated with the process:
-.sp
-.in +2
-.nf
+.Bd -literal -offset 2
typedef struct prcred {
uid_t pr_euid; /* effective user id */
uid_t pr_ruid; /* real user id */
@@ -990,56 +1116,46 @@ typedef struct prcred {
int pr_ngroups; /* number of supplementary groups */
gid_t pr_groups[1]; /* array of supplementary groups */
} prcred_t;
-.fi
-.in -2
-.sp
-
-.sp
-.LP
-The array of associated supplementary groups in \fBpr_groups\fR is of variable
-length; the \fBcred\fR file contains all of the supplementary groups.
-\fBpr_ngroups\fR indicates the number of supplementary groups. (See also the
-\fBPCSCRED\fR and \fBPCSCREDX\fR control operations.)
-.SS "priv"
-.LP
+.Ed
+.Pp
+The array of associated supplementary groups in
+.Sy pr_groups
+ is of variable
+length; the
+.Sy cred
+file contains all of the supplementary groups.
+.Sy pr_ngroups
+indicates the number of supplementary groups. (See also the
+.Sy PCSCRED
+and
+.Sy PCSCREDX
+control operations.)
+.Ss priv
Contains a description of the privileges associated with the process:
-.sp
-.in +2
-.nf
+.Bd -literal -offset 2
typedef struct prpriv {
uint32_t pr_nsets; /* number of privilege set */
uint32_t pr_setsize; /* size of privilege set */
uint32_t pr_infosize; /* size of supplementary data */
priv_chunk_t pr_sets[1]; /* array of sets */
} prpriv_t;
-.fi
-.in -2
-
-.sp
-.LP
-The actual dimension of the \fBpr_sets\fR[] field is
-.sp
-.in +2
-.nf
-pr_sets[pr_nsets][pr_setsize]
-.fi
-.in -2
-
-.sp
-.LP
+.Ed
+.Pp
+The actual dimension of the
+.Sy pr_sets Ns []
+field is
+.D1 pr_sets[pr_nsets][pr_setsize]
+.Pp
which is followed by additional information about the process state
-\fBpr_infosize\fR bytes in size.
-.sp
-.LP
+.Sy pr_infosize
+bytes in size.
+.Pp
The full size of the structure can be computed using
-\fBPRIV_PRPRIV_SIZE\fR(\fBprpriv_t *\fR).
-.SS "secflags"
-.LP
-This file contains the security-flags of the process. It contains a
-description of the security flags associated with the process.
-.sp
-.in +2
-.nf
+.Fn PRIV_PRPRIV_SIZE "prpriv_t *" .
+.Ss secflags
+This file contains the security-flags of the process.
+It contains a description of the security flags associated with the process.
+.Bd -literal -offset 2
typedef struct prsecflags {
uint32_t pr_version; /* ABI Versioning of this structure */
secflagset_t pr_effective; /* Effective flags */
@@ -1047,41 +1163,64 @@ typedef struct prsecflags {
secflagset_t pr_lower; /* Lower flags */
secflagset_t pr_upper; /* Upper flags */
} prsecflags_t;
-.in -2
-
-.sp
-.LP
-The \fBpr_version\fR field is a version number for the structure, currently
-\fBPRSECFLAGS_VERSION_1\fR.
-.SS "sigact"
-.LP
-Contains an array of \fBsigaction structures\fR describing the current
-dispositions of all signals associated with the traced process (see
-\fBsigaction\fR(2)). Signal numbers are displaced by 1 from array indices, so
-that the action for signal number \fIn\fR appears in position \fIn\fR-1 of the
-array.
-.SS "auxv"
-.LP
+.Ed
+.Pp
+The
+.Sy pr_version
+field is a version number for the structure, currently
+.Sy PRSECFLAGS_VERSION_1 .
+.Ss sigact
+Contains an array of
+.Sy sigaction structures
+describing the current dispositions of all signals associated with the traced
+process (see
+.Xr sigaction 2 ) .
+Signal numbers are displaced by 1 from array indices, so that the action for
+signal number
+.Va n
+appears in position
+.Va n Ns -1
+of the array.
+.Ss auxv
Contains the initial values of the process's aux vector in an array of
-\fBauxv_t\fR structures (see \fB<sys/auxv.h>\fR). The values are those that
-were passed by the operating system as startup information to the dynamic
-linker.
-.SS "ldt"
-.LP
-This file exists only on x86-based machines. It is non-empty only if the
-process has established a local descriptor table (\fBLDT\fR). If non-empty, the
-file contains the array of currently active \fBLDT\fR entries in an array of
-elements of type \fBstruct ssd\fR, defined in \fB<sys/sysi86.h>\fR, one element
-for each active \fBLDT\fR entry.
-.SS "map, xmap"
-.LP
-Contain information about the virtual address map of the process. The map file
-contains an array of \fBprmap\fR structures while the xmap file contains an
-array of \fBprxmap\fR structures. Each structure describes a contiguous virtual
+.Sy auxv_t
+structures (see
+.In sys/auxv.h ) .
+The values are those that were passed by the operating system as startup
+information to the dynamic linker.
+.Ss argv
+Contains the concatenation of each of the argument strings, including their
+.Sy NUL
+terminators, in the argument vector
+.Pq Va argv
+for the process.
+If the process has modified either its argument vector, or the contents of
+any of the strings referenced by that vector, those changes will be visible
+here.
+.Ss ldt
+This file exists only on x86-based machines.
+It is non-empty only if the process has established a local descriptor table
+.Pq Sy LDT .
+If non-empty, the file contains the array of currently active
+.Sy LDT
+entries in an array of elements of type
+.Vt struct ssd ,
+defined in
+.In sys/sysi86.h ,
+one element for each active
+.Sy LDT
+entry.
+.Ss map, xmap
+Contain information about the virtual address map of the process.
+The map file contains an array of
+.Sy prmap
+structures while the xmap file contains an
+array of
+.Sy prxmap
+structures.
+Each structure describes a contiguous virtual
address region in the address space of the traced process:
-.sp
-.in +2
-.nf
+.Bd -literal -offset 2
typedef struct prmap {
uintptr_tpr_vaddr; /* virtual address of mapping */
size_t pr_size; /* size of mapping in bytes */
@@ -1091,13 +1230,8 @@ typedef struct prmap {
int pr_pagesize; /* pagesize for this mapping in bytes */
int pr_shmid; /* SysV shared memory identifier */
} prmap_t;
-.fi
-.in -2
-.sp
-
-.sp
-.in +2
-.nf
+.Ed
+.Bd -literal -offset 2
typedef struct prxmap {
uintptr_t pr_vaddr; /* virtual address of mapping */
size_t pr_size; /* size of mapping in bytes */
@@ -1113,222 +1247,229 @@ typedef struct prxmap {
size_t pr_locked; /* pages of locked memory */
uint64_t pr_hatpagesize; /* pagesize of mapping */
} prxmap_t;
-.fi
-.in -2
-.sp
-
-.sp
-.LP
-\fBpr_vaddr\fR is the virtual address of the mapping within the traced process
-and \fBpr_size\fR is its size in bytes. \fBpr_mapname\fR, if it does not
-contain a null string, contains the name of a file in the \fBobject\fR
+.Ed
+.Pp
+.Sy pr_vaddr
+is the virtual address of the mapping within the traced process and
+.Sy pr_size
+is its size in bytes.
+.Sy pr_mapname ,
+if it does not contain a null string, contains the name of a file in the
+.Sy object
directory (see below) that can be opened read-only to obtain a file descriptor
-for the mapped file associated with the mapping. This enables a debugger to
-find object file symbol tables without having to know the real path names of
-the executable file and shared libraries of the process. \fBpr_offset\fR is the
-64-bit offset within the mapped file (if any) to which the virtual address is
-mapped.
-.sp
-.LP
-\fBpr_mflags\fR is a bit-mask of protection and attribute flags:
-.sp
-.ne 2
-.na
-\fB\fBMA_READ\fR\fR
-.ad
-.RS 17n
+for the mapped file associated with the mapping.
+This enables a debugger to find object file symbol tables without having to
+know the real path names of the executable file and shared libraries of
+the process.
+.Sy pr_offset
+is the 64-bit offset within the mapped file (if any) to which the virtual
+address is mapped.
+.Pp
+.Sy pr_mflags
+is a bit-mask of protection and attribute flags:
+.Bl -tag -width "MA_NORESERVE" -offset left
+.It Sy MA_READ
mapping is readable by the traced process.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBMA_WRITE\fR\fR
-.ad
-.RS 17n
+.It Sy MA_WRITE
mapping is writable by the traced process.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBMA_EXEC\fR\fR
-.ad
-.RS 17n
+.It Sy MA_EXEC
mapping is executable by the traced process.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBMA_SHARED\fR\fR
-.ad
-.RS 17n
+.It Sy MA_SHARED
mapping changes are shared by the mapped object.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBMA_ISM\fR\fR
-.ad
-.RS 17n
+.It Sy MA_ISM
mapping is intimate shared memory (shared MMU resources)
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBMAP_NORESERVE\fR\fR
-.ad
-.RS 17n
+.It Sy MAP_NORESERVE
mapping does not have swap space reserved (mapped with MAP_NORESERVE)
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBMA_SHM\fR\fR
-.ad
-.RS 17n
+.It Sy MA_SHM
mapping System V shared memory
-.RE
-
-.sp
-.LP
+.El
+.Pp
A contiguous area of the address space having the same underlying mapped object
may appear as multiple mappings due to varying read, write, and execute
-attributes. The underlying mapped object does not change over the range of a
-single mapping. An \fBI/O\fR operation to a mapping marked \fBMA_SHARED\fR
+attributes.
+The underlying mapped object does not change over the range of a
+single mapping.
+An
+.Sy I/O
+operation to a mapping marked
+.Sy MA_SHARED
fails if applied at a virtual address not corresponding to a valid page in the
-underlying mapped object. A write to a \fBMA_SHARED\fR mapping that is not
-marked \fBMA_WRITE\fR fails. Reads and writes to private mappings always
-succeed. Reads and writes to unmapped addresses fail.
-.sp
-.LP
-\fBpr_pagesize\fR is the page size for the mapping, currently always the system
-pagesize.
-.sp
-.LP
-\fBpr_shmid\fR is the shared memory identifier, if any, for the mapping. Its
-value is \fB\(mi1\fR if the mapping is not System V shared memory. See
-\fBshmget\fR(2).
-.sp
-.LP
-\fBpr_dev\fR is the device of the mapped object, if any, for the mapping. Its
-value is \fBPRNODEV\fR (-1) if the mapping does not have a device.
-.sp
-.LP
-\fBpr_ino\fR is the inode of the mapped object, if any, for the mapping. Its
-contents are only valid if \fBpr_dev\fR is not \fBPRNODEV.\fR
-.sp
-.LP
-\fBpr_rss\fR is the number of resident pages of memory for the mapping. The
-number of resident bytes for the mapping may be determined by multiplying
-\fBpr_rss\fR by the page size given by \fBpr_pagesize.\fR
-.sp
-.LP
-\fBpr_anon\fR is the number of resident anonymous memory pages (pages which are
+underlying mapped object.
+A write to a
+.Sy MA_SHARED
+mapping that is not marked
+.Sy MA_WRITE
+fails.
+Reads and writes to private mappings always succeed.
+Reads and writes to unmapped addresses fail.
+.Pp
+.Sy pr_pagesize
+is the page size for the mapping, currently always the system pagesize.
+.Pp
+.Sy pr_shmid
+is the shared memory identifier, if any, for the mapping.
+Its value is \-1
+if the mapping is not System V shared memory.
+See
+.Xr shmget 2 .
+.Pp
+.Sy pr_dev
+is the device of the mapped object, if any, for the mapping.
+Its value is
+.Sy PRNODEV
+.Pq \-1
+if the mapping does not have a device.
+.Pp
+.Sy pr_ino
+is the inode of the mapped object, if any, for the mapping.
+Its contents are only valid if
+.Sy pr_dev
+is not
+.Sy PRNODEV .
+.Pp
+.Sy pr_rss
+is the number of resident pages of memory for the mapping.
+The number of resident bytes for the mapping may be determined by multiplying
+.Sy pr_rss
+by the page size given by
+.Sy pr_pagesize .
+.Pp
+.Sy pr_anon
+is the number of resident anonymous memory pages (pages which are
private to this process) for the mapping.
-.sp
-.LP
-\fBpr_locked\fR is the number of locked pages for the mapping. Pages which are
-locked are always resident in memory.
-.sp
-.LP
-\fBpr_hatpagesize\fR is the size, in bytes, of the \fBHAT\fR (\fBMMU\fR)
-translation for the mapping. \fBpr_hatpagesize\fR may be different than
-\fBpr_pagesize.\fR The possible values are hardware architecture specific, and
+.Pp
+.Sy pr_locked
+is the number of locked pages for the mapping.
+Pages which are locked are always resident in memory.
+.Pp
+.Sy pr_hatpagesize
+is the size, in bytes, of the
+.Sy HAT
+.Pq Sy MMU
+translation for the mapping.
+.Sy pr_hatpagesize
+may be different than
+.Sy pr_pagesize .
+The possible values are hardware architecture specific, and
may change over a mapping's lifetime.
-.SS "rmap"
-.LP
-Contains information about the reserved address ranges of the process. The file
-contains an array of \fBprmap\fR structures, as defined above for the \fBmap\fR
-file. Each structure describes a contiguous virtual address region in the
+.Ss rmap
+Contains information about the reserved address ranges of the process.
+The file contains an array of
+.Sy prmap
+structures, as defined above for the
+.Sy map
+file.
+Each structure describes a contiguous virtual address region in the
address space of the traced process that is reserved by the system in the sense
-that an \fBmmap\fR(2) system call that does not specify \fBMAP_FIXED\fR will
-not use any part of it for the new mapping. Examples of such reservations
-include the address ranges reserved for the process stack and the individual
-thread stacks of a multi-threaded process.
-.SS "cwd"
-.LP
-A symbolic link to the process's current working directory. See \fBchdir\fR(2).
-A \fBreadlink\fR(2) of \fB/proc/\fIpid\fR/cwd\fR yields a null string. However,
-it can be opened, listed, and searched as a directory, and can be the target of
-\fBchdir\fR(2).
-.SS "root"
-.LP
+that an
+.Xr mmap 2
+system call that does not specify
+.Sy MAP_FIXED
+will not use any part of it for the new mapping.
+Examples of such reservations include the address ranges reserved for the
+process stack and the individual thread stacks of a multi-threaded process.
+.Ss cwd
+A symbolic link to the process's current working directory.
+See
+.Xr chdir 2 .
+A
+.Xr readlink 2
+of
+.Pa /proc/ Ns Em pid Ns Pa /cwd
+yields a null string.
+However, it can be opened, listed, and searched as a directory, and can be the
+target of
+.Xr chdir 2 .
+.Ss root
A symbolic link to the process's root directory.
-\fB/proc/\fR\fIpid\fR\fB/root\fR can differ from the system root directory if
-the process or one of its ancestors executed \fBchroot\fR(2) as super user. It
-has the same semantics as \fB/proc/\fR\fIpid\fR\fB/cwd\fR.
-.SS "fd"
-.LP
-A directory containing references to the open files of the process. Each entry
-is a decimal number corresponding to an open file descriptor in the process.
-.sp
-.LP
+.Pa /proc/ Ns Em pid Ns Pa /root
+can differ from the system root directory if the process or one of its
+ancestors executed
+.Xr chroot 2
+as super user.
+It has the same semantics as
+.Pa /proc/ Ns Em pid Ns Pa /cwd .
+.Ss fd
+A directory containing references to the open files of the process.
+Each entry is a decimal number corresponding to an open file descriptor in the
+process.
+.Pp
If an entry refers to a regular file, it can be opened with normal file system
semantics but, to ensure that the controlling process cannot gain greater
access than the controlled process, with no file access modes other than its
-read/write open modes in the controlled process. If an entry refers to a
-directory, it can be accessed with the same semantics as
-\fB/proc/\fIpid\fR/cwd\fR. An attempt to open any other type of entry fails
-with \fBEACCES\fR.
-.SS "object"
-.LP
+read/write open modes in the controlled process.
+If an entry refers to a directory, it can be accessed with the same semantics
+as
+.Pa /proc/ Ns Em pid Ns Pa /cwd .
+An attempt to open any other type of entry fails with
+.Er EACCES .
+.Ss object
A directory containing read-only files with names corresponding to the
-\fBpr_mapname\fR entries in the \fBmap\fR and \fBpagedata\fR files. Opening
-such a file yields a file descriptor for the underlying mapped file associated
-with an address-space mapping in the process. The file name \fBa.out\fR appears
-in the directory as an alias for the process's executable file.
-.sp
-.LP
-The \fBobject\fR directory makes it possible for a controlling process to gain
+.Sy pr_mapname
+entries in the
+.Sy map
+and
+.Sy pagedata
+files.
+Opening such a file yields a file descriptor for the underlying mapped file
+associated with an address-space mapping in the process.
+The file name
+.Pa a.out
+appears in the directory as an alias for the process's executable file.
+.Pp
+The
+.Pa object
+directory makes it possible for a controlling process to gain
access to the object file and any shared libraries (and consequently the symbol
tables) without having to know the actual path names of the executable files.
-.SS "path"
-.LP
-A directory containing symbolic links to files opened by the process. The
-directory includes one entry for \fBcwd\fR and \fBroot\fR. The directory also
-contains a numerical entry for each file descriptor in the \fBfd\fR directory,
-and entries matching those in the \fBobject\fR directory. If this information
-is not available, any attempt to read the contents of the symbolic link will
-fail. This is most common for files that do not exist in the filesystem
-namespace (such as \fBFIFO\fRs and sockets), but can also happen for regular
-files. For the file descriptor entries, the path may be different from the one
+.Ss path
+A directory containing symbolic links to files opened by the process.
+The directory includes one entry for
+.Pa cwd
+and
+.Pa root .
+The directory also contains a numerical entry for each file descriptor in the
+.Pa fd
+directory, and entries matching those in the
+.Pa object
+directory.
+If this information is not available, any attempt to read the contents of the
+symbolic link will fail.
+This is most common for files that do not exist in the filesystem namespace
+(such as
+.Sy FIFO Ns s
+and sockets), but can also happen for regular files.
+For the file descriptor entries, the path may be different from the one
used by the process to open the file.
-.SS "pagedata"
-.LP
+.Ss pagedata
Opening the page data file enables tracking of address space references and
modifications on a per-page basis.
-.sp
-.LP
-A \fBread\fR(2) of the page data file descriptor returns structured page data
-and atomically clears the page data maintained for the file by the system. That
-is to say, each read returns data collected since the last read; the first read
-returns data collected since the file was opened. When the call completes, the
-read buffer contains the following structure as its header and thereafter
-contains a number of section header structures and associated byte arrays that
-must be accessed by walking linearly through the buffer.
-.sp
-.in +2
-.nf
+.Pp
+A
+.Xr read 2
+of the page data file descriptor returns structured page data
+and atomically clears the page data maintained for the file by the system.
+That is to say, each read returns data collected since the last read; the
+first read returns data collected since the file was opened.
+When the call completes, the read buffer contains the following structure as
+its header and thereafter contains a number of section header structures and
+associated byte arrays that must be accessed by walking linearly through the
+buffer.
+.Bd -literal -offset 2
typedef struct prpageheader {
timestruc_t pr_tstamp; /* real time stamp, time of read() */
ulong_t pr_nmap; /* number of address space mappings */
ulong_t pr_npage; /* total number of pages */
} prpageheader_t;
-.fi
-.in -2
-
-.sp
-.LP
-The header is followed by \fBpr_nmap prasmap\fR structures and associated data
-arrays. The \fBprasmap\fR structure contains the following elements:
-.sp
-.in +2
-.nf
+.Ed
+.Pp
+The header is followed by
+.Sy "pr_nmap prasmap"
+structures and associated data arrays.
+The
+.Sy prasmap
+structure contains the following elements:
+.Bd -literal -offset 2
typedef struct prasmap {
uintptr_t pr_vaddr; /* virtual address of mapping */
ulong_t pr_npage; /* number of pages in mapping */
@@ -1338,59 +1479,56 @@ typedef struct prasmap {
int pr_pagesize; /* pagesize for this mapping in bytes */
int pr_shmid; /* SysV shared memory identifier */
} prasmap_t;
-.fi
-.in -2
-
-.sp
-.LP
-Each section header is followed by \fBpr_npage\fR bytes, one byte for each page
-in the mapping, plus 0-7 null bytes at the end so that the next \fBprasmap\fR
-structure begins on an eight-byte aligned boundary. Each data byte may contain
-these flags:
-.sp
-.ne 2
-.na
-\fB\fBPG_REFERENCED\fR\fR
-.ad
-.RS 17n
+.Ed
+.Pp
+Each section header is followed by
+.Sy pr_npage
+bytes, one byte for each page in the mapping, plus 0-7 null bytes at the end
+so that the next
+.Sy prasmap
+structure begins on an eight-byte aligned boundary.
+Each data byte may contain these flags:
+.Bl -tag -width "PG_REFERENCED" -offset 2
+.It Sy PG_REFERENCED
page has been referenced.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPG_MODIFIED\fR\fR
-.ad
-.RS 17n
+.It Sy PG_MODIFIED
page has been modified.
-.RE
-
-.sp
-.LP
+.El
+.Pp
If the read buffer is not large enough to contain all of the page data, the
-read fails with \fBE2BIG\fR and the page data is not cleared. The required size
-of the read buffer can be determined through \fBfstat\fR(2). Application of
-\fBlseek\fR(2) to the page data file descriptor is ineffective; every read
-starts from the beginning of the file. Closing the page data file descriptor
+read fails with
+.Er E2BIG
+and the page data is not cleared.
+The required size of the read buffer can be determined through
+.Xr fstat 2 .
+Application of
+.Xr lseek 2
+to the page data file descriptor is ineffective; every read
+starts from the beginning of the file.
+Closing the page data file descriptor
terminates the system overhead associated with collecting the data.
-.sp
-.LP
+.Pp
More than one page data file descriptor for the same process can be opened, up
-to a system-imposed limit per traced process. A read of one does not affect the
-data being collected by the system for the others. An open of the page data
-file will fail with \fBENOMEM\fR if the system-imposed limit would be exceeded.
-.SS "watch"
-.LP
-Contains an array of \fBprwatch\fR structures, one for each watched area
-established by the \fBPCWATCH\fR control operation. See \fBPCWATCH\fR for
-details.
-.SS "usage"
-.LP
-Contains process usage information described by a \fBprusage\fR structure which
-contains at least the following fields:
-.sp
-.in +2
-.nf
+to a system-imposed limit per traced process.
+A read of one does not affect the data being collected by the system for the
+others.
+An open of the page data file will fail with
+.Er ENOMEM
+if the system-imposed limit would be exceeded.
+.Ss watch
+Contains an array of
+.Vt prwatch
+structures, one for each watched area established by the
+.Sy PCWATCH
+control operation.
+See
+.Sx PCWATCH
+for details.
+.Ss usage
+Contains process usage information described by a
+.Vt prusage
+structure which contains at least the following fields:
+.Bd -literal -offset 2
typedef struct prusage {
id_t pr_lwpid; /* lwp id. 0: process or defunct */
int pr_count; /* number of contributing lwps */
@@ -1421,1548 +1559,1529 @@ typedef struct prusage {
ulong_t pr_sysc; /* system calls */
ulong_t pr_ioch; /* chars read and written */
} prusage_t;
-.fi
-.in -2
-
-.sp
-.LP
-Microstate accounting is now continuously enabled. While this information was
+.Ed
+.Pp
+Microstate accounting is now continuously enabled.
+While this information was
previously an estimate, if microstate accounting were not enabled, the current
information is now never an estimate represents time the process has spent in
various states.
-.SS "lstatus"
-.LP
-Contains a \fBprheader\fR structure followed by an array of \fBlwpstatus\fR
+.Ss lstatus
+Contains a
+.Vt prheader
+structure followed by an array of
+.Vt lwpstatus
structures, one for each active lwp in the process (see also
-\fB/proc/\fR\fIpid\fR\fB/lwp/\fR\fIlwpid\fR/\fBlwpstatus\fR, below). The
-\fBprheader\fR structure describes the number and size of the array entries
-that follow.
-.sp
-.in +2
-.nf
+.Pa /proc/ Ns Em pid Ns Pa /lwp/ Ns Em lwpid Ns Pa /lwpstatus ,
+below).
+The
+.Vt prheader
+structure describes the number and size of the array entries that follow.
+.Bd -literal -offset 2
typedef struct prheader {
long pr_nent; /* number of entries */
size_t pr_entsize; /* size of each entry, in bytes */
} prheader_t;
-.fi
-.in -2
-
-.sp
-.LP
-The \fBlwpstatus\fR structure may grow by the addition of elements at the end
-in future releases of the system. Programs must use \fBpr_entsize\fR in the
-file header to index through the array. These comments apply to all \fB/proc\fR
-files that include a \fBprheader\fR structure (\fBlpsinfo\fR and \fBlusage\fR,
+.Ed
+.Pp
+The
+.Vt lwpstatus
+structure may grow by the addition of elements at the end in future releases
+of the system.
+Programs must use
+.Sy pr_entsize
+in the file header to index through the array.
+These comments apply to all
+.Pa /proc
+files that include a
+.Vt prheader
+structure
+.Pf ( Pa lpsinfo
+and
+.Pa lusage ,
below).
-.SS "lpsinfo"
-.LP
-Contains a \fBprheader\fR structure followed by an array of \fBlwpsinfo\fR
-structures, one for eachactive and zombie lwp in the process. See also
-\fB/proc/\fR\fIpid\fR\fB/lwp/\fR\fIlwpid\fR/\fBlwpsinfo\fR, below.
-.SS "lusage"
-.LP
-Contains a \fBprheader\fR structure followed by an array of \fBprusage\fR
+.Ss lpsinfo
+Contains a
+.Vt prheader
+structure followed by an array of
+.Vt lwpsinfo
+structures, one for eachactive and zombie lwp in the process.
+See also
+.Pa /proc/ Ns Em pid Ns Pa /lwp/ Ns Em lwpid Ns Pa /lwpsinfo ,
+below.
+.Ss lusage
+Contains a
+.Vt prheader
+structure followed by an array of
+.Vt prusage
structures, one for each active lwp in the process, plus an additional element
at the beginning that contains the summation over all defunct lwps (lwps that
-once existed but no longer exist in the process). Excluding the \fBpr_lwpid\fR,
-\fBpr_tstamp\fR, \fBpr_create\fR, and \fBpr_term\fR entries, the entry-by-entry
-summation over all these structures is the definition of the process usage
-information obtained from the \fBusage\fR file. (See also
-\fB/proc/\fR\fIpid\fR\fB/lwp/\fR\fIlwpid\fR/\fBlwpusage\fR, below.)
-.SS "lwp"
-.LP
+once existed but no longer exist in the process).
+Excluding the
+.Sy pr_lwpid ,
+.Sy pr_tstamp ,
+.Sy pr_create ,
+and
+.Sy pr_term
+entries, the entry-by-entry summation over all these structures is the
+definition of the process usage information obtained from the
+.Pa usage
+file. (See also
+.Pa /proc/ Ns Em pid Ns Pa /lwp/ Ns Em lwpid Ns Pa /lwpusage ,
+below.)
+.Ss lwp
A directory containing entries each of which names an active or zombie lwp
-within the process. These entries are themselves directories containing
-additional files as described below. Only the \fBlwpsinfo\fR file exists in the
-directory of a zombie lwp.
-.SH STRUCTURE OF \fB/proc/\fR\fIpid\fR\fB/lwp/\fR\fIlwpid\fR
-.LP
-A given directory \fB/proc/\fR\fIpid\fR\fB/lwp/\fR\fIlwpid\fR contains the
-following entries:
-.SS "lwpctl"
-.LP
-Write-only control file. The messages written to this file affect the specific
+within the process.
+These entries are themselves directories containing additional files as
+described below.
+Only the
+.Pa lwpsinfo
+file exists in the directory of a zombie lwp.
+.Sh "STRUCTURE OF" Pa /proc/ Ns Em pid Ns Pa /lwp/ Ns Em lwpid
+A given directory
+.Pa /proc/ Ns Em pid Ns Pa /lwp/ Ns Em lwpid
+contains the following entries:
+.Ss lwpctl
+Write-only control file.
+The messages written to this file affect the specific
lwp rather than the representative lwp, as is the case for the process's
-\fBctl\fR file.
-.SS "lwpstatus"
-.LP
-lwp-specific state information. This file contains the \fBlwpstatus\fR
+.Pa ctl
+file.
+.Ss lwpstatus
+lwp-specific state information.
+This file contains the
+.Vt lwpstatus
structure for the specific lwp as described above for the representative lwp in
-the process's \fBstatus\fR file.
-.SS "lwpsinfo"
-.LP
-lwp-specific \fBps\fR(1) information. This file contains the \fBlwpsinfo\fR
+the process's
+.Pa status
+file.
+.Ss lwpsinfo
+lwp-specific
+.Xr ps 1
+information.
+This file contains the
+.Vt lwpsinfo
structure for the specific lwp as described above for the representative lwp in
-the process's \fBpsinfo\fR file. The \fBlwpsinfo\fR file remains accessible
-after an lwp becomes a zombie.
-.SS "lwpusage"
-.LP
-This file contains the \fBprusage\fR structure for the specific lwp as
-described above for the process's \fBusage\fR file.
-.SS "gwindows"
-.LP
-This file exists only on SPARC based machines. If it is non-empty, it contains
-a \fBgwindows_t\fR structure, defined in \fB<sys/regset.h>\fR, with the values
-of those SPARC register windows that could not be stored on the stack when the
-lwp stopped. Conditions under which register windows are not stored on the
+the process's
+.Pa psinfo
+file.
+The
+.Pa lwpsinfo
+file remains accessible after an lwp becomes a zombie.
+.Ss lwpusage
+This file contains the
+.Vt prusage
+structure for the specific lwp as described above for the process's
+.Pa usage
+file.
+.Ss gwindows
+This file exists only on SPARC based machines.
+If it is non-empty, it contains a
+.Vt gwindows_t
+structure, defined in
+.In sys/regset.h ,
+with the values of those SPARC register windows that could not be stored on
+the stack when the lwp stopped.
+Conditions under which register windows are not stored on the
stack are: the stack pointer refers to nonexistent process memory or the stack
-pointer is improperly aligned. If the lwp is not stopped or if there are no
+pointer is improperly aligned.
+If the lwp is not stopped or if there are no
register windows that could not be stored on the stack, the file is empty (the
usual case).
-.SS "xregs"
-.LP
-Extra state registers. The extra state register set is architecture dependent;
-this file is empty if the system does not support extra state registers. If the
-file is non-empty, it contains an architecture dependent structure of type
-\fBprxregset_t\fR, defined in \fB<procfs.h>\fR, with the values of the lwp's
-extra state registers. If the lwp is not stopped, all register values are
-undefined. See also the \fBPCSXREG\fR control operation, below.
-.SS "asrs"
-.LP
-This file exists only for 64-bit SPARC V9 processes. It contains an
-\fBasrset_t\fR structure, defined in <\fBsys/regset.h\fR>, containing the
-values of the lwp's platform-dependent ancillary state registers. If the lwp is
-not stopped, all register values are undefined. See also the \fBPCSASRS\fR
+.Ss xregs
+Extra state registers.
+The extra state register set is architecture dependent;
+this file is empty if the system does not support extra state registers.
+If the file is non-empty, it contains an architecture dependent structure of
+type
+.Vt prxregset_t ,
+defined in
+.In procfs.h ,
+with the values of the lwp's extra state registers.
+If the lwp is not stopped, all register values are undefined.
+See also the
+.Sx PCSXREG
+control operation, below.
+.Ss asrs
+This file exists only for 64-bit SPARC V9 processes.
+It contains an
+.Vt asrset_t
+structure, defined in
+.In sys/regset.h ,
+containing the values of the lwp's platform-dependent ancillary state registers.
+If the lwp is not stopped, all register values are undefined.
+See also the
+.Sx PCSASRS
control operation, below.
-.SS "spymaster"
-.LP
-For an agent lwp (see \fBPCAGENT\fR), this file contains a \fBpsinfo_t\fR
+.Ss spymaster
+For an agent lwp (see
+.Sx PCAGENT ) ,
+this file contains a
+.Vt psinfo_t
structure that corresponds to the process that created the agent lwp at the
-time the agent was created. This structure is identical to that retrieved via
-the \fBpsinfo\fR file, with one modification: the \fBpr_time\fR field does not
-correspond to the CPU time for the process, but rather to the creation time of
-the agent lwp.
-.SS "templates"
-.LP
+time the agent was created.
+This structure is identical to that retrieved via the
+.Pa psinfo
+file, with one modification: the
+.Sy pr_time
+field does not correspond to the CPU time for the process, but rather to the
+creation time of the agent lwp.
+.Ss templates
A directory which contains references to the active templates for the lwp,
-named by the contract type. Changes made to an active template descriptor do
+named by the contract type.
+Changes made to an active template descriptor do
not affect the original template which was activated, though they do affect the
-active template. It is not possible to activate an active template descriptor.
-See \fBcontract\fR(4).
-.SH CONTROL MESSAGES
-.LP
+active template.
+It is not possible to activate an active template descriptor.
+See
+.Xr contract 4 .
+.Sh CONTROL MESSAGES
Process state changes are effected through messages written to a process's
-\fBctl\fR file or to an individual lwp's \fBlwpctl\fR file. All control
-messages consist of a \fBlong\fR that names the specific operation followed by
+.Sy ctl
+file or to an individual lwp's
+.Sy lwpctl
+file.
+All control messages consist of a
+.Sy long
+that names the specific operation followed by
additional data containing the operand, if any.
-.sp
-.LP
-Multiple control messages may be combined in a single \fBwrite\fR(2) (or
-\fBwritev\fR(2)) to a control file, but no partial writes are permitted. That
-is, each control message, operation code plus operand, if any, must be
-presented in its entirety to the \fBwrite\fR(2) and not in pieces over several
-system calls. If a control operation fails, no subsequent operations contained
-in the same \fBwrite\fR(2) are attempted.
-.sp
-.LP
-Descriptions of the allowable control messages follow. In all cases, writing a
-message to a control file for a process or lwp that has terminated elicits the
-error \fBENOENT\fR.
-.SS "PCSTOP PCDSTOP PCWSTOP PCTWSTOP"
-.LP
-When applied to the process control file, \fBPCSTOP\fR directs all lwps to stop
-and waits for them to stop, \fBPCDSTOP\fR directs all lwps to stop without
-waiting for them to stop, and \fBPCWSTOP\fR simply waits for all lwps to stop.
-When applied to an lwp control file, \fBPCSTOP\fR directs the specific lwp to
-stop and waits until it has stopped, \fBPCDSTOP\fR directs the specific lwp to
-stop without waiting for it to stop, and \fBPCWSTOP\fR simply waits for the
-specific lwp to stop. When applied to an lwp control file, \fBPCSTOP\fR and
-\fBPCWSTOP\fR complete when the lwp stops on an event of interest, immediately
+.Pp
+Multiple control messages may be combined in a single
+.Xr write 2
+(or
+.Xr writev 2 )
+to a control file, but no partial writes are permitted.
+That is, each control message, operation code plus operand, if any, must be
+presented in its entirety to the
+.Xr write 2
+and not in pieces over several system calls.
+If a control operation fails, no subsequent operations contained in the same
+.Xr write 2
+are attempted.
+.Pp
+Descriptions of the allowable control messages follow.
+In all cases, writing a message to a control file for a process or lwp that
+has terminated elicits the error
+.Er ENOENT .
+.Ss PCSTOP PCDSTOP PCWSTOP PCTWSTOP
+When applied to the process control file,
+.Sy PCSTOP
+directs all lwps to stop and waits for them to stop,
+.Sy PCDSTOP
+directs all lwps to stop without waiting for them to stop, and
+.Sy PCWSTOP
+simply waits for all lwps to stop.
+When applied to an lwp control file,
+.Sy PCSTOP
+directs the specific lwp to stop and waits until it has stopped,
+.Sy PCDSTOP
+directs the specific lwp to stop without waiting for it to stop, and
+.Sy PCWSTOP
+ simply waits for the specific lwp to stop.
+When applied to an lwp control file,
+.Sy PCSTOP
+and
+.Sy PCWSTOP
+complete when the lwp stops on an event of interest, immediately
if already so stopped; when applied to the process control file, they complete
when every lwp has stopped either on an event of interest or on a
-\fBPR_SUSPENDED\fR stop.
-.sp
-.LP
-\fBPCTWSTOP\fR is identical to \fBPCWSTOP\fR except that it enables the
-operation to time out, to avoid waiting forever for a process or lwp that may
-never stop on an event of interest. \fBPCTWSTOP\fR takes a \fBlong\fR operand
-specifying a number of milliseconds; the wait will terminate successfully after
-the specified number of milliseconds even if the process or lwp has not
-stopped; a timeout value of zero makes the operation identical to
-\fBPCWSTOP\fR.
-.sp
-.LP
-An ``event of interest'' is either a \fBPR_REQUESTED\fR stop or a stop that has
-been specified in the process's tracing flags (set by \fBPCSTRACE\fR,
-\fBPCSFAULT\fR, \fBPCSENTRY\fR, and \fBPCSEXIT\fR). \fBPR_JOBCONTROL\fR and
-\fBPR_SUSPENDED\fR stops are specifically not events of interest. (An lwp may
-stop twice due to a stop signal, first showing \fBPR_SIGNALLED\fR if the signal
-is traced and again showing \fBPR_JOBCONTROL\fR if the lwp is set running
-without clearing the signal.) If \fBPCSTOP\fR or \fBPCDSTOP\fR is applied to an
+.Sy PR_SUSPENDED
+stop.
+.Pp
+.Sy PCTWSTOP
+is identical to
+.Sy PCWSTOP
+except that it enables the operation to time out, to avoid waiting forever for
+a process or lwp that may never stop on an event of interest.
+.Sy PCTWSTOP
+takes a
+.Sy long
+operand specifying a number of milliseconds; the wait will terminate
+successfully after the specified number of milliseconds even if the process or
+lwp has not stopped; a timeout value of zero makes the operation identical to
+.Sy PCWSTOP .
+.Pp
+An
+.Dq event of interest
+is either a
+.Sy PR_REQUESTED
+stop or a stop that has been specified in the process's tracing flags (set by
+.Sy PCSTRACE ,
+.Sy PCSFAULT ,
+.Sy PCSENTRY ,
+and
+.Sy PCSEXIT ) .
+.Sy PR_JOBCONTROL
+ and
+.Sy PR_SUSPENDED
+stops are specifically not events of interest.
+(An lwp may stop twice due to a stop signal, first showing
+.Sy PR_SIGNALLED
+if the signal is traced and again showing
+.Sy PR_JOBCONTROL
+if the lwp is set running without clearing the signal.)
+If
+.Sy PCSTOP
+or
+.Sy PCDSTOP
+is applied to an
lwp that is stopped, but not on an event of interest, the stop directive takes
-effect when the lwp is restarted by the competing mechanism. At that time, the
-lwp enters a \fBPR_REQUESTED\fR stop before executing any user-level code.
-.sp
-.LP
+effect when the lwp is restarted by the competing mechanism.
+At that time, the lwp enters a
+.Sy PR_REQUESTED
+stop before executing any user-level code.
+.Pp
A write of a control message that blocks is interruptible by a signal so that,
-for example, an \fBalarm\fR(2) can be set to avoid waiting forever for a
-process or lwp that may never stop on an event of interest. If \fBPCSTOP\fR is
-interrupted, the lwp stop directives remain in effect even though the
-\fBwrite\fR(2) returns an error. (Use of \fBPCTWSTOP\fR with a non-zero timeout
-is recommended over \fBPCWSTOP\fR with an \fBalarm\fR(2).)
-.sp
-.LP
-A system process (indicated by the \fBPR_ISSYS\fR flag) never executes at user
-level, has no user-level address space visible through \fB/proc\fR, and cannot
-be stopped. Applying one of these operations to a system process or any of its
-lwps elicits the error \fBEBUSY\fR.
-.SS "PCRUN"
-.LP
-Make an lwp runnable again after a stop. This operation takes a \fBlong\fR
+for example, an
+.Xr alarm 2
+can be set to avoid waiting forever for a
+process or lwp that may never stop on an event of interest.
+If
+.Sy PCSTOP
+is interrupted, the lwp stop directives remain in effect even though the
+.Xr write 2
+returns an error.
+(Use of
+.Sy PCTWSTOP
+with a non-zero timeout is recommended over
+.Sy PCWSTOP
+with an
+.Xr alarm 2 . )
+.Pp
+A system process (indicated by the
+.Sy PR_ISSYS
+flag) never executes at user level, has no user-level address space visible
+through
+.Pa /proc ,
+and cannot be stopped.
+Applying one of these operations to a system process or any of its
+lwps elicits the error
+.Er EBUSY .
+.Ss PCRUN
+Make an lwp runnable again after a stop.
+This operation takes a
+.Vt long
operand containing zero or more of the following flags:
-.sp
-.ne 2
-.na
-\fB\fBPRCSIG\fR\fR
-.ad
-.RS 12n
-clears the current signal, if any (see \fBPCCSIG\fR).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPRCFAULT\fR\fR
-.ad
-.RS 12n
-clears the current fault, if any (see \fBPCCFAULT\fR).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPRSTEP\fR\fR
-.ad
-.RS 12n
-directs the lwp to execute a single machine instruction. On completion of the
-instruction, a trace trap occurs. If \fBFLTTRACE\fR is being traced, the lwp
-stops; otherwise, it is sent \fBSIGTRAP\fR. If \fBSIGTRAP\fR is being traced
-and is not blocked, the lwp stops. When the lwp stops on an event of interest,
+.Bl -tag -width "PRSABORT" -offset left
+.It Sy PRCSIG
+clears the current signal, if any (see
+.Sx PCCSIG ) .
+.It Sy PRCFAULT
+clears the current fault, if any (see
+.Sx PCCFAULT ) .
+.It Sy PRSTEP
+directs the lwp to execute a single machine instruction.
+On completion of the instruction, a trace trap occurs.
+If
+.Sy FLTTRACE
+is being traced, the lwp stops; otherwise, it is sent
+.Sy SIGTRAP .
+If
+.Sy SIGTRAP
+is being traced and is not blocked, the lwp stops.
+When the lwp stops on an event of interest,
the single-step directive is cancelled, even if the stop occurs before the
-instruction is executed. This operation requires hardware and operating system
-support and may not be implemented on all processors. It is implemented on
-SPARC and x86-based machines.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPRSABORT\fR\fR
-.ad
-.RS 12n
-is meaningful only if the lwp is in a \fBPR_SYSENTRY\fR stop or is marked
-\fBPR_ASLEEP\fR; it instructs the lwp to abort execution of the system call
-(see \fBPCSENTRY\fR and \fBPCSEXIT\fR).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPRSTOP\fR\fR
-.ad
-.RS 12n
+instruction is executed.
+This operation requires hardware and operating system
+support and may not be implemented on all processors.
+It is implemented on SPARC and x86-based machines.
+.It Sy PRSABORT
+is meaningful only if the lwp is in a
+.Sy PR_SYSENTRY
+stop or is marked
+.Sy PR_ASLEEP ;
+it instructs the lwp to abort execution of the system call (see
+.Sx PCSENTRY
+and
+.Sx PCSEXIT ) .
+.It Sy PRSTOP
directs the lwp to stop again as soon as possible after resuming execution (see
-\fBPCDSTOP\fR). In particular, if the lwp is stopped on \fBPR_SIGNALLED\fR or
-\fBPR_FAULTED\fR, the next stop will show \fBPR_REQUESTED\fR, no other stop
+.Sx PCDSTOP ) .
+In particular, if the lwp is stopped on
+.Sy PR_SIGNALLED
+or
+.Sy PR_FAULTED ,
+the next stop will show
+.Sy PR_REQUESTED ,
+no other stop
will have intervened, and the lwp will not have executed any user-level code.
-.RE
-
-.sp
-.LP
-When applied to an lwp control file, \fBPCRUN\fR clears any outstanding
-directed-stop request and makes the specific lwp runnable. The operation fails
-with \fBEBUSY\fR if the specific lwp is not stopped on an event of interest or
+.El
+.Pp
+When applied to an lwp control file,
+.Sy PCRUN
+clears any outstanding
+directed-stop request and makes the specific lwp runnable.
+The operation fails with
+.Er EBUSY
+if the specific lwp is not stopped on an event of interest or
has not been directed to stop or if the agent lwp exists and this is not the
-agent lwp (see \fBPCAGENT\fR).
-.sp
-.LP
+agent lwp (see
+.Sx PCAGENT ) .
+.Pp
When applied to the process control file, a representative lwp is chosen for
-the operation as described for \fB/proc/\fR\fIpid\fR\fB/status\fR. The
-operation fails with \fBEBUSY\fR if the representative lwp is not stopped on an
+the operation as described for
+.Pa /proc/ Ns Em pid Ns Pa /status .
+The operation fails with
+.Er EBUSY
+if the representative lwp is not stopped on an
event of interest or has not been directed to stop or if the agent lwp exists.
-If \fBPRSTEP\fR or \fBPRSTOP\fR was requested, the representative lwp is made
+If
+.Sy PRSTEP
+or
+.Sy PRSTOP
+was requested, the representative lwp is made
runnable and its outstanding directed-stop request is cleared; otherwise all
outstanding directed-stop requests are cleared and, if it was stopped on an
-event of interest, the representative lwp is marked \fBPR_REQUESTED\fR. If, as
-a consequence, all lwps are in the \fBPR_REQUESTED\fR or \fBPR_SUSPENDED\fR
-stop state, all lwps showing \fBPR_REQUESTED\fR are made runnable.
-.SS "PCSTRACE"
-.LP
-Define a set of signals to be traced in the process. The receipt of one of
-these signals by an lwp causes the lwp to stop. The set of signals is defined
-using an operand \fBsigset_t\fR contained in the control message. Receipt of
-\fBSIGKILL\fR cannot be traced; if specified, it is silently ignored.
-.sp
-.LP
+event of interest, the representative lwp is marked
+.Sy PR_REQUESTED .
+If, as a consequence, all lwps are in the
+.Sy PR_REQUESTED
+or
+.Sy PR_SUSPENDED
+stop state, all lwps showing
+.Sy PR_REQUESTED
+are made runnable.
+.Ss PCSTRACE
+Define a set of signals to be traced in the process.
+The receipt of one of these signals by an lwp causes the lwp to stop.
+The set of signals is defined using an operand
+.Sy sigset_t
+contained in the control message.
+Receipt of
+.Sy SIGKILL
+cannot be traced; if specified, it is silently ignored.
+.Pp
If a signal that is included in an lwp's held signal set (the signal mask) is
sent to the lwp, the signal is not received and does not cause a stop until it
is removed from the held signal set, either by the lwp itself or by setting the
-held signal set with \fBPCSHOLD\fR.
-.SS "PCCSIG"
-.LP
+held signal set with
+.Sy PCSHOLD .
+.Ss PCCSIG
The current signal, if any, is cleared from the specific or representative lwp.
-.SS "PCSSIG"
-.LP
+.Ss PCSSIG
The current signal and its associated signal information for the specific or
representative lwp are set according to the contents of the operand
-\fBsiginfo\fR structure (see \fB<sys/siginfo.h>\fR). If the specified signal
-number is zero, the current signal is cleared. The semantics of this operation
-are different from those of \fBkill\fR(2) in that the signal is delivered to
-the lwp immediately after execution is resumed (even if it is being blocked)
-and an additional \fBPR_SIGNALLED\fR stop does not intervene even if the signal
-is traced. Setting the current signal to \fBSIGKILL\fR terminates the process
-immediately.
-.SS "PCKILL"
-.LP
+.Vt siginfo
+structure (see
+.In sys/siginfo.h ) .
+If the specified signal number is zero, the current signal is cleared.
+The semantics of this operation are different from those of
+.Xr kill 2
+in that the signal is delivered to the lwp immediately after execution is
+resumed (even if it is being blocked) and an additional
+.Sy PR_SIGNALLED
+stop does not intervene even if the signal is traced.
+Setting the current signal to
+.Sy SIGKILL
+terminates the process immediately.
+.Ss PCKILL
If applied to the process control file, a signal is sent to the process with
-semantics identical to those of \fBkill\fR(2). If applied to an lwp control
-file, a directed signal is sent to the specific lwp. The signal is named in a
-\fBlong\fR operand contained in the message. Sending \fBSIGKILL\fR terminates
-the process immediately.
-.SS "PCUNKILL"
-.LP
-A signal is deleted, that is, it is removed from the set of pending signals. If
-applied to the process control file, the signal is deleted from the process's
-pending signals. If applied to an lwp control file, the signal is deleted from
-the lwp's pending signals. The current signal (if any) is unaffected. The
-signal is named in a \fBlong\fR operand in the control message. It is an error
-(\fBEINVAL\fR) to attempt to delete \fBSIGKILL\fR.
-.SS "PCSHOLD"
-.LP
+semantics identical to those of
+.Xr kill 2
+If applied to an lwp control file, a directed signal is sent to the specific
+lwp.
+The signal is named in a
+.Vt long
+operand contained in the message.
+Sending
+.Sy SIGKILL
+terminates the process immediately.
+.Ss PCUNKILL
+A signal is deleted, that is, it is removed from the set of pending signals.
+If applied to the process control file, the signal is deleted from the process's
+pending signals.
+If applied to an lwp control file, the signal is deleted from
+the lwp's pending signals.
+The current signal (if any) is unaffected.
+The signal is named in a
+.Sy long
+operand in the control message.
+It is an error
+.Pq Er EINVAL
+to attempt to delete
+.Sy SIGKILL .
+.Ss PCSHOLD
Set the set of held signals for the specific or representative lwp (signals
-whose delivery will be blocked if sent to the lwp). The set of signals is
-specified with a \fBsigset_t\fR operand. \fBSIGKILL\fR and \fBSIGSTOP\fR cannot
-be held; if specified, they are silently ignored.
-.SS "PCSFAULT"
-.LP
-Define a set of hardware faults to be traced in the process. On incurring one
-of these faults, an lwp stops. The set is defined via the operand
-\fBfltset_t\fR structure. Fault names are defined in \fB<sys/fault.h>\fR and
-include the following. Some of these may not occur on all processors; there may
+whose delivery will be blocked if sent to the lwp).
+The set of signals is specified with a
+.Vt sigset_t
+operand.
+.Sy SIGKILL
+and
+.Sy SIGSTOP
+cannot be held; if specified, they are silently ignored.
+.Ss PCSFAULT
+Define a set of hardware faults to be traced in the process.
+On incurring one of these faults, an lwp stops.
+The set is defined via the operand
+.Vt fltset_t
+structure.
+Fault names are defined in
+.In sys/fault.h
+and include the following.
+Some of these may not occur on all processors; there may
be processor-specific faults in addition to these.
-.sp
-.ne 2
-.na
-\fB\fBFLTILL\fR\fR
-.ad
-.RS 13n
+.Bl -tag -width "FLTACCESS" -offset indent
+.It Sy FLTILL
illegal instruction
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBFLTPRIV\fR\fR
-.ad
-.RS 13n
+.It Sy FLTPRIV
privileged instruction
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBFLTBPT\fR\fR
-.ad
-.RS 13n
+.It Sy FLTBPT
breakpoint trap
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBFLTTRACE\fR\fR
-.ad
-.RS 13n
+.It Sy FLTTRACE
trace trap (single-step)
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBFLTWATCH\fR\fR
-.ad
-.RS 13n
+.It Sy FLTWATCH
watchpoint trap
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBFLTACCESS\fR\fR
-.ad
-.RS 13n
+.It Sy FLTACCESS
memory access fault (bus error)
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBFLTBOUNDS\fR\fR
-.ad
-.RS 13n
+.It Sy FLTBOUNDS
memory bounds violation
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBFLTIOVF\fR\fR
-.ad
-.RS 13n
+.It Sy FLTIOVF
integer overflow
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBFLTIZDIV\fR\fR
-.ad
-.RS 13n
+.It Sy FLTIZDIV
integer zero divide
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBFLTFPE\fR\fR
-.ad
-.RS 13n
+.It Sy FLTFPE
floating-point exception
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBFLTSTACK\fR\fR
-.ad
-.RS 13n
+.It Sy FLTSTACK
unrecoverable stack fault
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBFLTPAGE\fR\fR
-.ad
-.RS 13n
+.It Sy FLTPAGE
recoverable page fault
-.RE
-
-.sp
-.LP
+.El
+.Pp
When not traced, a fault normally results in the posting of a signal to the lwp
-that incurred the fault. If an lwp stops on a fault, the signal is posted to
-the lwp when execution is resumed unless the fault is cleared by \fBPCCFAULT\fR
-or by the \fBPRCFAULT\fR option of \fBPCRUN\fR. \fBFLTPAGE\fR is an exception;
-no signal is posted. The \fBpr_info\fR field in the \fBlwpstatus\fR structure
-identifies the signal to be sent and contains machine-specific information
-about the fault.
-.SS "PCCFAULT"
-.LP
+that incurred the fault.
+If an lwp stops on a fault, the signal is posted to
+the lwp when execution is resumed unless the fault is cleared by
+.Sy PCCFAULT
+or by the
+.Sy PRCFAULT
+option of
+.Sy PCRUN .
+.Sy FLTPAGE
+is an exception; no signal is posted.
+The
+.Sy pr_info
+field in the
+.Vt lwpstatus
+structure identifies the signal to be sent and contains machine-specific
+information about the fault.
+.Ss PCCFAULT
The current fault, if any, is cleared; the associated signal will not be sent
to the specific or representative lwp.
-.SS "PCSENTRY PCSEXIT"
-.LP
+.Ss PCSENTRY PCSEXIT
These control operations instruct the process's lwps to stop on entry to or
-exit from specified system calls. The set of system calls to be traced is
-defined via an operand \fBsysset_t\fR structure.
-.sp
-.LP
+exit from specified system calls.
+The set of system calls to be traced is defined via an operand
+.Vt sysset_t
+structure.
+.Pp
When entry to a system call is being traced, an lwp stops after having begun
the call to the system but before the system call arguments have been fetched
-from the lwp. When exit from a system call is being traced, an lwp stops on
-completion of the system call just prior to checking for signals and returning
-to user level. At this point, all return values have been stored into the lwp's
-registers.
-.sp
-.LP
-If an lwp is stopped on entry to a system call (\fBPR_SYSENTRY\fR) or when
-sleeping in an interruptible system call (\fBPR_ASLEEP\fR is set), it may be
-instructed to go directly to system call exit by specifying the \fBPRSABORT\fR
-flag in a \fBPCRUN\fR control message. Unless exit from the system call is
-being traced, the lwp returns to user level showing \fBEINTR\fR.
-.SS "PCWATCH"
-.LP
-Set or clear a watched area in the controlled process from a \fBprwatch\fR
+from the lwp.
+When exit from a system call is being traced, an lwp stops on completion of
+the system call just prior to checking for signals and returning to user level.
+At this point, all return values have been stored into the lwp's registers.
+.Pp
+If an lwp is stopped on entry to a system call
+.Pq Sy PR_SYSENTRY
+or when sleeping in an interruptible system call
+.Pf ( Sy PR_ASLEEP
+is set), it may be instructed to go directly to system call exit by specifying
+the
+.Sy PRSABORT
+flag in a
+.Sy PCRUN
+control message.
+Unless exit from the system call is being traced, the lwp returns to user
+level showing
+.Er EINTR .
+.Ss PCWATCH
+Set or clear a watched area in the controlled process from a
+.Vt prwatch
structure operand:
-.sp
-.in +2
-.nf
+.Bd -literal -offset 2
typedef struct prwatch {
uintptr_t pr_vaddr; /* virtual address of watched area */
size_t pr_size; /* size of watched area in bytes */
int pr_wflags; /* watch type flags */
} prwatch_t;
-.fi
-.in -2
-
-.sp
-.LP
-\fBpr_vaddr\fR specifies the virtual address of an area of memory to be watched
-in the controlled process. \fBpr_size\fR specifies the size of the area, in
-bytes. \fBpr_wflags\fR specifies the type of memory access to be monitored as a
+.Ed
+.Pp
+.Sy pr_vaddr
+specifies the virtual address of an area of memory to be watched
+in the controlled process.
+.Sy pr_size
+specifies the size of the area, in bytes.
+.Sy pr_wflags
+specifies the type of memory access to be monitored as a
bit-mask of the following flags:
-.sp
-.ne 2
-.na
-\fB\fBWA_READ\fR\fR
-.ad
-.RS 16n
+.Bl -tag -width "WA_TRAPAFTER" -offset indent
+.It Sy WA_READ
read access
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBWA_WRITE\fR\fR
-.ad
-.RS 16n
+.It Sy WA_WRITE
write access
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBWA_EXEC\fR\fR
-.ad
-.RS 16n
+.It Sy WA_EXEC
execution access
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBWA_TRAPAFTER\fR\fR
-.ad
-.RS 16n
+.It Sy WA_TRAPAFTER
trap after the instruction completes
-.RE
-
-.sp
-.LP
-If \fBpr_wflags\fR is non-empty, a watched area is established for the virtual
-address range specified by \fBpr_vaddr\fR and \fBpr_size\fR. If \fBpr_wflags\fR
+.El
+.Pp
+If
+.Sy pr_wflags
+is non-empty, a watched area is established for the virtual
+address range specified by
+.Sy pr_vaddr
+and
+.Sy pr_size .
+If
+.Sy pr_wflags
is empty, any previously-established watched area starting at the specified
-virtual address is cleared; \fBpr_size\fR is ignored.
-.sp
-.LP
+virtual address is cleared;
+.Sy pr_size
+is ignored.
+.Pp
A watchpoint is triggered when an lwp in the traced process makes a memory
reference that covers at least one byte of a watched area and the memory
-reference is as specified in \fBpr_wflags\fR. When an lwp triggers a
-watchpoint, it incurs a watchpoint trap. If \fBFLTWATCH\fR is being traced, the
-lwp stops; otherwise, it is sent a \fBSIGTRAP\fR signal; if \fBSIGTRAP\fR is
-being traced and is not blocked, the lwp stops.
-.sp
-.LP
+reference is as specified in
+.Sy pr_wflags .
+When an lwp triggers a watchpoint, it incurs a watchpoint trap.
+If
+.Sy FLTWATCH
+is being traced, the lwp stops; otherwise, it is sent a
+.Sy SIGTRAP
+signal; if
+.Sy SIGTRAP
+is being traced and is not blocked, the lwp stops.
+.Pp
The watchpoint trap occurs before the instruction completes unless
-\fBWA_TRAPAFTER\fR was specified, in which case it occurs after the instruction
-completes. If it occurs before completion, the memory is not modified. If it
-occurs after completion, the memory is modified (if the access is a write
+.Sy WA_TRAPAFTER
+was specified, in which case it occurs after the instruction completes.
+If it occurs before completion, the memory is not modified.
+If it occurs after completion, the memory is modified (if the access is a write
access).
-.sp
-.LP
-Physical i/o is an exception for watchpoint traps. In this instance, there is
-no guarantee that memory before the watched area has already been modified (or
-in the case of \fBWA_TRAPAFTER\fR, that the memory following the watched area
+.Pp
+Physical i/o is an exception for watchpoint traps.
+In this instance, there is no guarantee that memory before the watched area
+has already been modified (or in the case of
+.Sy WA_TRAPAFTER ,
+that the memory following the watched area
has not been modified) when the watchpoint trap occurs and the lwp stops.
-.sp
-.LP
-\fBpr_info\fR in the \fBlwpstatus\fR structure contains information pertinent
-to the watchpoint trap. In particular, the \fBsi_addr\fR field contains the
+.Pp
+.Sy pr_info
+in the
+.Vt lwpstatus
+structure contains information pertinent to the watchpoint trap.
+In particular, the
+.Sy si_addr
+field contains the
virtual address of the memory reference that triggered the watchpoint, and the
-\fBsi_code\fR field contains one of \fBTRAP_RWATCH\fR, \fBTRAP_WWATCH\fR, or
-\fBTRAP_XWATCH\fR, indicating read, write, or execute access, respectively. The
-\fBsi_trapafter\fR field is zero unless \fBWA_TRAPAFTER\fR is in effect for
-this watched area; non-zero indicates that the current instruction is not the
-instruction that incurred the watchpoint trap. The \fBsi_pc\fR field contains
-the virtual address of the instruction that incurred the trap.
-.sp
-.LP
+.Sy si_code
+field contains one of
+.Sy TRAP_RWATCH ,
+.Sy TRAP_WWATCH ,
+or
+.Sy TRAP_XWATCH ,
+indicating read, write, or execute access, respectively.
+The
+.Sy si_trapafter
+field is zero unless
+.Sy WA_TRAPAFTER
+is in effect for this watched area; non-zero indicates that the current
+instruction is not the instruction that incurred the watchpoint trap.
+The
+.Sy si_pc
+field contains the virtual address of the instruction that incurred the trap.
+.Pp
A watchpoint trap may be triggered while executing a system call that makes
-reference to the traced process's memory. The lwp that is executing the system
-call incurs the watchpoint trap while still in the system call. If it stops as
-a result, the \fBlwpstatus\fR structure contains the system call number and its
-arguments. If the lwp does not stop, or if it is set running again without
-clearing the signal or fault, the system call fails with \fBEFAULT\fR. If
-\fBWA_TRAPAFTER\fR was specified, the memory reference will have completed and
+reference to the traced process's memory.
+The lwp that is executing the system call incurs the watchpoint trap while
+still in the system call.
+If it stops as a result, the
+.Vt lwpstatus
+structure contains the system call number and its arguments.
+If the lwp does not stop, or if it is set running again without
+clearing the signal or fault, the system call fails with
+.Er EFAULT .
+If
+.Sy WA_TRAPAFTER
+was specified, the memory reference will have completed and
the memory will have been modified (if the access was a write access) when the
watchpoint trap occurs.
-.sp
-.LP
-If more than one of \fBWA_READ\fR, \fBWA_WRITE\fR, and \fBWA_EXEC\fR is
-specified for a watched area, and a single instruction incurs more than one of
-the specified types, only one is reported when the watchpoint trap occurs. The
-precedence is \fBWA_EXEC\fR, \fBWA_READ\fR, \fBWA_WRITE\fR (\fBWA_EXEC\fR and
-\fBWA_READ\fR take precedence over \fBWA_WRITE\fR), unless \fBWA_TRAPAFTER\fR
-was specified, in which case it is \fBWA_WRITE\fR, \fBWA_READ\fR, \fBWA_EXEC\fR
-(\fBWA_WRITE\fR takes precedence).
-.sp
-.LP
-\fBPCWATCH\fR fails with \fBEINVAL\fR if an attempt is made to specify
-overlapping watched areas or if \fBpr_wflags\fR contains flags other than those
-specified above. It fails with \fBENOMEM\fR if an attempt is made to establish
-more watched areas than the system can support (the system can support
-thousands).
-.sp
-.LP
-The child of a \fBvfork\fR(2) borrows the parent's address space. When a
-\fBvfork\fR(2) is executed by a traced process, all watched areas established
+.Pp
+If more than one of
+.Sy WA_READ ,
+.Sy WA_WRITE ,
+and
+.Sy WA_EXEC
+is specified for a watched area, and a single instruction incurs more than one
+of the specified types, only one is reported when the watchpoint trap occurs.
+The precedence is
+.Sy WA_EXEC ,
+.Sy WA_READ ,
+.Sy WA_WRITE
+.Pf ( Sy WA_EXEC
+and
+.Sy WA_READ
+take precedence over
+.Sy WA_WRITE ) ,
+unless
+.Sy WA_TRAPAFTER
+was specified, in which case it is
+.Sy WA_WRITE ,
+.Sy WA_READ ,
+.Sy WA_EXEC
+.Pf ( Sy WA_WRITE
+takes precedence).
+.Pp
+.Sy PCWATCH
+fails with
+.Er EINVAL
+if an attempt is made to specify overlapping watched areas or if
+.Sy pr_wflags
+contains flags other than those specified above.
+It fails with
+.Er ENOMEM
+if an attempt is made to establish more watched areas than the system can
+support (the system can support thousands).
+.Pp
+The child of a
+.Xr vfork 2
+borrows the parent's address space.
+When a
+.Xr vfork 2
+is executed by a traced process, all watched areas established
for the parent are suspended until the child terminates or performs an
-\fBexec\fR(2). Any watched areas established independently in the child are
+.Xr exec 2 .
+Any watched areas established independently in the child are
cancelled when the parent resumes after the child's termination or
-\fBexec\fR(2). \fBPCWATCH\fR fails with \fBEBUSY\fR if applied to the parent of
-a \fBvfork\fR(2) before the child has terminated or performed an \fBexec\fR(2).
-The \fBPR_VFORKP\fR flag is set in the \fBpstatus\fR structure for such a
-parent process.
-.sp
-.LP
+.Xr exec 2 .
+.Sy PCWATCH
+fails with
+.Er EBUSY
+if applied to the parent of a
+.Xr vfork 2
+before the child has terminated or performed an
+.Xr exec 2 .
+The
+.Sy PR_VFORKP
+flag is set in the
+.Sy pstatus
+structure for such a parent process.
+.Pp
Certain accesses of the traced process's address space by the operating system
-are immune to watchpoints. The initial construction of a signal stack frame
-when a signal is delivered to an lwp will not trigger a watchpoint trap even if
-the new frame covers watched areas of the stack. Once the signal handler is
-entered, watchpoint traps occur normally. On SPARC based machines, register
-window overflow and underflow will not trigger watchpoint traps, even if the
-register window save areas cover watched areas of the stack.
-.sp
-.LP
+are immune to watchpoints.
+The initial construction of a signal stack frame when a signal is delivered to
+an lwp will not trigger a watchpoint trap even if the new frame covers watched
+areas of the stack.
+Once the signal handler is entered, watchpoint traps occur normally.
+On SPARC based machines, register window overflow and underflow will not
+trigger watchpoint traps, even if the register window save areas cover watched
+areas of the stack.
+.Pp
Watched areas are not inherited by child processes, even if the traced
-process's inherit-on-fork mode, \fBPR_FORK\fR, is set (see \fBPCSET\fR, below).
+process's inherit-on-fork mode,
+.Sy PR_FORK ,
+is set (see
+.Sy PCSET ,
+below).
All watched areas are cancelled when the traced process performs a successful
-\fBexec\fR(2).
-.SS "PCSET PCUNSET"
-.LP
-\fBPCSET\fR sets one or more modes of operation for the traced process.
-\fBPCUNSET\fR unsets these modes. The modes to be set or unset are specified by
-flags in an operand \fBlong\fR in the control message:
-.sp
-.ne 2
-.na
-\fB\fBPR_FORK\fR\fR
-.ad
-.RS 13n
+.Xr exec 2 .
+.Ss PCSET PCUNSET
+.Sy PCSET
+sets one or more modes of operation for the traced process.
+.Sy PCUNSET
+unsets these modes.
+The modes to be set or unset are specified by flags in an operand
+.Sy long
+in the control message:
+.Bl -tag -offset left -width "PR_MSFORK"
+.It Sy PR_FORK
(inherit-on-fork): When set, the process's tracing flags and its
-inherit-on-fork mode are inherited by the child of a \fBfork\fR(2),
-\fBfork1\fR(2), or \fBvfork\fR(2). When unset, child processes start with all
-tracing flags cleared.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPR_RLC\fR\fR
-.ad
-.RS 13n
-(run-on-last-close): When set and the last writable \fB/proc\fR file descriptor
-referring to the traced process or any of its lwps is closed, all of the
-process's tracing flags and watched areas are cleared, any outstanding stop
-directives are canceled, and if any lwps are stopped on events of interest,
-they are set running as though \fBPCRUN\fR had been applied to them. When
-unset, the process's tracing flags and watched areas are retained and lwps are
-not set running on last close.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPR_KLC\fR\fR
-.ad
-.RS 13n
-(kill-on-last-close): When set and the last writable \fB/proc\fR file
-descriptor referring to the traced process or any of its lwps is closed, the
-process is terminated with \fBSIGKILL\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPR_ASYNC\fR\fR
-.ad
-.RS 13n
+inherit-on-fork mode are inherited by the child of a
+.Xr fork 2 ,
+.Xr fork1 2 ,
+or
+.Xr vfork 2 .
+When unset, child processes start with all tracing flags cleared.
+.It Sy PR_RLC
+(run-on-last-close): When set and the last writable
+.Pa /proc
+file descriptor referring to the traced process or any of its lwps is closed,
+all of the process's tracing flags and watched areas are cleared, any
+outstanding stop directives are canceled, and if any lwps are stopped on
+events of interest, they are set running as though
+.Sy PCRUN
+had been applied to them.
+When unset, the process's tracing flags and watched areas are retained and
+lwps are not set running on last close.
+.It Sy PR_KLC
+(kill-on-last-close): When set and the last writable
+.Pa /proc
+file descriptor referring to the traced process or any of its lwps is closed,
+the process is terminated with
+.Sy SIGKILL .
+.It Sy PR_ASYNC
(asynchronous-stop): When set, a stop on an event of interest by one lwp does
-not directly affect any other lwp in the process. When unset and an lwp stops
-on an event of interest other than \fBPR_REQUESTED\fR, all other lwps in the
-process are directed to stop.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPR_MSACCT\fR\fR
-.ad
-.RS 13n
+not directly affect any other lwp in the process.
+When unset and an lwp stops on an event of interest other than
+.Sy PR_REQUESTED ,
+all other lwps in the process are directed to stop.
+.It Sy PR_MSACCT
(microstate accounting): Microstate accounting is now continuously enabled.
This flag is deprecated and no longer has any effect upon microstate
-accounting. Applications may toggle this flag; however, microstate accounting
+accounting.
+Applications may toggle this flag; however, microstate accounting
will remain enabled regardless.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPR_MSFORK\fR\fR
-.ad
-.RS 13n
+.It Sy PR_MSFORK
(inherit microstate accounting): All processes now inherit microstate
-accounting, as it is continuously enabled. This flag has been deprecated and
-its use no longer has any effect upon the behavior of microstate accounting.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPR_BPTADJ\fR\fR
-.ad
-.RS 13n
+accounting, as it is continuously enabled.
+This flag has been deprecated and its use no longer has any effect upon the
+behavior of microstate accounting.
+.It Sy PR_BPTADJ
(breakpoint trap pc adjustment): On x86-based machines, a breakpoint trap
-leaves the program counter (the \fBEIP\fR) referring to the breakpointed
-instruction plus one byte. When \fBPR_BPTADJ\fR is set, the system will adjust
-the program counter back to the location of the breakpointed instruction when
-the lwp stops on a breakpoint. This flag has no effect on SPARC based machines,
-where breakpoint traps leave the program counter referring to the breakpointed
-instruction.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPR_PTRACE\fR\fR
-.ad
-.RS 13n
+leaves the program counter (the
+.Sy EIP )
+referring to the breakpointed instruction plus one byte.
+When
+.Sy PR_BPTADJ
+is set, the system will adjust the program counter back to the location of the
+breakpointed instruction when the lwp stops on a breakpoint.
+This flag has no effect on SPARC based machines, where breakpoint traps leave
+the program counter referring to the breakpointed instruction.
+.It Sy PR_PTRACE
(ptrace-compatibility): When set, a stop on an event of interest by the traced
-process is reported to the parent of the traced process by \fBwait\fR(3C),
-\fBSIGTRAP\fR is sent to the traced process when it executes a successful
-\fBexec\fR(2), setuid/setgid flags are not honored for execs performed by the
+process is reported to the parent of the traced process by
+.Xr wait 3C ,
+.Sy SIGTRAP
+is sent to the traced process when it executes a successful
+.Xr exec 2 ,
+setuid/setgid flags are not honored for execs performed by the
traced process, any exec of an object file that the traced process cannot read
-fails, and the process dies when its parent dies. This mode is deprecated; it
-is provided only to allow \fBptrace\fR(3C) to be implemented as a library
-function using \fB/proc\fR.
-.RE
-
-.sp
-.LP
-It is an error (\fBEINVAL\fR) to specify flags other than those described above
-or to apply these operations to a system process. The current modes are
-reported in the \fBpr_flags\fR field of \fB/proc/\fR\fIpid\fR\fB/status\fR and
-\fB/proc/\fR\fIpid\fR\fB/lwp/\fR\fIlwp\fR\fB/lwpstatus\fR.
-.SS "PCSREG"
-.LP
+fails, and the process dies when its parent dies.
+This mode is deprecated; it is provided only to allow
+.Xr ptrace 3C
+to be implemented as a library function using
+.Pa /proc .
+.El
+.Pp
+It is an error
+.Pq Er EINVAL
+to specify flags other than those described above
+or to apply these operations to a system process.
+The current modes are reported in the
+.Sy pr_flags
+field of
+.Pa /proc/ Ns Em pid Ns Pa /status
+and
+.Pa /proc/ Ns Em pid Ns Pa /lwp/ Ns Em lwp Ns Pa /lwpstatus .
+.Ss PCSREG
Set the general registers for the specific or representative lwp according to
-the operand \fBprgregset_t\fR structure.
-.sp
-.LP
+the operand
+.Vt prgregset_t
+structure.
+.Pp
On SPARC based systems, only the condition-code bits of the processor-status
register (R_PSR) of SPARC V8 (32-bit) processes can be modified by
-\fBPCSREG\fR. Other privileged registers cannot be modified at all.
-.sp
-.LP
+.Sy PCSREG .
+Other privileged registers cannot be modified at all.
+.Pp
On x86-based systems, only certain bits of the flags register (EFL) can be
-modified by \fBPCSREG\fR: these include the condition codes, direction-bit, and
-overflow-bit.
-.sp
-.LP
-\fBPCSREG\fR fails with \fBEBUSY\fR if the lwp is not stopped on an event of
-interest.
-.SS "PCSVADDR"
-.LP
+modified by
+.Sy PCSREG :
+these include the condition codes, direction-bit, and overflow-bit.
+.Pp
+.Sy PCSREG
+fails with
+.Er EBUSY
+if the lwp is not stopped on an event of interest.
+.Ss PCSVADDR
Set the address at which execution will resume for the specific or
-representative lwp from the operand \fBlong\fR. On SPARC based systems, both
-%pc and %npc are set, with %npc set to the instruction following the virtual
-address. On x86-based systems, only %eip is set. \fBPCSVADDR\fR fails with
-\fBEBUSY\fR if the lwp is not stopped on an event of interest.
-.SS "PCSFPREG"
-.LP
+representative lwp from the operand
+.Vt long .
+On SPARC based systems, both %pc and %npc are set, with %npc set to the
+instruction following the virtual address.
+On x86-based systems, only %eip is set.
+.Sy PCSVADDR
+fails with
+.Er EBUSY
+if the lwp is not stopped on an event of interest.
+.Ss PCSFPREG
Set the floating-point registers for the specific or representative lwp
-according to the operand \fBprfpregset_t\fR structure. An error (\fBEINVAL\fR)
+according to the operand
+.Vt prfpregset_t
+structure.
+An error
+.Pq Er EINVAL
is returned if the system does not support floating-point operations (no
floating-point hardware and the system does not emulate floating-point machine
-instructions). \fBPCSFPREG\fR fails with \fBEBUSY\fR if the lwp is not stopped
-on an event of interest.
-.SS "PCSXREG"
-.LP
+instructions).
+.Sy PCSFPREG
+fails with
+.Er EBUSY
+if the lwp is not stopped on an event of interest.
+.Ss PCSXREG
Set the extra state registers for the specific or representative lwp according
-to the architecture-dependent operand \fBprxregset_t\fR structure. An error
-(\fBEINVAL\fR) is returned if the system does not support extra state
-registers. \fBPCSXREG\fR fails with \fBEBUSY\fR if the lwp is not stopped on an
-event of interest.
-.SS "PCSASRS"
-.LP
+to the architecture-dependent operand
+.Vt prxregset_t
+structure.
+An error
+.Pq Er EINVAL
+is returned if the system does not support extra state registers.
+.Sy PCSXREG
+fails with
+.Er EBUSY
+if the lwp is not stopped on an event of interest.
+.Ss PCSASRS
Set the ancillary state registers for the specific or representative lwp
-according to the SPARC V9 platform-dependent operand \fBasrset_t\fR structure.
-An error (\fBEINVAL\fR) is returned if either the target process or the
-controlling process is not a 64-bit SPARC V9 process. Most of the ancillary
-state registers are privileged registers that cannot be modified. Only those
-that can be modified are set; all others are silently ignored. \fBPCSASRS\fR
-fails with \fBEBUSY\fR if the lwp is not stopped on an event of interest.
-.SS "PCAGENT"
-.LP
+according to the SPARC V9 platform-dependent operand
+.Vt asrset_t
+structure.
+An error
+.Pq Er EINVAL
+is returned if either the target process or the
+controlling process is not a 64-bit SPARC V9 process.
+Most of the ancillary state registers are privileged registers that cannot be
+modified.
+Only those that can be modified are set; all others are silently ignored.
+.Sy PCSASRS
+fails with
+.Er EBUSY
+if the lwp is not stopped on an event of interest.
+.Ss PCAGENT
Create an agent lwp in the controlled process with register values from the
-operand \fBprgregset_t\fR structure (see \fBPCSREG\fR, above). The agent lwp is
-created in the stopped state showing \fBPR_REQUESTED\fR and with its held
-signal set (the signal mask) having all signals except \fBSIGKILL\fR and
-\fBSIGSTOP\fR blocked.
-.sp
-.LP
-The \fBPCAGENT\fR operation fails with \fBEBUSY\fR unless the process is fully
-stopped via \fB/proc\fR, that is, unless all of the lwps in the process are
-stopped either on events of interest or on \fBPR_SUSPENDED\fR, or are stopped
-on \fBPR_JOBCONTROL\fR and have been directed to stop via \fBPCDSTOP\fR. It
-fails with \fBEBUSY\fR if an agent lwp already exists. It fails with
-\fBENOMEM\fR if system resources for creating new lwps have been exhausted.
-.sp
-.LP
-Any \fBPCRUN\fR operation applied to the process control file or to the control
-file of an lwp other than the agent lwp fails with \fBEBUSY\fR as long as the
-agent lwp exists. The agent lwp must be caused to terminate by executing the
-\fBSYS_lwp_exit\fR system call trap before the process can be restarted.
-.sp
-.LP
+operand
+.Vt prgregset_t
+structure (see
+.Sy PCSREG ,
+above).
+The agent lwp is created in the stopped state showing
+.Sy PR_REQUESTED
+and with its held signal set (the signal mask) having all signals except
+.Sy SIGKILL
+and
+.Sy SIGSTOP
+blocked.
+.Pp
+The
+.Sy PCAGENT
+operation fails with
+.Er EBUSY
+unless the process is fully stopped via
+.Pa /proc ,
+that is, unless all of the lwps in the process are
+stopped either on events of interest or on
+.Sy PR_SUSPENDED ,
+or are stopped on
+.Sy PR_JOBCONTROL
+and have been directed to stop via
+.Sy PCDSTOP .
+It fails with
+.Er EBUSY
+if an agent lwp already exists.
+It fails with
+.Er ENOMEM
+if system resources for creating new lwps have been exhausted.
+.Pp
+Any
+.Sy PCRUN
+operation applied to the process control file or to the control
+file of an lwp other than the agent lwp fails with
+.Er EBUSY
+as long as the agent lwp exists.
+The agent lwp must be caused to terminate by executing the
+.Sy SYS_lwp_exit
+system call trap before the process can be restarted.
+.Pp
Once the agent lwp is created, its lwp-ID can be found by reading the process
-status file. To facilitate opening the agent lwp's control and status files,
-the directory name \fB/propc/\fR\fIpid\fR\fB/lwp/agent\fR is accepted for
-lookup operations as an invisible alias for
-\fB/proc/\fR\fIpid\fR\fB/lwp/\fR\fIlwpid,\fR \fIlwpid\fR being the lwp-ID of
-the agent lwp (invisible in the sense that the name ``agent'' does not appear
-in a directory listing of \fB/proc/\fR\fIpid\fR\fB/lwp\fR obtained from
-\fBls\fR(1), \fBgetdents\fR(2), or \fBreaddir\fR(3C)).
-.sp
-.LP
+status file.
+To facilitate opening the agent lwp's control and status files,
+the directory name
+.Pa /proc/ Ns Em pid Ns Pa /lwp/agent
+is accepted for lookup operations as an invisible alias for
+.Pa /proc/ Ns Em pid Ns Pa /lwp/ Ns Em lwpid ,
+.Em lwpid
+being the lwp-ID of the agent lwp (invisible in the sense that the name
+.Dq agent
+does not appear in a directory listing of
+.Pa /proc/ Ns Em pid Ns Pa /lwp
+obtained from
+.Xr ls 1 ,
+.Xr getdents 2 ,
+or
+.Xr readdir 3C .
+.Pp
The purpose of the agent lwp is to perform operations in the controlled process
on behalf of the controlling process: to gather information not directly
-available via \fB/proc\fR files, or in general to make the process change state
-in ways not directly available via \fB/proc\fR control operations. To make use
-of an agent lwp, the controlling process must be capable of making it execute
-system calls (specifically, the \fBSYS_lwp_exit\fR system call trap). The
-register values given to the agent lwp on creation are typically the registers
-of the representative lwp, so that the agent lwp can use its stack.
-.sp
-.LP
+available via
+.Pa /proc
+files, or in general to make the process change state
+in ways not directly available via
+.Pa /proc
+control operations.
+To make use of an agent lwp, the controlling process must be capable of making
+it execute system calls (specifically, the
+.Sy SYS_lwp_exit
+system call trap).
+The register values given to the agent lwp on creation are typically the
+registers of the representative lwp, so that the agent lwp can use its stack.
+.Pp
If the controlling process neglects to force the agent lwp to execute the
-\fBSYS_lwp_exit\fR system call (due to either logic error or fatal failure on
+.Sy SYS_lwp_exit
+system call (due to either logic error or fatal failure on
the part of the controlling process), the agent lwp will remain in the target
-process. For purposes of being able to debug these otherwise rogue agents,
+process.
+For purposes of being able to debug these otherwise rogue agents,
information as to the creator of the agent lwp is reflected in that lwp's
-\fBspymaster\fR file in \fB/proc\fR. Should the target process generate a core
+.Pa spymaster
+file in
+.Pa /proc .
+Should the target process generate a core
dump with the agent lwp in place, this information will be available via the
-\fBNT_SPYMASTER\fR note in the core file (see \fBcore\fR(4)).
-.sp
-.LP
-The agent lwp is not allowed to execute any variation of the \fBSYS_fork\fR or
-\fBSYS_exec\fR system call traps. Attempts to do so yield \fBENOTSUP\fR to the
-agent lwp.
-.sp
-.LP
-Symbolic constants for system call trap numbers like \fBSYS_lwp_exit\fR and
-\fBSYS_lwp_create\fR can be found in the header file <\fBsys/syscall.h\fR>.
-.SS "PCREAD PCWRITE"
-.LP
-Read or write the target process's address space via a \fBpriovec\fR structure
-operand:
-.sp
-.in +2
-.nf
+.Sy NT_SPYMASTER
+note in the core file (see
+.Xr core 4 ) .
+.Pp
+The agent lwp is not allowed to execute any variation of the
+.Sy SYS_fork
+or
+.Sy SYS_exec
+system call traps.
+Attempts to do so yield
+.Er ENOTSUP
+to the agent lwp.
+.Pp
+Symbolic constants for system call trap numbers like
+.Sy SYS_lwp_exit
+and
+.Sy SYS_lwp_create
+can be found in the header file
+.In sys/syscall.h .
+.Ss PCREAD PCWRITE
+Read or write the target process's address space via a
+.Vt priovec
+structure operand:
+.Bd -literal -offset 2
typedef struct priovec {
void *pio_base; /* buffer in controlling process */
size_t pio_len; /* size of read/write request in bytes */
off_t pio_offset; /* virtual address in target process */
} priovec_t;
-.fi
-.in -2
-
-.sp
-.LP
-These operations have the same effect as \fBpread\fR(2) and \fBpwrite\fR(2),
-respectively, of the target process's address space file. The difference is
-that more than one \fBPCREAD\fR or \fBPCWRITE\fR control operation can be
+.Ed
+.Pp
+These operations have the same effect as
+.Xr pread 2
+and
+.Xr pwrite 2 ,
+respectively, of the target process's address space file.
+The difference is that more than one
+.Sy PCREAD
+or
+.Sy PCWRITE
+control operation can be
written to the control file at once, and they can be interspersed with other
-control operations in a single write to the control file. This is useful, for
-example, when planting many breakpoint instructions in the process's address
-space, or when stepping over a breakpointed instruction. Unlike \fBpread\fR(2)
-and \fBpwrite\fR(2), no provision is made for partial reads or writes; if the
-operation cannot be performed completely, it fails with \fBEIO\fR.
-.SS "PCNICE"
-.LP
-The traced process's \fBnice\fR(2) value is incremented by the amount in the
-operand \fBlong\fR. Only a process with the {\fBPRIV_PROC_PRIOCNTL\fR}
+control operations in a single write to the control file.
+This is useful, for example, when planting many breakpoint instructions in
+the process's address space, or when stepping over a breakpointed instruction.
+Unlike
+.Xr pread 2
+and
+.Xr pwrite 2 ,
+no provision is made for partial reads or writes; if the
+operation cannot be performed completely, it fails with
+.Er EIO .
+.Ss PCNICE
+The traced process's
+.Xr nice 2
+value is incremented by the amount in the
+operand
+.Vt long .
+Only a process with the
+.Brq Sy PRIV_PROC_PRIOCNTL
privilege asserted in its effective set can better a process's priority in this
-way, but any user may lower the priority. This operation is not meaningful for
-all scheduling classes.
-.SS "PCSCRED"
-.LP
+way, but any user may lower the priority.
+This operation is not meaningful for all scheduling classes.
+.Ss PCSCRED
Set the target process credentials to the values contained in the
-\fBprcred_t\fR structure operand (see \fB/proc/\fR\fIpid\fR\fB/cred\fR). The
+.Vt prcred_t
+structure operand (see
+.Pa /proc/ Ns Em pid Ns Pa /cred ) .
+The
effective, real, and saved user-IDs and group-IDs of the target process are
-set. The target process's supplementary groups are not changed; the
-\fBpr_ngroups\fR and \fBpr_groups\fR members of the structure operand are
-ignored. Only the privileged processes can perform this operation; for all
-others it fails with \fBEPERM\fR.
-.SS "PCSCREDX"
-.LP
-Operates like \fBPCSCRED\fR but also sets the supplementary groups; the length
+set.
+The target process's supplementary groups are not changed; the
+.Sy pr_ngroups
+and
+.Sy pr_groups
+members of the structure operand are ignored.
+Only the privileged processes can perform this operation; for all
+others it fails with
+.Er EPERM .
+.Ss PCSCREDX
+Operates like
+.Sy PCSCRED
+but also sets the supplementary groups; the length
of the data written with this control operation should be "sizeof
-(\fBprcred_t\fR) + sizeof (\fBgid_t)\fR * (#groups - 1)".
-.SS "PCSPRIV"
-.LP
-Set the target process privilege to the values contained in the \fBprpriv_t\fR
-operand (see \fB/proc/pid/priv\fR). The effective, permitted, inheritable, and
-limit sets are all changed. Privilege flags can also be set. The process is
-made privilege aware unless it can relinquish privilege awareness. See
-\fBprivileges\fR(5).
-.sp
-.LP
-The limit set of the target process cannot be grown. The other privilege sets
-must be subsets of the intersection of the effective set of the calling process
-with the new limit set of the target process or subsets of the original values
-of the sets in the target process.
-.sp
-.LP
-If any of the above restrictions are not met, \fBEPERM\fR is returned. If the
-structure written is improperly formatted, \fBEINVAL\fR is returned.
-.SH PROGRAMMING NOTES
-.LP
-For security reasons, except for the \fBpsinfo\fR, \fBusage\fR, \fBlpsinfo\fR,
-\fBlusage\fR, \fBlwpsinfo\fR, and \fBlwpusage\fR files, which are
-world-readable, and except for privileged processes, an open of a \fB/proc\fR
+.Pq Vt prcred_t
++ sizeof
+.Pq Vt gid_t
+* (#groups - 1)".
+.Ss PCSPRIV
+Set the target process privilege to the values contained in the
+.Vt prpriv_t
+operand (see
+.Pa /proc/pid/priv ) .
+The effective, permitted, inheritable, and
+limit sets are all changed.
+Privilege flags can also be set.
+The process is made privilege aware unless it can relinquish privilege awareness.
+See
+.Xr privileges 5 .
+.Pp
+The limit set of the target process cannot be grown.
+The other privilege sets must be subsets of the intersection of the effective set
+of the calling process with the new limit set of the target process or subsets of
+the original values of the sets in the target process.
+.Pp
+If any of the above restrictions are not met,
+.Er EPERM
+is returned.
+If the structure written is improperly formatted,
+.Er EINVAL
+is returned.
+.Sh PROGRAMMING NOTES
+For security reasons, except for the
+.Sy psinfo ,
+.Sy usage ,
+.Sy lpsinfo ,
+.Sy lusage ,
+.Sy lwpsinfo ,
+and
+.Sy lwpusage
+files, which are world-readable, and except for privileged processes, an open
+of a
+.Pa /proc
file fails unless both the user-ID and group-ID of the caller match those of
-the traced process and the process's object file is readable by the caller. The
-effective set of the caller is a superset of both the inheritable and the
-permitted set of the target process. The limit set of the caller is a superset
-of the limit set of the target process. Except for the world-readable files
-just mentioned, files corresponding to setuid and setgid processes can be
-opened only by the appropriately privileged process.
-.sp
-.LP
-A process that is missing the basic privilege {\fBPRIV_PROC_INFO\fR} cannot see
-any processes under \fB/proc\fR that it cannot send a signal to.
-.sp
-.LP
-A process that has {\fBPRIV_PROC_OWNER\fR} asserted in its effective set can
-open any file for reading. To manipulate or control a process, the controlling
-process must have at least as many privileges in its effective set as the
-target process has in its effective, inheritable, and permitted sets. The limit
-set of the controlling process must be a superset of the limit set of the
-target process. Additional restrictions apply if any of the uids of the target
-process are 0. See \fBprivileges\fR(5).
-.sp
-.LP
+the traced process and the process's object file is readable by the caller.
+The effective set of the caller is a superset of both the inheritable and the
+permitted set of the target process.
+The limit set of the caller is a superset of the limit set of the target
+process.
+Except for the world-readable files just mentioned, files corresponding to
+setuid and setgid processes can be opened only by the appropriately privileged
+process.
+.Pp
+A process that is missing the basic privilege
+.Brq Sy PRIV_PROC_INFO
+cannot see any processes under
+.Pa /proc
+that it cannot send a signal to.
+.Pp
+A process that has
+.Brq Sy PRIV_PROC_OWNER
+asserted in its effective set can open any file for reading.
+To manipulate or control a process, the controlling process must have at least
+as many privileges in its effective set as the target process has in its
+effective, inheritable, and permitted sets.
+The limit set of the controlling process must be a superset of the limit set
+of the target process.
+Additional restrictions apply if any of the uids of the target process are 0.
+See
+.Xr privileges 5 .
+.Pp
Even if held by a privileged process, an open process or lwp file descriptor
(other than file descriptors for the world-readable files) becomes invalid if
-the traced process performs an \fBexec\fR(2) of a setuid/setgid object file or
-an object file that the traced process cannot read. Any operation performed on
-an invalid file descriptor, except \fBclose\fR(2), fails with \fBEAGAIN\fR. In
-this situation, if any tracing flags are set and the process or any lwp file
-descriptor is open for writing, the process will have been directed to stop and
-its run-on-last-close flag will have been set (see \fBPCSET\fR). This enables a
-controlling process (if it has permission) to reopen the \fB/proc\fR files to
-get new valid file descriptors, close the invalid file descriptors, unset the
-run-on-last-close flag (if desired), and proceed. Just closing the invalid file
-descriptors causes the traced process to resume execution with all tracing
-flags cleared. Any process not currently open for writing via \fB/proc\fR, but
-that has left-over tracing flags from a previous open, and that executes a
-setuid/setgid or unreadable object file, will not be stopped but will have all
-its tracing flags cleared.
-.sp
-.LP
+the traced process performs an
+.Xr exec 2
+of a setuid/setgid object file or
+an object file that the traced process cannot read.
+Any operation performed on an invalid file descriptor, except
+.Xr close 2 ,
+fails with
+.Er EAGAIN .
+In this situation, if any tracing flags are set and the process or any lwp
+file descriptor is open for writing, the process will have been directed to
+stop and its run-on-last-close flag will have been set (see
+.Sx PCSET ) .
+This enables a controlling process (if it has permission) to reopen the
+.Pa /proc
+files to get new valid file descriptors, close the invalid file descriptors,
+unset the run-on-last-close flag (if desired), and proceed.
+Just closing the invalid file descriptors causes the traced process to resume
+execution with all tracing flags cleared.
+Any process not currently open for writing via
+.Pa /proc ,
+but that has left-over tracing flags from a previous open, and that executes
+a setuid/setgid or unreadable object file, will not be stopped but will have
+all its tracing flags cleared.
+.Pp
To wait for one or more of a set of processes or lwps to stop or terminate,
-\fB/proc\fR file descriptors (other than those obtained by opening the
-\fBcwd\fR or \fBroot\fR directories or by opening files in the \fBfd\fR or
-\fBobject\fR directories) can be used in a \fBpoll\fR(2) system call. When
-requested and returned, either of the polling events \fBPOLLPRI\fR or
-\fBPOLLWRNORM\fR indicates that the process or lwp stopped on an event of
-interest. Although they cannot be requested, the polling events \fBPOLLHUP\fR,
-\fBPOLLERR\fR, and \fBPOLLNVAL\fR may be returned. \fBPOLLHUP\fR indicates that
-the process or lwp has terminated. \fBPOLLERR\fR indicates that the file
-descriptor has become invalid. \fBPOLLNVAL\fR is returned immediately if
-\fBPOLLPRI\fR or \fBPOLLWRNORM\fR is requested on a file descriptor referring
-to a system process (see \fBPCSTOP\fR). The requested events may be empty to
-wait simply for termination.
-.SH FILES
-.ne 2
-.na
-\fB\fB/proc\fR\fR
-.ad
-.sp .6
-.RS 4n
+.Pa /proc
+file descriptors (other than those obtained by opening the
+.Pa cwd
+or
+.Pa root
+directories or by opening files in the
+.Pa fd
+or
+.Pa object
+directories) can be used in a
+.Xr poll 2
+system call.
+When requested and returned, either of the polling events
+.Sy POLLPRI
+or
+.Sy POLLWRNORM
+indicates that the process or lwp stopped on an event of
+interest.
+Although they cannot be requested, the polling events
+.Sy POLLHUP ,
+.Sy POLLERR ,
+and
+.Sy POLLNVAL
+may be returned.
+.Sy POLLHUP
+indicates that the process or lwp has terminated.
+.Sy POLLERR
+indicates that the file descriptor has become invalid.
+.Sy POLLNVAL
+is returned immediately if
+.Sy POLLPRI
+or
+.Sy POLLWRNORM
+is requested on a file descriptor referring to a system process (see
+.Sx PCSTOP ) .
+The requested events may be empty to wait simply for termination.
+.Sh FILES
+.Bl -tag -compact -width Ds
+.It Pa /proc
directory (list of processes)
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/proc/\fIpid\fR\fR\fR
-.ad
-.sp .6
-.RS 4n
+.It Pa /proc/ Ns Em pid
specific process directory
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/proc/self\fR\fR
-.ad
-.sp .6
-.RS 4n
+.It Pa /proc/self
alias for a process's own directory
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/proc/\fIpid\fR/as\fR\fR
-.ad
-.sp .6
-.RS 4n
+.It Pa /proc/ Ns Em pid Ns Pa /as
address space file
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/proc/\fIpid\fR/ctl\fR\fR
-.ad
-.sp .6
-.RS 4n
+.It Pa /proc/ Ns Em pid Ns Pa /ctl
process control file
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/proc/\fIpid\fR/status\fR\fR
-.ad
-.sp .6
-.RS 4n
+.It Pa /proc/ Ns Em pid Ns Pa /status
process status
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/proc/\fIpid\fR/lstatus\fR\fR
-.ad
-.sp .6
-.RS 4n
+.It Pa /proc/ Ns Em pid Ns Pa /lstatus
array of lwp status structs
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/proc/\fIpid\fR/psinfo\fR\fR
-.ad
-.sp .6
-.RS 4n
-process \fBps\fR(1) info
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/proc/\fIpid\fR/lpsinfo\fR\fR
-.ad
-.sp .6
-.RS 4n
-array of lwp \fBps\fR(1) info structs
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/proc/\fIpid\fR/map\fR\fR
-.ad
-.sp .6
-.RS 4n
+.It Pa /proc/ Ns Em pid Ns Pa /psinfo
+process
+.Xr ps 1
+info
+.It Pa /proc/ Ns Em pid Ns Pa /lpsinfo
+array of lwp
+.Xr ps 1
+info structs
+.It Pa /proc/ Ns Em pid Ns Pa /map
address space map
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/proc/\fIpid\fR/xmap\fR\fR
-.ad
-.sp .6
-.RS 4n
+.It Pa /proc/ Ns Em pid Ns Pa /xmap
extended address space map
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/proc/\fIpid\fR/rmap\fR\fR
-.ad
-.sp .6
-.RS 4n
+.It Pa /proc/ Ns Em pid Ns Pa /rmap
reserved address map
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/proc/\fIpid\fR/cred\fR\fR
-.ad
-.sp .6
-.RS 4n
+.It Pa /proc/ Ns Em pid Ns Pa /cred
process credentials
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/proc/\fIpid\fR/priv\fR\fR
-.ad
-.sp .6
-.RS 4n
+.It Pa /proc/ Ns Em pid Ns Pa /priv
process privileges
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/proc/\fIpid\fR/sigact\fR\fR
-.ad
-.sp .6
-.RS 4n
+.It Pa /proc/ Ns Em pid Ns Pa /sigact
process signal actions
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/proc/\fIpid\fR/auxv\fR\fR
-.ad
-.sp .6
-.RS 4n
+.It Pa /proc/ Ns Em pid Ns Pa /auxv
process aux vector
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/proc/\fIpid\fR/ldt\fR\fR
-.ad
-.sp .6
-.RS 4n
-process \fBLDT\fR (x86 only)
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/proc/\fIpid\fR/usage\fR\fR
-.ad
-.sp .6
-.RS 4n
+.It Pa /proc/ Ns Em pid Ns Pa /argv
+process argument vector
+.It Pa /proc/ Ns Em pid Ns Pa /ldt
+process
+.Sy LDT
+(x86 only)
+.It Pa /proc/ Ns Em pid Ns Pa /usage
process usage
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/proc/\fIpid\fR/lusage\fR\fR
-.ad
-.sp .6
-.RS 4n
+.It Pa /proc/ Ns Em pid Ns Pa /lusage
array of lwp usage structs
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/proc/\fIpid\fR/path\fR\fR
-.ad
-.sp .6
-.RS 4n
+.It Pa /proc/ Ns Em pid Ns Pa /path
symbolic links to process open files
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/proc/\fIpid\fR/pagedata\fR\fR
-.ad
-.sp .6
-.RS 4n
+.It Pa /proc/ Ns Em pid Ns Pa /pagedata
process page data
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/proc/\fIpid\fR/watch\fR\fR
-.ad
-.sp .6
-.RS 4n
+.It Pa /proc/ Ns Em pid Ns Pa /watch
active watchpoints
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/proc/\fIpid\fR/cwd\fR\fR
-.ad
-.sp .6
-.RS 4n
+.It Pa /proc/ Ns Em pid Ns Pa /cwd
alias for the current working directory
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/proc/\fIpid\fR/root\fR\fR
-.ad
-.sp .6
-.RS 4n
+.It Pa /proc/ Ns Em pid Ns Pa /root
alias for the root directory
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/proc/\fIpid\fR/fd\fR\fR
-.ad
-.sp .6
-.RS 4n
+.It Pa /proc/ Ns Em pid Ns Pa /fd
directory (list of open files)
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/proc/\fIpid\fR/fd/*\fR\fR
-.ad
-.sp .6
-.RS 4n
+.It Pa /proc/ Ns Em pid Ns Pa /fd/*
aliases for process's open files
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/proc/\fIpid\fR/object\fR\fR
-.ad
-.sp .6
-.RS 4n
+.It Pa /proc/ Ns Em pid Ns Pa /object
directory (list of mapped files)
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/proc/\fIpid\fR/object/a.out\fR\fR
-.ad
-.sp .6
-.RS 4n
+.It Pa /proc/ Ns Em pid Ns Pa /object/a.out
alias for process's executable file
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/proc/\fIpid\fR/object/*\fR\fR
-.ad
-.sp .6
-.RS 4n
+.It Pa /proc/ Ns Em pid Ns Pa /object/*
aliases for other mapped files
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/proc/\fIpid\fR/lwp\fR\fR
-.ad
-.sp .6
-.RS 4n
+.It Pa /proc/ Ns Em pid Ns Pa /lwp
directory (list of lwps)
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/proc/\fIpid\fR/lwp/\fIlwpid\fR\fR\fR
-.ad
-.sp .6
-.RS 4n
+.It Pa /proc/ Ns Em pid Ns Pa /lwp/ Ns Em lwpid
specific lwp directory
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/proc/\fIpid\fR/lwp/agent\fR\fR
-.ad
-.sp .6
-.RS 4n
+.It Pa /proc/ Ns Em pid Ns Pa /lwp/agent
alias for the agent lwp directory
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/proc/\fIpid\fR/lwp/\fIlwpid\fR/lwpctl\fR\fR
-.ad
-.sp .6
-.RS 4n
+.It Pa /proc/ Ns Em pid Ns Pa /lwp/ Ns Em lwpid Ns Pa /lwpctl
lwp control file
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/proc/\fIpid\fR/lwp/\fIlwpid\fR/lwpstatus\fR\fR
-.ad
-.sp .6
-.RS 4n
+.It Pa /proc/ Ns Em pid Ns Pa /lwp/ Ns Em lwpid Ns Pa /lwpstatus
lwp status
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/proc/\fIpid\fR/lwp/\fIlwpid\fR/lwpsinfo\fR\fR
-.ad
-.sp .6
-.RS 4n
-lwp \fBps\fR(1) info
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/proc/\fIpid\fR/lwp/\fIlwpid\fR/lwpusage\fR\fR
-.ad
-.sp .6
-.RS 4n
+.It Pa /proc/ Ns Em pid Ns Pa /lwp/ Ns Em lwpid Ns Pa /lwpsinfo
+lwp
+.Xr ps 1
+info
+.It Pa /proc/ Ns Em pid Ns Pa /lwp/ Ns Em lwpid Ns Pa /lwpusage
lwp usage
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/proc/\fIpid\fR/lwp/\fIlwpid\fR/gwindows\fR\fR
-.ad
-.sp .6
-.RS 4n
+.It Pa /proc/ Ns Em pid Ns Pa /lwp/ Ns Em lwpid Ns Pa /gwindows
register windows (SPARC only)
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/proc/\fIpid\fR/lwp/\fIlwpid\fR/xregs\fR\fR
-.ad
-.sp .6
-.RS 4n
+.It Pa /proc/ Ns Em pid Ns Pa /lwp/ Ns Em lwpid Ns Pa /xregs
extra state registers
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/proc/\fIpid\fR/lwp/\fIlwpid\fR/asrs\fR\fR
-.ad
-.sp .6
-.RS 4n
+.It Pa /proc/ Ns Em pid Ns Pa /lwp/ Ns Em lwpid Ns Pa /asrs
ancillary state registers (SPARC V9 only)
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/proc/\fIpid\fR/lwp/\fIlwpid\fR/spymaster\fR\fR
-.ad
-.sp .6
-.RS 4n
+.It Pa /proc/ Ns Em pid Ns Pa /lwp/ Ns Em lwpid Ns Pa /spymaster
For an agent LWP, the controlling process
-.RE
-
-.SH SEE ALSO
-.LP
-\fBls\fR(1), \fBps\fR(1), \fBchroot\fR(1M), \fBalarm\fR(2), \fBbrk\fR(2),
-\fBchdir\fR(2), \fBchroot\fR(2), \fBclose\fR(2), \fBcreat\fR(2), \fBdup\fR(2),
-\fBexec\fR(2), \fBfcntl\fR(2), \fBfork\fR(2), \fBfork1\fR(2), \fBfstat\fR(2),
-\fBgetdents\fR(2), \fBgetustack\fR(2), \fBkill\fR(2), \fBlseek\fR(2),
-\fBmmap\fR(2), \fBnice\fR(2), \fBopen\fR(2), \fBpoll\fR(2), \fBpread\fR(2),
-\fBptrace\fR(3C), \fBpwrite\fR(2), \fBread\fR(2), \fBreadlink\fR(2),
-\fBreadv\fR(2), \fBshmget\fR(2), \fBsigaction\fR(2), \fBsigaltstack\fR(2),
-\fBvfork\fR(2), \fBwrite\fR(2), \fBwritev\fR(2), \fB_stack_grow\fR(3C),
-\fBreaddir\fR(3C), \fBpthread_create\fR(3C), \fBpthread_join\fR(3C),
-\fBsiginfo.h\fR(3HEAD), \fBsignal.h\fR(3HEAD), \fBthr_create\fR(3C),
-\fBthr_join\fR(3C), \fBtypes32.h\fR(3HEAD), \fBucontext.h\fR(3HEAD),
-\fBwait\fR(3C), \fBcontract\fR(4), \fBcore\fR(4), \fBprocess\fR(4),
-\fBlfcompile\fR(5), \fBprivileges\fR(5), \fBsecurity-flags\fR(5)
-.SH DIAGNOSTICS
-.LP
+.El
+.Sh DIAGNOSTICS
Errors that can occur in addition to the errors normally associated with file
system access:
-.sp
-.ne 2
-.na
-\fB\fBE2BIG\fR\fR
-.ad
-.RS 13n
-Data to be returned in a \fBread\fR(2) of the page data file exceeds the size
-of the read buffer provided by the caller.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBEACCES\fR\fR
-.ad
-.RS 13n
+.Bl -tag -width "EOVERFLOW" -offset left
+.It Er E2BIG
+Data to be returned in a
+.Xr read 2
+of the page data file exceeds the size of the read buffer provided by the
+caller.
+.It Er EACCES
An attempt was made to examine a process that ran under a different uid than
-the controlling process and {\fBPRIV_PROC_OWNER\fR} was not asserted in the
-effective set.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBEAGAIN\fR\fR
-.ad
-.RS 13n
-The traced process has performed an \fBexec\fR(2) of a setuid/setgid object
+the controlling process and
+.Brq Sy PRIV_PROC_OWNER
+was not asserted in the effective set.
+.It Er EAGAIN
+The traced process has performed an
+.Xr exec 2
+of a setuid/setgid object
file or of an object file that it cannot read; all further operations on the
-process or lwp file descriptor (except \fBclose\fR(2)) elicit this error.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBEBUSY\fR\fR
-.ad
-.RS 13n
-\fBPCSTOP\fR, \fBPCDSTOP\fR, \fBPCWSTOP\fR, or \fBPCTWSTOP\fR was applied to a
-system process; an exclusive \fBopen\fR(2) was attempted on a \fB/proc\fR file
-for a process already open for writing; \fBPCRUN\fR, \fBPCSREG\fR,
-\fBPCSVADDR\fR, \fBPCSFPREG\fR, or \fBPCSXREG\fR was applied to a process or
+process or lwp file descriptor (except
+.Xr close 2 )
+elicit this error.
+.It Er EBUSY
+.Sy PCSTOP ,
+.Sy PCDSTOP ,
+.Sy PCWSTOP , or
+.Sy PCTWSTOP
+was applied to a system process; an exclusive
+.Xr open 2
+was attempted on a
+.Pa /proc
+file for a process already open for writing;
+.Sy PCRUN ,
+.Sy PCSREG ,
+.Sy PCSVADDR ,
+.Sy PCSFPREG ,
+or
+.Sy PCSXREG
+was applied to a process or
lwp not stopped on an event of interest; an attempt was made to mount
-\fB/proc\fR when it was already mounted; \fBPCAGENT\fR was applied to a process
+.Pa /proc
+when it was already mounted;
+.Sy PCAGENT
+was applied to a process
that was not fully stopped or that already had an agent lwp.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBEINVAL\fR\fR
-.ad
-.RS 13n
+.It Er EINVAL
In general, this means that some invalid argument was supplied to a system
-call. A non-exhaustive list of conditions eliciting this error includes: a
+call.
+A non-exhaustive list of conditions eliciting this error includes: a
control message operation code is undefined; an out-of-range signal number was
-specified with \fBPCSSIG\fR, \fBPCKILL\fR, or \fBPCUNKILL\fR; \fBSIGKILL\fR was
-specified with \fBPCUNKILL\fR; \fBPCSFPREG\fR was applied on a system that does
-not support floating-point operations; \fBPCSXREG\fR was applied on a system
-that does not support extra state registers.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBEINTR\fR\fR
-.ad
-.RS 13n
+specified with
+.Sy PCSSIG ,
+.Sy PCKILL ,
+or
+.Sy PCUNKILL ;
+.Sy SIGKILL
+was specified with
+.Sy PCUNKILL ;
+.Sy PCSFPREG
+was applied on a system that does not support floating-point operations;
+.Sy PCSXREG
+was applied on a system that does not support extra state registers.
+.It Er EINTR
A signal was received by the controlling process while waiting for the traced
-process or lwp to stop via \fBPCSTOP\fR, \fBPCWSTOP\fR, or \fBPCTWSTOP\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBEIO\fR\fR
-.ad
-.RS 13n
-A \fBwrite\fR(2) was attempted at an illegal address in the traced process.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBENOENT\fR\fR
-.ad
-.RS 13n
-The traced process or lwp has terminated after being opened. The basic
-privilege {\fBPRIV_PROC_INFO\fR} is not asserted in the effective set of the
-calling process and the calling process cannot send a signal to the target
-process.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBENOMEM\fR\fR
-.ad
-.RS 13n
+process or lwp to stop via
+.Sy PCSTOP ,
+.Sy PCWSTOP ,
+or
+.Sy PCTWSTOP .
+.It Er EIO
+A
+.Xr write 2
+was attempted at an illegal address in the traced process.
+.It Er ENOENT
+The traced process or lwp has terminated after being opened.
+The basic privilege
+.Brq Sy PRIV_PROC_INFO
+is not asserted in the effective set of the calling process and the calling
+process cannot send a signal to the target process.
+.It Er ENOMEM
The system-imposed limit on the number of page data file descriptors was
-reached on an open of \fB/proc/\fR\fIpid\fR\fB/pagedata\fR; an attempt was made
-with \fBPCWATCH\fR to establish more watched areas than the system can support;
-the \fBPCAGENT\fR operation was issued when the system was out of resources for
+reached on an open of
+.Pa /proc/ Ns Em pid Ns Pa /pagedata ;
+an attempt was made
+with
+.Sy PCWATCH
+to establish more watched areas than the system can support;
+the
+.Sy PCAGENT
+operation was issued when the system was out of resources for
creating lwps.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBENOSYS\fR\fR
-.ad
-.RS 13n
+.It Er ENOSYS
An attempt was made to perform an unsupported operation (such as
-\fBcreat\fR(2), \fBlink\fR(2), or \fBunlink\fR(2)) on an entry in \fB/proc\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBEOVERFLOW\fR\fR
-.ad
-.RS 13n
-A 32-bit controlling process attempted to read or write the \fBas\fR file or
-attempted to read the \fBmap\fR, \fBrmap\fR, or \fBpagedata\fR file of a 64-bit
-target process. A 32-bit controlling process attempted to apply one of the
-control operations \fBPCSREG\fR, \fBPCSXREG\fR, \fBPCSVADDR\fR, \fBPCWATCH\fR,
-\fBPCAGENT\fR, \fBPCREAD\fR, \fBPCWRITE\fR to a 64-bit target process.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBEPERM\fR\fR
-.ad
-.RS 13n
-The process that issued the \fBPCSCRED\fR or \fBPCSCREDX\fR operation did not
-have the {\fBPRIV_PROC_SETID\fR} privilege asserted in its effective set, or
-the process that issued the \fBPCNICE\fR operation did not have the
-{\fBPRIV_PROC_PRIOCNTL\fR} in its effective set.
-.sp
+.Xr creat 2 ,
+.Xr link 2 ,
+or
+.Xr unlink 2 )
+on an entry in
+.Pa /proc .
+.It Er EOVERFLOW
+A 32-bit controlling process attempted to read or write the
+.Pa as
+file or attempted to read the
+.Pa map ,
+.Pa rmap ,
+or
+.Pa pagedata
+file of a 64-bit target process.
+A 32-bit controlling process attempted to apply one of the
+control operations
+.Sy PCSREG ,
+.Sy PCSXREG ,
+.Sy PCSVADDR ,
+.Sy PCWATCH ,
+.Sy PCAGENT ,
+.Sy PCREAD ,
+.Sy PCWRITE
+to a 64-bit target process.
+.It Er EPERM
+The process that issued the
+.Sy PCSCRED
+or
+.Sy PCSCREDX
+operation did not have the
+.Brq Sy PRIV_PROC_SETID
+privilege asserted in its effective set, or
+the process that issued the
+.Sy PCNICE
+operation did not have the
+.Brq Sy PRIV_PROC_PRIOCNTL
+in its effective set.
+.Pp
An attempt was made to control a process of which the E, P, and I privilege
sets were not a subset of the effective set of the controlling process or the
limit set of the controlling process is not a superset of limit set of the
controlled process.
-.sp
-Any of the uids of the target process are 0 or an attempt was made to change
-any of the uids to 0 using PCSCRED and the security policy imposed additional
-restrictions. See \fBprivileges\fR(5).
-.RE
-
-.SH NOTES
-.LP
+.Pp
+Any of the uids of the target process are
+.Sy 0
+or an attempt was made to change any of the uids to
+.Sy 0
+using
+.Sy PCSCRED
+and the security policy imposed additional restrictions.
+See
+.Xr privileges 5 .
+.El
+.Sh SEE ALSO
+.Xr ls 1 ,
+.Xr ps 1 ,
+.Xr chroot 1M ,
+.Xr alarm 2 ,
+.Xr brk 2 ,
+.Xr chdir 2 ,
+.Xr chroot 2 ,
+.Xr close 2 ,
+.Xr creat 2 ,
+.Xr dup 2 ,
+.Xr exec 2 ,
+.Xr fcntl 2 ,
+.Xr fork 2 ,
+.Xr fork1 2 ,
+.Xr fstat 2 ,
+.Xr getdents 2 ,
+.Xr getustack 2 ,
+.Xr kill 2 ,
+.Xr lseek 2 ,
+.Xr mmap 2 ,
+.Xr nice 2 ,
+.Xr open 2 ,
+.Xr poll 2 ,
+.Xr pread 2 ,
+.Xr pwrite 2 ,
+.Xr read 2 ,
+.Xr readlink 2 ,
+.Xr readv 2 ,
+.Xr shmget 2 ,
+.Xr sigaction 2 ,
+.Xr sigaltstack 2 ,
+.Xr vfork 2 ,
+.Xr write 2 ,
+.Xr writev 2 ,
+.Xr _stack_grow 3C ,
+.Xr pthread_create 3C ,
+.Xr pthread_join 3C ,
+.Xr ptrace 3C ,
+.Xr readdir 3C ,
+.Xr thr_create 3C ,
+.Xr thr_join 3C ,
+.Xr wait 3C ,
+.Xr siginfo.h 3HEAD ,
+.Xr signal.h 3HEAD ,
+.Xr types32.h 3HEAD ,
+.Xr ucontext.h 3HEAD ,
+.Xr contract 4 ,
+.Xr core 4 ,
+.Xr process 4 ,
+.Xr lfcompile 5 ,
+.Xr privileges 5 ,
+.Xr security-flags 5
+.Sh NOTES
Descriptions of structures in this document include only interesting structure
elements, not filler and padding fields, and may show elements out of order for
-descriptive clarity. The actual structure definitions are contained in
-\fB<procfs.h>\fR\&.
-.SH BUGS
-.LP
-Because the old \fBioctl\fR(2)-based version of \fB/proc\fR is currently
-supported for binary compatibility with old applications, the top-level
-directory for a process, \fB/proc/\fR\fIpid\fR, is not world-readable, but it
-is world-searchable. Thus, anyone can open \fB/proc/\fR\fIpid\fR\fB/psinfo\fR
-even though \fBls\fR(1) applied to \fB/proc/\fR\fIpid\fR will fail for anyone
-but the owner or an appropriately privileged process. Support for the old
-\fBioctl\fR(2)-based version of \fB/proc\fR will be dropped in a future
-release, at which time the top-level directory for a process will be made
-world-readable.
-.sp
-.LP
-On SPARC based machines, the types \fBgregset_t\fR and \fBfpregset_t\fR defined
-in <\fBsys/regset.h\fR> are similar to but not the same as the types
-\fBprgregset_t\fR and \fBprfpregset_t\fR defined in <\fBprocfs.h\fR>.
+descriptive clarity.
+The actual structure definitions are contained in
+.In procfs.h .
+.Sh BUGS
+Because the old
+.Xr ioctl 2 Ns -based
+version of
+.Pa /proc
+is currently supported for binary compatibility with old applications, the
+top-level directory for a process,
+.Pa /proc/ Ns Em pid ,
+is not world-readable, but it is world-searchable.
+Thus, anyone can open
+.Pa /proc/ Ns Em pid Ns Pa /psinfo
+even though
+.Xr ls 1
+applied to
+.Pa /proc/ Ns Em pid
+will fail for anyone but the owner or an appropriately privileged process.
+Support for the old
+.Xr ioctl 2 Ns -based
+version of
+.Pa /proc
+will be dropped in a future release, at which time the top-level directory for
+a process will be made world-readable.
+.Pp
+On SPARC based machines, the types
+.Sy gregset_t
+and
+.Sy fpregset_t
+defined in
+.In sys/regset.h
+are similar to but not the same as the types
+.Sy prgregset_t
+and
+.Sy prfpregset_t
+defined in
+.In procfs.h .
diff --git a/usr/src/man/man4/process.4 b/usr/src/man/man4/process.4
index 50f80efca2..d709decfce 100644
--- a/usr/src/man/man4/process.4
+++ b/usr/src/man/man4/process.4
@@ -1,9 +1,10 @@
'\" te
.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 2016, Joyent, Inc.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH PROCESS 4 "Mar 25, 2008"
+.TH PROCESS 4 "Sept 6, 2016"
.SH NAME
process \- process contract type
.SH SYNOPSIS
@@ -205,6 +206,21 @@ exits.
.sp
.ne 2
.na
+\fB\fBCT_PR_KEEP_EXEC\fR\fR
+.ad
+.sp .6
+.RS 4n
+If set, the process contract template remains active across \fBexec\fR(2).
+This can be used to setup a contract for children of an application which
+is not contract-aware. If this is not set then the system clears the active
+template when the process execs. Because this option is intended for an
+application which is not contract-aware, new child process contracts will be
+automatically abandoned by the parent.
+.RE
+
+.sp
+.ne 2
+.na
\fB\fBCT_PR_NOORPHAN\fR\fR
.ad
.sp .6
diff --git a/usr/src/man/man5/Makefile b/usr/src/man/man5/Makefile
index 935cc2afa8..422ce7435f 100644
--- a/usr/src/man/man5/Makefile
+++ b/usr/src/man/man5/Makefile
@@ -14,7 +14,7 @@
# Copyright (c) 2012 by Delphix. All rights reserved.
# Copyright 2014 Nexenta Systems, Inc.
# Copyright 2014 Garrett D'Amore <garrett@damore.org>
-# Copyright (c) 2015, Joyent, Inc. All rights reserved.
+# Copyright 2016, Joyent, Inc.
#
include $(SRC)/Makefile.master
@@ -64,6 +64,7 @@ MANFILES= Intro.5 \
iconv_unicode.5 \
ieee802.3.5 \
ieee802.11.5 \
+ inotify.5 \
ipfilter.5 \
isalist.5 \
kerberos.5 \
@@ -76,6 +77,7 @@ MANFILES= Intro.5 \
loader.5 \
loader.4th.5 \
locale.5 \
+ lx.5 \
man.5 \
mandoc_char.5 \
mandoc_roff.5 \
@@ -89,6 +91,7 @@ MANFILES= Intro.5 \
ms.5 \
mutex.5 \
nfssec.5 \
+ overlay.5 \
pam_allow.5 \
pam_authtok_check.5 \
pam_authtok_get.5 \
diff --git a/usr/src/man/man5/brands.5 b/usr/src/man/man5/brands.5
index 9d7ce16d42..cc79ac173a 100644
--- a/usr/src/man/man5/brands.5
+++ b/usr/src/man/man5/brands.5
@@ -83,5 +83,4 @@ Interface Stability Evolving
\fBin.rlogind\fR(1M), \fBsshd\fR(1M), \fBzoneadm\fR(1M), \fBzonecfg\fR(1M),
\fBkill\fR(2), \fBpriocntl\fR(2), \fBgetzoneid\fR(3C), \fBucred_get\fR(3C),
\fBgetzoneid\fR(3C), \fBproc\fR(4), \fBattributes\fR(5), \fBlx\fR(5),
-\fBnative\fR(5), \fBprivileges\fR(5), \fBzones\fR(5), \fBlx_systrace\fR(7D),
-\fBcrgetzoneid\fR(9F)
+\fBprivileges\fR(5), \fBzones\fR(5), \fBcrgetzoneid\fR(9F)
diff --git a/usr/src/man/man5/inotify.5 b/usr/src/man/man5/inotify.5
new file mode 100644
index 0000000000..9b0016101d
--- /dev/null
+++ b/usr/src/man/man5/inotify.5
@@ -0,0 +1,305 @@
+'\" te
+.\" Copyright (c) 2014, Joyent, Inc. All Rights Reserved.
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.TH INOTIFY 5 "Sep 17, 2014"
+.SH NAME
+inotify \- Linux-compatible file event notification facility
+.SH SYNOPSIS
+
+.LP
+.nf
+#include <sys/inotify.h>
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+
+\fBinotify\fR is a facility for receiving file system events on specified
+files or directories. When monitoring a directory, \fBinotify\fR can be
+used to retrieve events not only on the directory, but also on any files
+that the directory contains. \fBinotify\fR originated with Linux, and
+this facility is designed to be binary-compatible with the Linux facility,
+including the following interfaces:
+
+.RS +4
+.TP
+.ie t \(bu
+.el o
+\fBinotify_init\fR(3C) creates an \fBinotify\fR instance, returning a file
+descriptor associated with the in-kernel event queue.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+\fBinotify_init1\fR(3C) also creates an \fBinotify\fR instance, but allows
+for a flags argument that controls some attributes of the returned file
+descriptor.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+\fBinotify_add_watch\fR(3C) allows a watch of a particular file or directory
+to be added to a watch list associated with the specified \fBinotify\fR
+instance. \fBinotify_add_watch\fR(3C) returns a watch descriptor that will
+be reflected in the \fIwd\fR member of the \fIinotify_event\fR structure
+returned via a \fBread\fR(2) of the instance.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+\fBinotify_rm_watch\fR(3C) removes the watch that corresponds to the specified
+watch descriptor.
+.RE
+
+When all file descriptors referring to a particular \fBinotify\fR instance
+are closed, the instance and all watches associated with that instance are
+freed.
+
+To consume events on an \fBinotify\fR instance, an application should
+issue a \fBread\fR(2) to the instance. If no events are available
+(and the \fBinotify\fR instance has not been explicitly made non-blocking
+via \fBinotify_init1\fR(3C)) the \fBread\fR(2) will block until a
+watched event occurs. If and when events are available, \fBread\fR(2) will
+return an array of the following structures:
+
+.sp
+.in +2
+.nf
+struct inotify_event {
+ int wd; /* watch descriptor */
+ uint32_t mask; /* mask of event */
+ uint32_t cookie; /* cookie for associating renames */
+ uint32_t len; /* size of name field */
+ char name[]; /* optional name */
+};
+.fi
+.in -2
+
+\fIwd\fR contains the watch descriptor that corresponds to the event,
+as returned by \fBinotify_add_watch\fR(3C).
+
+\fImask\fR is a bitwise \fBOR\fR of event masks (see below) that
+describes the event.
+
+\fIcookie\fR is an opaque value that can be used to associate different
+events into a single logical event. In particular, it allows consumers to
+associate \fBIN_MOVED_FROM\fR events with subsequent \fBIN_MOVED_TO\fR
+events.
+
+\fIlen\fR denotes the length of the \fIname\fR field, including any padding
+required for trailing null bytes and alignment. The size of the entire
+event is therefore the size of the \fIinotify_event\fR structure plus the
+value of \fIlen\fR.
+
+\fIname\fR contains the name of the file associated with the event, if any.
+This field is only present when the watched entity is a directory and
+the event corresponds to a file that was contained by the watched directory
+(though see \fBNOTES\fR and \fBWARNINGS\fR for details and limitations).
+When present, \fIname\fR is null terminated, and may contain additional
+zero bytes
+to pad for alignment. (The length of this field -- including any bytes
+for alignment -- is denoted by the \fIlen\fR field.)
+
+.SS "Events"
+
+The events that can be generated on a watched entity are as follows:
+
+.sp
+.in +2
+.TS
+c c
+l l .
+\fIEvent\fR \fIDescription\fR
+\fBIN_ACCESS\fR File/directory was accessed
+\fBIN_ATTRIB\fR File/directory attributes were changed
+\fBIN_CLOSE_WRITE\fR File/directory opened for writing was closed
+\fBIN_CLOSE_NOWRITE\fR File/directory not opened for writing was closed
+\fBIN_CREATE\fR File/directory created in watched directory
+\fBIN_DELETE\fR File/directory deleted from watched directory
+\fBIN_DELETE_SELF\fR Watched file/directory was deleted
+\fBIN_MODIFY\fR File/directory was modified
+\fBIN_MODIFY_SELF\fR Watched file/directory was modified
+\fBIN_MOVED_FROM\fR File was renamed from entity in watched directory
+\fBIN_MOVED_TO\fR File was renamed to entity in watched directory
+\fBIN_OPEN\fR File/directory was opened
+.TE
+.in -2
+
+Of these, all events except \fBIN_MOVE_SELF\fR and \fBIN_DELETE_SELF\fR
+can refer to either the watched entity or (if the watched entity
+is a directory) a file or directory contained by the watched directory.
+(See \fBNOTES\fR and \fBWARNINGS\fR, below for details on this
+mechanism and its limitations.)
+If the event corresponds to a contained entity,
+\fIname\fR will be set to the name of the affected
+entity.
+
+In addition to speciyfing events of interest, watched events may
+be modified by potentially setting any of the following when adding a
+watch via \fBinotify_add_watch\fR(3C):
+
+.sp
+.ne 2
+.na
+\fBIN_DONT_FOLLOW\fR
+.ad
+.RS 12n
+Don't follow the specified pathname if it is a symbolic link.
+.RE
+
+.sp
+.ne 2
+.na
+\fBIN_EXCL_UNLINK\fR
+.ad
+.RS 12n
+If watching a directory and a contained entity becomes unlinked, cease
+generating events for that entity. (By default, contained entities will
+continue to generate events on their former parent directory.)
+.RE
+
+.sp
+.ne 2
+.na
+\fBIN_MASK_ADD\fR
+.ad
+.RS 12n
+If the specified pathname is already being watched, the specified events
+will be added to the watched events instead of the default behavior of
+replacing them. (If one
+may forgive the editorializing, this particular interface gewgaw
+seems entirely superfluous, and a canonical example of
+feasibility trumping wisdom.)
+.RE
+
+.sp
+.ne 2
+.na
+\fBIN_ONESHOT\fR
+.ad
+.RS 12n
+Once an event has been generated for the watched entity, remove the
+watch from the watch list as if \fBinotify_rm_watch\fR(3C) had been called
+on it (thereby inducing an \fBIN_IGNORED\fR event).
+.RE
+
+.sp
+.ne 2
+.na
+\fBIN_ONLYDIR\fR
+.ad
+.RS 12n
+Only watch the specified pathname if it is a directory.
+.RE
+
+In addition to the specified events, the following bits may be specified
+in the \fImask\fR field as returned from \fBread\fR(2):
+
+.sp
+.ne 2
+.na
+\fBIN_IGNORED\fR
+.ad
+.RS 12n
+A watch was removed explicitly (i.e, via \fBinotify_rm_watch\fR(3C)) or
+implicitly (e.g., because \fBIN_ONESHOT\fR was set or because the watched
+entity was deleted).
+.RE
+
+.sp
+.ne 2
+.na
+\fBIN_ISDIR\fR
+.ad
+.RS 12n
+The entity inducing the event is a directory.
+.RE
+
+.sp
+.ne 2
+.na
+\fBIN_Q_OVERFLOW\fR
+.ad
+.RS 12n
+The event queue exceeded the maximum event queue length per instance.
+(By default, this is 16384, but it can be tuned by setting
+\fBinotify_maxevents\fR via \fB/etc/system\fR.)
+.RE
+
+.sp
+.ne 2
+.na
+\fBIN_UNMOUNT\fR
+.ad
+.RS 12n
+The filesystem containing the watched entity was unmounted.
+.RE
+
+.sp
+.SH NOTES
+.sp
+.LP
+
+\fBinotify\fR instances can be monitored via \fBpoll\fR(2),
+\fBport_get\fR(3C), \fBepoll\fR(5), etc.
+
+The event queue associated with an \fBinotify\fR instance is serialized
+and ordered: events will be placed on the tail of the queue in the order
+that they occur.
+
+If at the time an event occurs the tail of the event queue is identical
+to the newly received event, the newly received event will be dropped,
+effectively coalescing the two events.
+
+When watching a directory and receieving events on contained elements
+(i.e., a contained file or subdirectory), note that the information
+received in the \fIname\fR field may be stale: the file may have been
+renamed between the event and its processing. If a file has been unlinked
+(and if \fBIN_EXCL_UNLINK\fR has not been set),
+the \fIname\fR will reflect the last name that resolved to the file.
+If a new file is created in the same directory with the old name, events
+on the new file and the old (unlinked) file will become undistinguishable.
+
+The number of bytes that are available to be read on an \fBinotify\fR
+instance can be determined via a \fBFIONREAD\fR \fBioctl\fR(2).
+
+.sp
+.SH WARNINGS
+.sp
+.LP
+
+While a best effort has been made to mimic the Linux semantics, there
+remains a fundamental difference with respect to hard links: on Linux,
+if a file has multiple hard links to it, a notification on a watched
+directory or file will be received if and only if that event was received
+via the watched path. For events that are induced by open files
+(such as \fBIN_MODIFY\fR), these semantics seem peculiar: the watched
+file is in fact changing, but because it is not changing via the watched
+path, no notification is received. By contrast, the implementation here
+will always yield an event in this case -- even if the event was induced
+by an \fBopen\fR(2) via an unwatched path. If an event occurs within a
+watched directory on a file for which there exist multiple hard links within
+the same (watched) directory, the event's \fIname\fR will correspond to one
+of the links to the file. If multiple hard links exist to the
+same file in the same watched directory and one of the links is removed,
+notifications may not necessarily continue to be received for the file,
+despite the (remaining) link in the watched directory; users of
+\fBinotify\fR should exercise extreme caution when watching directories
+that contain files with multiple hard links in the same directory.
+
+.SH SEE ALSO
+.sp
+.LP
+\fBinotify_init\fR(3C), \fBinotify_init1\fR(3C), \fBinotify_add_watch\fR(3C),
+\fBinotify_rm_watch\fR(3C), \fBport_get\fR(3C), \fBepoll\fR(5)
diff --git a/usr/src/man/man5/lx.5 b/usr/src/man/man5/lx.5
new file mode 100644
index 0000000000..9ad903a396
--- /dev/null
+++ b/usr/src/man/man5/lx.5
@@ -0,0 +1,113 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright 2016, Joyent, Inc.
+.\"
+.Dd February 5, 2106
+.Dt LX 5
+.Os
+.Sh NAME
+.Nm lx
+.Nd zone brand for running a GNU/Linux user-level environment
+.Sh DESCRIPTION
+The
+.Em lx
+brand
+uses the
+.Xr brands 5
+framework to provide an environment for running binary applications built
+for GNU/Linux.
+User-level code, including an entire Linux distribution, can run inside the
+zone.
+Both 32-bit and 64-bit applications are supported.
+The majority of Linux system calls are provided, along with emulation for a
+variety of Linux file systems, such as
+.Em proc ,
+.Em cgroup
+and
+.Em sysfs .
+.Pp
+The
+.Em /proc
+file system within the zone is a subset of a full Linux
+.Em /proc .
+Most kernel-level tuning applied to
+.Em /proc
+is unavailable or ignored.
+Some tuning can be performed, but only to reduce the overall limits that have
+been specified on the zone's configuration.
+That is, within the zone there is no way to increase the resource limits set on
+the zone itself.
+.Pp
+The zone must be installed using a clone of a
+.Xr zfs 1m
+dataset which contains an image of the software to be run in the zone.
+.Pp
+Example:
+.Dl zoneadm -z myzone install -x nodataset -t debian7
+.Pp
+Applications provided by the base SunOS operating system are also available
+within the zone under the
+.Em /native
+mount point.
+This allows the use of various native tools such as
+.Xr dtrace 1m ,
+.Xr mdb 1 ,
+or the
+.Xr proc 1
+tools on GNU/Linux applications.
+However, not every native tool will work properly within an
+.Em lx
+zone.
+.Sh CONFIGURATION
+The
+.Em kernel-version
+attribute can be included in the zone's
+.Xr zonecfg 1m
+settings as a way to specify the Linux version that the zone is emulating.
+For example, the value could be
+.Em 3.13.0 .
+.Sh LIMITATIONS
+The brand only supports the exclusive IP stack zone configuration.
+.Pp
+Most modern GNU/Linux application software runs on
+.Em lx ,
+but because there are some system calls or file systems which are not currently
+implemented, it's possible that an application won't run.
+This does not preclude the application running in the future as the
+.Em lx
+brand adds new capabilities.
+.Pp
+Because there is only the single SunOS kernel running on the system, there
+is no support for any Linux kernel-level modules.
+That is, there is no support for add-on drivers or any other modules that are
+part of the Linux kernel itself.
+If that is required, a full virtual machine should be used instead of an
+.Em lx
+branded zone.
+.Pp
+Any core files produced within the zone are in the native SunOS format.
+.Pp
+As with any zone, the normal security mechanisms and privileges apply.
+Thus, certain operations (for example, changing the system time), will not be
+allowed unless the zone has been configured with the appropriate additional
+privileges.
+.Sh SEE ALSO
+.Xr mdb 1 ,
+.Xr proc 1 ,
+.Xr dtrace 1m ,
+.Xr zfs 1m ,
+.Xr zoneadm 1m ,
+.Xr zonecfg 1m ,
+.Xr brands 5 ,
+.Xr privileges 5 ,
+.Xr resource_controls 5 ,
+.Xr zones 5
diff --git a/usr/src/man/man5/overlay.5 b/usr/src/man/man5/overlay.5
new file mode 100644
index 0000000000..4e884fd382
--- /dev/null
+++ b/usr/src/man/man5/overlay.5
@@ -0,0 +1,521 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright 2015 Joyent, Inc.
+.\"
+.Dd Apr 09, 2015
+.Dt OVERLAY 5
+.Os
+.Sh NAME
+.Nm overlay
+.Nd Overlay Devices
+.Sh DESCRIPTION
+Overlay devices are a GLDv3 device that allows users to create overlay
+networks that can be used to form the basis of network virtualization
+and software defined networking.
+Overlay networks allow a single physical network, often called an
+.Sy underlay
+network, to provide the means for creating multiple logical, isolated,
+and discrete layer two and layer three networks on top of it.
+.Pp
+Overlay devices are administered through
+.Xr dladm 1M .
+Overlay devices themselves cannot be plumbed up with
+.Sy IP ,
+.Sy vnd ,
+or any other protocol.
+Instead, like an
+.Sy etherstub ,
+they allow for VNICs to be created on top of them.
+Like an
+.Sy etherstub ,
+an overlay device acts as a local switch; however, when it encounters a
+non-local destination address, it instead looks up where it should send
+the packet, encapsulates it, and sends it out another interface in the
+system.
+.Pp
+A single overlay device encapsulates the logic to answer two different,
+but related, questions:
+.Pp
+.Bl -enum -offset indent -compact
+.It
+How should a packet be transformed and put on the wire?
+.It
+Where should a transformed packet be sent?
+.El
+.Pp
+Each of these questions is answered by a plugin.
+The first question is answered by what's called an
+.Em encapsulation plugin .
+The second question is answered by what's called a
+.Em search plugin .
+Packets are encapsulated and decapsulated using the encapsulation plugin
+by the kernel.
+The search plugins are all user land plugins that are consumed by the
+varpd service whose FMRI is
+.Em svc:/network/varpd:default .
+This separation allows for the kernel to be responsible for the data
+path, while having the search plugins in userland allows the system to
+provide a much more expressive interface.
+.Ss Overlay Types
+Overlay devices come in two different flavors, one where all packets are
+always sent to a single address, the other, where the destination of a
+packet varies based on the target MAC address of the packet.
+This information is maintained in a
+.Em target table ,
+which is independent and unique to each overlay device.
+We call the plugins that send traffic to a single location, for example
+a single unicast or multicast IP address, a
+.Sy point to point
+overlay and the overlay devices that can send traffic to different
+locations based on the MAC address of that packet a
+.Sy dynamic
+overlay.
+The plugin type is determined based on the type of the
+.Sy search plugin .
+These are all fully listed in the section
+.Sx Plugins and their Properties .
+.Ss Overlay Destination
+Both encapsulation and search plugins define the kinds of destinations
+that they know how to support.
+An encapsulation plugin always has a single destination type that's
+determined based on how the encapsulation is defined.
+A search plugin, on the other hand, can support multiple combinations of
+destinations.
+A search plugin must support the destination type of the encapsulation
+device.
+The destination may require any of the following three pieces of
+information, depending on the encapsulation plugin:
+.Bl -hang -width Ds
+.It Sy MAC Address
+.Bd -filled -compact
+An Ethernet MAC address is required to determine the destination.
+.Ed
+.It Sy IP Address
+.Bd -filled -compact
+An IP address is required.
+Both IPv4 and IPv6 addresses are supported.
+.Ed
+.It Sy Port
+.Bd -filled -compact
+An IP protocol level (TCP, UDP, SCTP, etc.) port is required.
+.Ed
+.El
+.Pp
+The list of destination types that are supported by both the search and
+encapsulation plugins is listed in the section
+.Sx Plugins and their Properties .
+.Ss varpd
+The varpd service, mentioned above, is responsible for providing the
+virtual ARP daemon.
+Its responsibility is conceptually similar to ARP.
+It runs all instances of search plugins in the system and is responsible
+for answering the kernel's ARP-like questions for where packets should
+be sent.
+.Pp
+The varpd service, svc:/network/varpd:default, must be enabled for
+overlay devices to function.
+If it is disabled while there are active devices, then most overlay
+devices will not function correctly and likely will end up dropping
+traffic.
+.Sh PLUGINS AND PROPERTIES
+Properties fall into three categories in the system:
+.Bl -enum -offset indent -compact
+.It
+Generic properties all overlay devices have
+.It
+Properties specific to the encapsulation plugin
+.It
+Properties specific to the search plugin
+.El
+.Pp
+Each property in the system has the following attributes, which mirror
+the traditional
+.Xr dladm 1M
+link properties:
+.Bl -hang -width Ds
+.It Sy Name
+.Bd -filled -compact
+The name of a property is namespaced by its module and always structured
+and referred to as as module/property.
+This allows for both an encapsulation and search plugin to have a
+property with the same name.
+Properties that are valid for all overlay devices and not specific to a
+module do not generally use a module prefix.
+.Pp
+For example, the property
+.Sy vxlan/listen_ip
+is associated with the
+.Sy vxlan
+encapsulation module.
+.Ed
+.It Sy Type
+.Bd -filled -compact
+Each property in the system has a type.
+.Xr dladm 1M
+takes care of converting between the internal representation and a
+value, but the type influences the acceptable input range.
+The types are:
+.Bl -hang -width Ds
+.It Sy INT
+A signed integer that is up to eight bytes long
+.Pq Sy int64_t .
+.It Sy UINT
+An unsigned integer that is up to eight bytes long
+.Pq Sy uint64_t .
+.It Sy IP
+Either an IPv4 or IPv6 address in traditional string form.
+For example, 192.168.128.23 or 2001:470:8af4::1:1.
+IPv4 addresses may also be encoded as IPv4-mapped IPv6 addresses.
+.It Sy STRING
+A string of ASCII or UTF-8 encoded characters terminated with a
+.Sy NUL
+byte.
+The maximum string length, including the terminator, is currently
+256 bytes.
+.El
+.Ed
+.It Sy Permissions
+.Bd -filled -compact
+Each property has permissions associated with it, which indicate whether
+the system considers them read-only properties or read-write properties.
+A read-only property can never be updated once the device is created.
+This generally includes things like the overlay's encapsulation module.
+.Ed
+.It Sy Required
+.Bd -filled -compact
+This property indicates whether the property is required for the given
+plugin.
+If it is not specified during a call to
+.Sy dladm create-overlay ,
+then the overlay cannot be successfully created.
+Properties which have a
+.Sy default
+will use that value if one is not specified rather than cause the
+overlay creation to fail.
+.Ed
+.It Sy Current Value
+.Bd -filled -compact
+The current value of a property, if the property has a value set.
+Required properties always have a value set.
+.Ed
+.It Sy Default Value
+.Bd -filled -compact
+The default value is an optional part of a given property.
+If a property does define a default value, then it will be used when an
+overlay is created and no other value is given.
+.Ed
+.It Sy Value ranges
+.Bd -filled -compact
+Value ranges are an optional part of a given property.
+They indicate a range or set of values that are valid and may be set for
+a property.
+A property may not declare such a range as it may be impractical or
+unknown.
+For example, most properties based on IP addresses will not
+declare a range.
+.Ed
+.El
+.Pp
+The following sections describe both the modules and the properties that
+exist for each module, noting their name, type, permissions, whether or
+not they are required, and if there is a default value.
+In addition, the effects of each property will be described.
+.Ss Encapsulation Plugins
+.Bl -hang -width Ds
+.It Sy vxlan
+The
+.Sy vxlan
+module is a UDP based encapsulation method.
+It takes a frame that would be put on the wire, wraps it up in a VXLAN
+header and places it in a UDP packet that gets sent out on the
+underlying network.
+For more details about the specific format of the VXLAN header, see
+.Xr vxlan 7P .
+.Pp
+The
+.Sy vxlan
+module requires both an
+.Sy IP address
+and
+.Sy port
+to address it.
+It has a 24-bit virtual network ID space, allowing for
+virtual network identifiers that range from
+.Sy 0
+-
+.Sy 16777215 .
+.Pp
+The
+.Sy vxlan
+module has the following properties:
+.Bl -hang -width Ds
+.It Sy vxlan/listen_ip
+.Bd -filled -compact
+Type:
+.Sy IP |
+Permissions:
+.Sy Read/Write |
+.Sy Required
+.Ed
+.Bd -filled
+The
+.Sy vxlan/listen_ip
+property determines the IP address that the system will accept VXLAN
+encapsulated packets on for this overlay.
+.Ed
+.It Sy vxlan/listen_port
+.Bd -filled -compact
+Type:
+.Sy UINT |
+Permissions:
+.Sy Read/Write |
+.Sy Required
+.Ed
+.Bd -filled -compact
+Default Value:
+.Sy 4789 |
+Range:
+.Sy 0 - 65535
+.Ed
+.Bd -filled
+The
+.Sy vxlan/listen_port
+property determines the UDP port that the system will listen on for
+VXLAN traffic for this overlay.
+The default value is
+.Sy 4789 ,
+the IANA assigned port for VXLAN.
+.Ed
+.El
+.Pp
+The
+.Sy vxlan/listen_ip
+and
+.Sy vxlan/listen_port
+properties determine how the system will accept VXLAN encapsulated
+packets for this interface.
+It does not determine the interface that packets will be sent out over.
+Multiple overlays that all use VXLAN can share the same IP and port
+combination, as the virtual network identifier can be used to tell the
+different overlays apart.
+.El
+.Ss Search Plugins
+Because search plugins may support multiple destinations, they may have
+more properties listed than necessarily show up for a given overlay.
+For example, the
+.Sy direct
+plugin supports destinations that are identified by both an IP address
+and a port, or just an IP address.
+In cases where the device is created over an overlay that only uses an
+IP address for its destination, then it will not have the
+.Sy direct/dest_port
+property.
+.Bl -hang -width Ds
+.It Sy direct
+The
+.Sy direct
+plugin is a point to point module that can be used to create an overlay
+that forwards all non-local traffic to a single destination.
+It supports destinations that are a combination of an
+.Sy IP Address
+and a
+.Sy port .
+.Pp
+The
+.Sy direct
+plugin has the following properties:
+.Bl -hang -width Ds
+.It Sy direct/dest_ip
+.Bd -filled -compact
+Type:
+.Sy IP |
+Permissions:
+.Sy Read/Write |
+.Sy Required
+.Ed
+.Bd -filled
+The
+.Sy direct/dest_ip
+property indicates the IP address that all traffic will be sent out.
+Traffic will be sent out the corresponding interface based on
+traditional IP routing rules and the configuration of the networking
+stack of the global zone.
+.Ed
+.It Sy direct/dest_port
+.Bd -filled -compact
+Type:
+.Sy UINT |
+Permissions:
+.Sy Read/Write |
+.Sy Required
+.Ed
+.Bd -filled -compact
+Default Value:
+.Sy - |
+Range:
+.Sy 0 - 65535
+.Ed
+.Bd -filled
+The
+.Sy direct/dest_port
+property indicates the TCP or UDP port that all traffic will be directed
+to.
+.Ed
+.El
+.It Sy files
+The
+.Sy files
+plugin implements a
+.Sy dynamic
+plugin that specifies where traffic should be sent based on a file.
+It is a glorified version of /etc/ethers.
+The
+.Sy dynamic
+plugin does not support broadcast or multicast traffic, but it has
+support for proxy ARP, NDP, and DHCPv4.
+For the full details of the file format, see
+.Xr overlay_files 4 .
+.Pp
+The
+.Sy files
+plugin has the following property:
+.Bl -hang -width Ds
+.It Sy files/config
+.Bd -filled -compact
+Type:
+.Sy String |
+Permissions:
+.Sy Read/Write |
+.Sy Required
+.Ed
+.Bd -filled
+The
+.Sy files/config
+property specifies an absolute path to a file to read.
+The file is a JSON file that is formatted according to
+.Xr overlay_files 4 .
+.Ed
+.El
+.El
+.Ss General Properties
+Each overaly has the following properties which are used to give
+additional information about the system.
+None of these properties may be specified as part of a
+.Sy dladm create-overlay ,
+instead they come from other arguments or from internal parts of the
+system.
+.Bl -hang -width Ds
+.It Sy encap
+.Bd -filled -compact
+.Sy String |
+Permissions:
+.Sy Read Only
+.Ed
+.Bd -filled
+The
+.Sy encap
+property contains the name of the encapsulation module that's in use.
+.Ed
+.It Sy mtu
+.Bd -filled -compact
+.Sy UINT |
+Permissions:
+.Sy Read/Write
+.Ed
+.Bd -filled -compact
+Default Value:
+.Sy 1400 |
+Range:
+.Sy 576 - 9000
+.Ed
+.Bd -filled
+The
+.Sy mtu
+property describes the maximum transmission unit of the overlay.
+The default value is
+.Sy 1400
+bytes, which ensures that in a traditional deployment with an MTU of
+1500 bytes, the overhead that is added from encapsulation is all
+accounted for.
+It is the administrator's responsibility to ensure that
+the device's MTU and the encapsulation overhead does not exceed that of
+the interfaces that the encapsulated traffic will be sent out of.
+.Pp
+To modify the
+.Sy mtu
+property, use
+.Sy dladm set-linkprop .
+.Ed
+.It Sy search
+.Bd -filled -compact
+.Sy String |
+Permissions:
+.Sy Read Only
+.Ed
+.Bd -filled
+The
+.Sy search
+property contains the name of the search plugin that's in use.
+.Ed
+.It Sy varpd/id
+.Bd -filled -compact
+.Sy String |
+Permissions:
+.Sy Read Only
+.Ed
+.Bd -filled
+The
+.Sy varpd/id
+property indicates the identifier which the
+.Sy varpd
+service uses for this overlay.
+.Ed
+.It Sy vnetid
+.Bd -filled -compact
+.Sy UINT |
+Permissions:
+.Sy Read/Write
+.Ed
+.Bd -filled
+The
+.Sy vnetid
+property has the virtual network identifier that belongs to this overlay.
+The valid range for the virtual network identifier depends on the
+encapsulation engine.
+.Ed
+.El
+.Sh FMA INTEGRATION
+Overlay devices are wired into FMA, the illumos fault management
+architecture, and generates error reports depending on the
+.Sy search
+plugin in use.
+Due to limitations in FMA today, when a single overlay
+enters a degraded state, meaning that it cannot properly perform look
+ups or another error occurred, then it degrades the overall
+.Sy overlay
+pseudo-device driver.
+.Pp
+For more fine-grained information about which overlay is actually in a
+.Em degraded
+state, one should run
+.Sy dladm show-overlay -f .
+In addition, for each overlay in a degraded state a more useful
+diagnostic message is provided which describes the reason that caused
+this overlay to enter into a degraded state.
+.Pp
+The overlay driver is self-healing.
+If the problem corrects itself on its own, it will clear the fault on
+the corresponding device.
+.Sh SEE ALSO
+.Xr dladm 1M ,
+.Xr overlay_files 4 ,
+.Xr vxlan 7P
diff --git a/usr/src/man/man5/privileges.5 b/usr/src/man/man5/privileges.5
index 29ef9a18b6..9074cada11 100644
--- a/usr/src/man/man5/privileges.5
+++ b/usr/src/man/man5/privileges.5
@@ -1,6 +1,6 @@
'\" te
.\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved.
-.\" Copyright 2015, Joyent, Inc. All Rights Reserved.
+.\" Copyright 2016, Joyent, Inc. All Rights Reserved.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
.\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with
.\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
@@ -307,6 +307,16 @@ Allow a process to perform privileged mappings through a graphics device.
.sp
.ne 2
.na
+\fB\fBPRIV_HYPRLOFS_CONTROL\fR\fR
+.ad
+.sp .6
+.RS 4n
+Allow a process to perform hyprlofs name space management.
+.RE
+
+.sp
+.ne 2
+.na
\fB\fBPRIV_IPC_DAC_READ\fR\fR
.ad
.sp .6
@@ -475,7 +485,7 @@ Allow a process to change its root directory.
.ad
.sp .6
.RS 4n
-Allow a process to use high resolution timers.
+Allow a process to use high resolution timers with very small time values.
.RE
.sp
@@ -697,6 +707,16 @@ Allow a process to configure a system's datalink interfaces.
.sp
.ne 2
.na
+\fB\fBPRIV_SYS_FS_IMPORT\fR\fR
+.ad
+.sp .6
+.RS 4n
+Allow a process to import a potentially untrusted file system (e.g. ZFS recv).
+.RE
+
+.sp
+.ne 2
+.na
\fB\fBPRIV_SYS_IP_CONFIG\fR\fR
.ad
.sp .6
diff --git a/usr/src/man/man5/resource_controls.5 b/usr/src/man/man5/resource_controls.5
index fe22484bcc..8dba24173f 100644
--- a/usr/src/man/man5/resource_controls.5
+++ b/usr/src/man/man5/resource_controls.5
@@ -1,15 +1,17 @@
'\" te
.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 2017, Joyent, Inc.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH RESOURCE_CONTROLS 5 "April 9, 2016"
+.TH RESOURCE_CONTROLS 5 "April 28, 2017"
.SH NAME
-resource_controls \- resource controls available through project database
+resource_controls \- resource controls available through projects and zones
.SH DESCRIPTION
.LP
-The resource controls facility is configured through the project database. See
-\fBproject\fR(4). You can set and modify resource controls through the
+For projects the resource controls facility is configured through the project
+database. See \fBproject\fR(4). For zones, resource controls are configured
+through \fBzonecfg\fR(1M). You can set and modify resource controls through the
following utilities:
.RS +4
.TP
@@ -35,6 +37,12 @@ following utilities:
.el o
\fBrctladm\fR(1M)
.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+\fBzonecfg\fR(1M)
+.RE
.sp
.LP
In a program, you use \fBsetrctl\fR(2) to set resource control values.
@@ -115,6 +123,21 @@ number of bytes.
.sp
.ne 2
.na
+\fB\fBprocess.max-locked-memory\fR\fR
+.ad
+.sp .6
+.RS 4n
+Total amount of physical memory that can be locked by this process, expressed
+as a number of bytes. This limit is not enforced for a process with the
+\fB\fBPRIV_PROC_LOCK_MEMORY\fR\fR privilege. Because the ability to lock memory
+is controlled by the \fB\fBPRIV_PROC_LOCK_MEMORY\fR\fR privilege within native
+zones, this resource control is only useful within branded zones which might
+support a different policy for locking memory.
+.RE
+
+.sp
+.ne 2
+.na
\fB\fBprocess.max-msg-messages\fR\fR
.ad
.sp .6
@@ -282,6 +305,19 @@ Maximum allowable number of event ports, expressed as an integer.
.sp
.ne 2
.na
+\fB\fBproject.max-processes\fR\fR
+.ad
+.sp .6
+.RS 4n
+Maximum number of processes that can be active in a project. This rctl is
+similar to \fBproject.max-lwps\fR, except that zombie processes are included.
+This rctl prevents process-slot exhaustion which can occur due to an excessive
+number of zombies. Expressed as an integer.
+.RE
+
+.sp
+.ne 2
+.na
\fB\fBproject.max-sem-ids\fR\fR
.ad
.sp .6
@@ -370,6 +406,33 @@ The following zone-wide resource controls are available:
.sp
.ne 2
.na
+\fB\fBzone.cpu-baseline\fR\fR
+.ad
+.sp .6
+.RS 4n
+Sets a baseline amount of CPU time that a zone can use before it is considered
+to be bursting. The unit used is the percentage of a single CPU that is being
+used by all user threads in a zone. The value should be less than the
+\fBzone.cpu-cap\fR rctl value and is expressed as an integer.
+This resource control does not support the \fBsyslog\fR action.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fBzone.cpu-burst-time\fR\fR
+.ad
+.sp .6
+.RS 4n
+Sets the number of seconds that a zone can exceed the \fBzone.cpu-baseline\fR
+rctl value before being cpu-capped down to the \fBzone.cpu-baseline\fR.
+A value of 0 means that \fBzone.cpu-baseline\fR can be exceeded indefinitely.
+This resource control does not support the \fBsyslog\fR action.
+.RE
+
+.sp
+.ne 2
+.na
\fB\fBzone.cpu-cap\fR\fR
.ad
.sp .6
@@ -388,7 +451,7 @@ not support the \fBsyslog\fR action.
.ad
.sp .6
.RS 4n
-Sets a limit on the number of fair share scheduler (FSS) CPU shares for a zone.
+Sets a value on the number of fair share scheduler (FSS) CPU shares for a zone.
CPU shares are first allocated to the zone, and then further subdivided among
projects within the zone as specified in the \fBproject.cpu-shares\fR entries.
Expressed as an integer. This resource control does not support the
@@ -408,14 +471,25 @@ Total amount of physical locked memory available to a zone.
.sp
.ne 2
.na
+\fB\fBzone.max-lofi\fR\fR
+.ad
+.sp .6
+.RS 4n
+Sets a limit on the number of \fBLOFI\fR(7D) devices that can be created in a
+zone. Expressed as an integer. This resource control does not support the
+\fBsyslog\fR action.
+.RE
+
+.sp
+.ne 2
+.na
\fB\fBzone.max-lwps\fR\fR
.ad
.sp .6
.RS 4n
-Enhances resource isolation by preventing too many LWPs in one zone from
-affecting other zones. A zone's total LWPs can be further subdivided among
-projects within the zone within the zone by using \fBproject.max-lwps\fR
-entries. Expressed as an integer.
+Sets a limit on how many LWPs can be active in a zone. A zone's total LWPs
+can be further subdivided among projects within the zone within the zone by
+using \fBproject.max-lwps\fR entries. Expressed as an integer.
.RE
.sp
@@ -432,6 +506,33 @@ integer.
.sp
.ne 2
.na
+\fB\fBzone.max-physical-memory\fR\fR
+.ad
+.sp .6
+.RS 4n
+Sets a limit on the amount of physical memory (RSS) that can be used by a zone
+before resident pages start being forcibly paged out. The unit used is bytes.
+Expressed as an integer. This resource control does not support the
+\fBsyslog\fR action.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fBzone.max-processes\fR\fR
+.ad
+.sp .6
+.RS 4n
+Maximum number of processes that can be active in a zone. This rctl is
+similar to \fBzone.max-lwps\fR, except that zombie processes are included.
+This rctl prevents process-slot exhaustion which can occur due to an excessive
+number of zombies. This rctl can be further subdivided among projects within
+the zone using \fBproject.max-processes\fR. Expressed as an integer.
+.RE
+
+.sp
+.ne 2
+.na
\fB\fBzone.max-sem-ids\fR\fR
.ad
.sp .6
@@ -473,6 +574,18 @@ mappings and \fBtmpfs\fR mounts for this zone.
.RE
.sp
+.ne 2
+.na
+\fB\fBzone.zfs-io-priority\fR\fR
+.ad
+.sp .6
+.RS 4n
+Sets a value for the \fBzfs\fR(1M) I/O priority for a zone. This is used as
+one of the inputs to determine if a zone's I/O should be throttled. Expressed
+as an integer. This resource control does not support the \fBsyslog\fR action.
+.RE
+
+.sp
.LP
See \fBzones\fR(5).
.SS "Units Used in Resource Controls"
@@ -985,7 +1098,7 @@ Interface Stability Evolving
\fBprctl\fR(1), \fBpooladm\fR(1M), \fBpoolcfg\fR(1M), \fBprojadd\fR(1M),
\fBprojmod\fR(1M), \fBrctladm\fR(1M), \fBsetrctl\fR(2),
\fBrctlblk_set_value\fR(3C), \fBlibpool\fR(3LIB), \fBproject\fR(4),
-\fBattributes\fR(5), \fBFSS\fR(7)
+\fBattributes\fR(5), \fBprivileges\fR(5), \fBzones\fR(5), \fBFSS\fR(7)
.sp
.LP
\fISystem Administration Guide: Virtualization Using the Solaris Operating
diff --git a/usr/src/man/man7/Makefile b/usr/src/man/man7/Makefile
index 929693a927..c53357d29a 100644
--- a/usr/src/man/man7/Makefile
+++ b/usr/src/man/man7/Makefile
@@ -12,6 +12,7 @@
#
# Copyright 2011, Richard Lowe
# Copyright 2013 Nexenta Systems, Inc. All rights reserved.
+# Copyright 2017 Joyent, Inc.
#
include $(SRC)/Makefile.master
@@ -22,7 +23,8 @@ MANSECT= 7
MANFILES= FSS.7 \
Intro.7 \
cpr.7 \
- ibmf.7
+ ibmf.7 \
+ swap.7
MANLINKS= intro.7
diff --git a/usr/src/man/man7/swap.7 b/usr/src/man/man7/swap.7
new file mode 100644
index 0000000000..d060e993a9
--- /dev/null
+++ b/usr/src/man/man7/swap.7
@@ -0,0 +1,92 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright 2017, Joyent, Inc.
+.\"
+.Dd Aug 14, 2017
+.Dt SWAP 7
+.Os
+.Sh NAME
+.Nm swap
+.Nd swap space
+.Sh DESCRIPTION
+The operating system uses demand paging as the primary mechanism to implement
+virtual memory.
+The system can also use traditional swapping, wherein an entire process state
+is moved between physical memory and swap space on disk, but it is very rare
+for the system to actually swap an entire process out to disk.
+A system which is swapping does not have enough enough physical memory to
+support the workload on the machine.
+In this case, work should be reduced or more memory added.
+.Pp
+Given that the system rarely, if ever, swaps, but still has swap space
+configured, the question arises as to what this space is for?
+.Pp
+In a demand paged virtual memory system, every page mapped by a process is
+backed by some object.
+For the actual program code used by the process, the backing objects are the
+underlying files in the filesystem for the program's binary, and any
+dynamically linked libraries.
+The portions of a process that are not backed by a named file, including its
+stack and its heap, are called anonymous memory.
+The system uses the swap space as the backing store for these pages.
+When the system determines that it needs to page out one of the anonymous pages,
+the swap space is where that page is written.
+.Pp
+Unlike some other operating systems, illumos reserves the backing storage
+space for anonymous memory at the time of allocation.
+For example, if a process asks for more heap space, the total size of the
+swap allocation that may be required to store the new pages if they need to
+be paged out is reserved at that time.
+This does not mean that anything is written to the swap space, but simply that
+the space is reserved for the entire allocation.
+Thus, a process will always get a correct error from the
+.Xr sbrk 2
+system call if swap space is unavailable.
+Some other operating systems don't allocate backing store for anonymous memory
+until it is used, so the error handling when space is not available can be
+complex or problematic on those systems.
+.Pp
+The
+.Xr vmstat 1m
+command can be used to monitor swap and paging activity.
+The
+.Xr pmap 1
+command can be used to inspect all of the mappings in a process address space,
+and their backing objects.
+The
+.Xr swap 1m
+command can be used to monitor, add and remove swap space.
+.Pp
+The operating system provides the
+.Ql zone.max-swap
+resource control to limit the amount of
+anonymous memory used by all of the processes within a zone.
+This resource control can also be configured under the
+.Xr capped-memory 2
+setting for a zone.
+See the
+.Xr prctl 1
+and
+.Xr zonecfg 1m
+man pages for information on setting this limit.
+The zone's usage against this resource control can be seen using the
+.Ql swapresv_zone_{zoneid}
+kstat.
+.Sh SEE ALSO
+.Xr pmap 1 ,
+.Xr prctl 1 ,
+.Xr kstat 1m ,
+.Xr swap 1m ,
+.Xr vmstat 1m ,
+.Xr zonecfg 1m ,
+.Xr sbrk 2 ,
+.Xr resource_controls 5
diff --git a/usr/src/man/man7d/Makefile b/usr/src/man/man7d/Makefile
index 591a4001ed..23e25fe1ef 100644
--- a/usr/src/man/man7d/Makefile
+++ b/usr/src/man/man7d/Makefile
@@ -103,6 +103,7 @@ _MANFILES= aac.7d \
ptm.7d \
pts.7d \
pty.7d \
+ qede.7d \
qlc.7d \
ramdisk.7d \
random.7d \
@@ -143,11 +144,13 @@ _MANFILES= aac.7d \
virtualkm.7d \
vni.7d \
vr.7d \
+ vnd.7d \
wscons.7d \
xge.7d \
yge.7d \
zcons.7d \
- zero.7d
+ zero.7d \
+ zfd.7d
sparc_MANFILES= audiocs.7d \
bbc_beep.7d \
diff --git a/usr/src/man/man7d/cpuid.7d b/usr/src/man/man7d/cpuid.7d
index cc522b1969..f24f73ed40 100644
--- a/usr/src/man/man7d/cpuid.7d
+++ b/usr/src/man/man7d/cpuid.7d
@@ -1,5 +1,6 @@
'\" te
.\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved
+.\" Copyright 2015, Joyent, Inc.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
@@ -43,6 +44,10 @@ the years).
See the processor manufacturers documentation for further information about the
syntax and semantics of the wide variety of information available from this
instruction.
+.LP
+Some systems can be configured to limit the cpuid opcodes which are accessible.
+While illumos handles this condition, other software may malfunction when such
+limits are enabled. Those settings are typically manipulated in the BIOS.
.SH EXAMPLE
.LP
This example allows you to determine if the current x86 processor supports
diff --git a/usr/src/man/man7d/qede.7d b/usr/src/man/man7d/qede.7d
new file mode 100644
index 0000000000..28472dbf8f
--- /dev/null
+++ b/usr/src/man/man7d/qede.7d
@@ -0,0 +1,100 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright (c) 2014 QLogic Corporation. All Rights Reserved
+.\"
+.Dd August 28, 2017
+.Dt QEDE 7D
+.Os
+.Sh NAME
+.Nm qede
+.Nd QLogic FastLinQ QL45xxx 10/25/40/50/100 Gigabit Ethernet Driver
+.Sh SYNOPSIS
+.Pa /dev/net/qede*
+.Sh DESCRIPTION
+The
+.Nm
+Ethernet driver is a multi-threaded, loadable, clonable, GLDv3-based
+driver supporting the Data Link Provider Interface,
+.Xr dlpi 7P ,
+over QLogic FastLinQ QL45xxx 10/25/40/50/100 Gigabit Ethernet
+controllers.
+Multiple QLogic FastLinQ controllers installed within the system are
+supported by the driver.
+.Pp
+The
+.Nm
+driver provides support for the QLogic QL45xxx line of devices.
+Functions include chip initialization, frame transmit and receive,
+multicast and promiscuous support, error recovery and reporting.
+These devices provide 10000/25000/40000/50000/100000 Mbps networking
+interfaces.
+.Sh DRIVER CONFIGURATION
+The primary methods of configuration are via modification of the
+.Pa /kernel/drv/qede.conf
+file or execution of the
+.Xr dladm 1M
+utility.
+There are many configuration items available and all are thoroughly
+documented in the
+.Pa /kernel/drv/qede.conf
+file.
+Note that for changes to this file to take affect the driver must be
+reloaded or the system rebooted.
+In order to reload the driver with new configuration changes all
+.Nm qede
+interfaces must be first unplumbed and then the
+.Xr update_drv 1M
+tool must be executed.
+For the configuration items that do not require a driver reload the
+.Xr dladm 1M
+tool can be used to dynamically change the option.
+Use of
+.Xr dladm 1M
+is the preferred method.
+.Sh DEBUGGING
+.Ss kstat
+There are many statistics exposed via
+.Xr kstat 1M
+by the
+.Nm
+driver.
+The main groups are:
+.Bl -tag -width Em
+.It Em intr
+for interrupts stats
+.It Em l2chip
+for layer 2 chip stats
+.It Em l2driver
+for layer 2 driver stats
+.It Em l2stats
+for general layer 2 stats
+.It Em link
+for detailed link status
+.It Em mac
+for GLDv3 MAC layer stats
+.It Em rxq#
+for Rx ring stats
+.It Em txq#
+for Tx ring stats
+.It Em stats
+for general driver stats and version info.
+.El
+.Pp
+To get a list of all the individual statistics in these goups run:
+.Bd -literal -offset indent
+# kstat -m qede -i 0 -l
+.Ed
+.Sh SEE ALSO
+.Xr dladm 1M ,
+.Xr ifconfig 1M ,
+.Xr driver.conf 4 ,
+.Xr dlpi 7P
diff --git a/usr/src/man/man7d/vnd.7d b/usr/src/man/man7d/vnd.7d
new file mode 100644
index 0000000000..d311c4dc08
--- /dev/null
+++ b/usr/src/man/man7d/vnd.7d
@@ -0,0 +1,118 @@
+'\" te
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
+.\"
+.TH VND 7D "Feb 11, 2014"
+.SH NAME
+vnd \- virtual layer two network driver
+
+.SH SYNOPSIS
+.nf
+.LP
+/dev/vnd/ctl
+.LP
+/dev/vnd/*
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The vnd driver provides support for a layer two datapath in an
+analogous way that IP(7P) provides a support for an IP-based layer
+three datapath. Both devices operate exclusively on datalinks. A
+datalink that has been plumbed up with IP via ifconfig(1M) or
+ipadm(1M) cannot be used with vnd or vice-versa.
+.sp
+.LP
+The vnd driver supports and takes advantage of the the following
+illumos features:
+.RS
+.sp
+.LP
+Supports dld/dls feature negotation of GLDv3 features, such
+as direct calls, flow control, checksum offloading, and more.
+.sp
+.LP
+All IP and IPv6 based traffic is sent through ipfilter(5),
+allowing packet filtering.
+.sp
+.LP
+Better control over vectored reads and writes in a frame-centric manner
+through framed I/O. See libvnd(3LIB) for more information on these
+interfaces.
+.RE
+.sp
+.LP
+The vnd driver exposes two different kinds of device nodes. The first is
+a self-cloning control node which can be used to create vnd devices on
+top of datalinks. Those devices can optionally be bound into the file
+system namespace under /dev/vnd. Control operations on the control node
+or named devices are private to the implementation. Instead,
+libvnd(3LIB) provides a stable interfaces for using, creating, and
+manipulating vnd devices.
+.sp
+.SH FILES
+.sp
+.ne 2
+.na
+/dev/vnd/ctl
+.ad
+.RS 16n
+vnd self-cloning control node
+.RE
+
+.sp
+.ne 2
+.na
+/dev/vnd/%link
+.ad
+.RS 16n
+Character device that corresponds to the vnd device of the given
+name (%link). A given device will appear for each actively linked device
+in the current zone.
+.RE
+
+.sp
+.ne 2
+.na
+/dev/vnd/zone/%zone/%link
+.ad
+.RS 16n
+These are character devices that correspond to the vnd device of
+the given name (%link). They are organized based on the zone that they
+appear in. Thus if a zone named foo has a vnd device named
+bar, then the global zone will have the file
+/dev/vnd/zone/foo/bar. Note, these only occur in the global zone.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See attributes(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+box;
+c | c
+l | l .
+ATTRIBUTE TYPE ATTRIBUTE VALUE
+_
+Interface Stability Evolving
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+dladm(1M), ipflter(5), libvnd(3LIB), vndadm(1M),
+vndstat(1)
diff --git a/usr/src/man/man7d/zfd.7d b/usr/src/man/man7d/zfd.7d
new file mode 100644
index 0000000000..cbdc869819
--- /dev/null
+++ b/usr/src/man/man7d/zfd.7d
@@ -0,0 +1,81 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright 2015, Joyent, Inc. All rights reserved.
+.\"
+.Dd "Oct 16, 2015"
+.Dt ZFD 7D
+.Os
+.Sh NAME
+.Nm zfd
+.Nd Zone file descriptor driver
+.Sh DESCRIPTION
+The
+.Nm zfd
+character driver exports devices into the zone which can be used by a
+a standalone process within the zone as
+.Vt stdin ,
+.Vt stdout ,
+and
+.Vt stderr .
+The
+.Nm zfd
+driver behaves in a similar manner as the
+.Nm zcons(7D)
+device.
+Inside a zone, the slave side devices appear as
+.Nm /dev/zfd/[0-4] .
+.sp
+The zone's zfd device configuration is driven by
+.Nm zoneadmd
+and a zone attribute
+.Nm zlog-mode
+which is somewhat of a misnomer since its purpose has evolved.
+The attribute can have a variety of values, but the lowest two positions
+in the value string are used to control how many zfd devices are created
+inside the zone and if the primary stream is a tty.
+.sp
+.Dl --
+.Dl -n
+.Dl t-
+.Dl tn
+.sp
+With the
+.Nm t
+flag set,
+.Vt stdin ,
+.Vt stdout ,
+and
+.Vt stderr ,
+are multiplexed onto a single full-duplex stream which is configured as a tty.
+That is,
+.Nm ptem ,
+.Nm ldterm
+and
+.Nm ttycompat
+are autopushed onto the stream when the slave side is opened.
+There is only a single zfd device (0) needed for the primary stream.
+.sp
+When the
+.Nm n
+flag is set, it is assumed that output logging will be done within the zone
+itself.
+In this configuration 1 or 2 additional zfd devices, depending on tty mode
+.Nm ( t
+flag), are created within the zone.
+An application can then configure the zfd streams driver into a multiplexer.
+Output from the stdout/stderr zfd(s) will be teed into the correspond
+logging zfd(s) within the zone.
+.Sh SEE ALSO
+.Xr zlogin 1 ,
+.Xr zoneadmd 1M ,
+.Xr zonecfg 1M ,
+.Xr zcons 7D
diff --git a/usr/src/man/man7fs/Makefile b/usr/src/man/man7fs/Makefile
index 187bacff78..57aa608a65 100644
--- a/usr/src/man/man7fs/Makefile
+++ b/usr/src/man/man7fs/Makefile
@@ -26,7 +26,9 @@ MANFILES= bootfs.7fs \
devfs.7fs \
fd.7fs \
hsfs.7fs \
+ hyprlofs.7fs \
lofs.7fs \
+ lxproc.7fs \
objfs.7fs \
pcfs.7fs \
sharefs.7fs \
diff --git a/usr/src/man/man7fs/hyprlofs.7fs b/usr/src/man/man7fs/hyprlofs.7fs
new file mode 100644
index 0000000000..8655791193
--- /dev/null
+++ b/usr/src/man/man7fs/hyprlofs.7fs
@@ -0,0 +1,62 @@
+'\" te
+.\" Copyright (c) 2012, Joyent, Inc.
+.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
+.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
+.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
+.TH HYPRLOFS 7FS "March 7, 2012"
+.SH NAME
+hyprlofs \- fast name space virtual file system
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/fs/hyprlofs.h>
+
+\fB\fR\fBmount\fR (\fB\fR\fIspecial\fR, \fB\fR\fIdirectory\fR, \fB\fR\fIMS_DATA\fR, \fB\fR\fI"hyprlofs"\fR, \fB\fR\fINULL\fR, \fB\fR\fI0\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+\fBhyprlofs\fR is a hybrid file system combining features from
+\fBtmpfs(7FS)\fR and \fBlofs(7FS)\fR.
+As with \fBlofs\fR, the \fBhyprlofs\fR file system allows new, virtual file
+systems to be created which provide access to existing files using alternate
+pathnames. In addition, the files themselves may have alternate names and
+paths within the mount.
+Unlike \fBlofs\fR, files cannot be created and backing files cannot be removed.
+The name space is completely managed through ioctls on the mount.
+Entries in the name space are not mounts and thus, they will not appear in the
+mnttab. The file system is designed to provide a very fast name space to the
+backing files. The name space can be modified very quickly through the ioctl
+interface.
+.sp
+.LP
+\fBhyprlofs\fR file systems can be mounted with the command:
+.sp
+.in +2
+.nf
+\fBmount \fR\fB-F\fR\fB hyprlofs swap \fR\fIdirectory\fR
+.fi
+.in -2
+
+.sp
+.LP
+The name space used by \fBhyprlofs\fR exists only in-memory so it will consume
+a small amount of the system's virtual memory. The files themselves are backed
+by the original file as with \fBlofs\fR.
+
+.SH SEE ALSO
+.sp
+.LP
+\fBdf\fR(1M), \fBmount\fR(1M), \fBswap\fR(1M),
+\fBmount\fR(2), \fBumount\fR(2)
+.sp
+.LP
+\fISystem Administration Guide: Basic Administration\fR
+.SH DIAGNOSTICS
+.sp
+.LP
+\fBdf\fR(1M) output is of limited accuracy since
+the space available to \fBhyprlofs\fR is dependent on the swap
+space demands of the entire system and the files in the name space are not
+included.
diff --git a/usr/src/man/man7fs/lxproc.7fs b/usr/src/man/man7fs/lxproc.7fs
new file mode 100644
index 0000000000..7ef10ce343
--- /dev/null
+++ b/usr/src/man/man7fs/lxproc.7fs
@@ -0,0 +1,115 @@
+'\" te
+.\" Copyright (c) 2012, Joyent, Inc.
+.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
+.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
+.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
+.TH LXPROC 7FS "April 25, 2012"
+.SH NAME
+lxproc \- a loosely Linux-compatible /proc
+.SH SYNOPSIS
+.LP
+.nf
+\fB\fR\fBmount\fR (\fB\fR\fI"lxproc"\fR, \fB\fR\fIdirectory\fR, \fB\fR\fIMS_DATA\fR, \fB\fR\fI"lxproc"\fR, \fB\fR\fINULL\fR, \fB\fR\fI0\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+\fBlxproc\fR is an implementation of the \fB/proc\fR filesystem that
+loosely matches the Linux semantics of providing human-readable text files
+that correspond to elements of the system.
+As with both \fBproc\fR(4) and Linux \fB/proc\fR, \fBlxproc\fR makes available
+a directory for every process, with each directory containing a number
+of files; like Linux \fB/proc\fR but unlike \fBproc\fR(4), \fBlxproc\fR also
+makes available a number of files related to system-wide information.
+To ascertain the meaning and structure of the files provided via
+\fBlxproc\fR, users should consult the Linux documentation.
+.sp
+.LP
+The \fBlxproc\fR compatibility layer is
+provided only as a best-effort for simple Linux \fB/proc\fR readers; it
+is not intended to exactly mimic Linux semantics and nor does it attempt to
+somehow fool a consumer into believing that it is operating within a Linux
+environment. As such, \fBlxproc\fR should only be used by Linux-specific
+programs that are willing to trade precision in understanding the
+system in return for Linux compatibility. To programmatically understand
+the system precisely and in terms of its native constructs,
+one should not use \fBlxproc\fR, but rather \fBproc\fR(4) or
+\fBkstat\fR(3KSTAT).
+To understand
+a process or group of processes from either a shell script or the command line,
+one should not use \fBlxproc\fR, but rather \fBproc\fR(4)-based tools like
+\fBprstat\fR(1M),
+\fBpfiles\fR(1),
+\fBpargs\fR(1),
+\fBpmap\fR(1),
+\fBptree\fR(1),
+\fBplimit\fR(1),
+\fBpflags\fR(1),
+\fBpcred\fR(1),
+\fBpstack\fR(1),
+\fBpldd\fR(1),
+\fBpsig\fR(1),
+or
+\fBpwdx\fR(1).
+To understand system-wide constructs from either a shell script or the
+command line, one should not use \fBlxproc\fR, but rather
+\fBkstat\fR(3KSTAT)-based tools like
+\fBkstat\fR(1M),
+\fBmpstat\fR(1M),
+\fBiostat\fR(1M),
+\fBnetstat\fR(1M) or
+\fBpsrinfo\fR(1M).
+.sp
+.LP
+Like \fB/proc\fR, \fBlxproc\fR can be mounted on any mount point, but the
+preferred mount point is \fB/system/lxproc\fR; if a zone brand elects to
+mount it by default, this will (or should) generally be the mount point.
+.sp
+.LP
+\fBlxproc\fR can be mounted with the command:
+.sp
+.in +2
+.nf
+\fBmount \fR\fB-F\fR\fB lxproc lxproc \fR\fIdirectory\fR
+.fi
+.in -2
+
+.SH SEE ALSO
+.sp
+.LP
+\fBdf\fR(1M),
+\fBiostat\fR(1M),
+\fBkstat\fR(1M),
+\fBmpstat\fR(1M),
+\fBmount\fR(1M),
+\fBnetstat\fR(1M),
+\fBpargs\fR(1),
+\fBpcred\fR(1),
+\fBpfiles\fR(1),
+\fBpflags\fR(1),
+\fBpldd\fR(1),
+\fBplimit\fR(1),
+\fBpmap\fR(1),
+\fBprstat\fR(1M),
+\fBpsig\fR(1),
+\fBpsrinfo\fR(1M),
+\fBpstack\fR(1),
+\fBptree\fR(1),
+\fBpwdx\fR(1),
+\fBmount\fR(2), \fBumount\fR(2), \fBkstat\fR(3KSTAT), \fBproc\fR(4),
+\fBkstat\fR(9S)
+
+.SH NOTES
+.sp
+.LP
+When choosing between offering
+Linux compatibility and telling the truth, \fBlxproc\fR emphatically picks
+the truth. A particular glaring example of this is the Linux notion of
+"tasks" (that is, threads), which -- due to historical misadventures on
+Linux -- allocate their identifiers from the process identifier space.
+(That is, each thread has in effect a pid.) Some Linux \fB/proc\fR readers
+have come to depend on this attribute, and become confused when threads
+appear with proper identifiers, so \fBlxproc\fR simply opts for the pre-2.6
+behavior, and does not present the tasks directory at all.
+
diff --git a/usr/src/man/man7i/uscsi.7i b/usr/src/man/man7i/uscsi.7i
index 3247f53cc1..f246590ca4 100644
--- a/usr/src/man/man7i/uscsi.7i
+++ b/usr/src/man/man7i/uscsi.7i
@@ -1,9 +1,10 @@
'\" te
.\" Copyright (c) 2007 by Sun Microsystems, Inc. All rights reserved.
+.\" Copyright 2016 Joyent, Inc.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH USCSI 7I "May 29, 2007"
+.TH USCSI 7I "Sep 23, 2016"
.SH NAME
uscsi \- user SCSI command interface
.SH SYNOPSIS
@@ -15,7 +16,6 @@ uscsi \- user SCSI command interface
.fi
.SH DESCRIPTION
-.sp
.LP
The \fBuscsi\fR command is very powerful and somewhat dangerous; therefore it
has some permission restrictions. See \fBWARNINGS\fR for more details.
@@ -349,8 +349,13 @@ See the \fBscsi_pkt\fR(9S) flag \fBFLAG_RENEGOTIATE_WIDE_SYNC\fR for more
information.
.RE
+The \fBuscsi_xfer_t\fR is a type definition that corresponds to a 64-bit
+unsigned integer. It should be used for the \fBUSCSIMAXXFER\fR ioctls. This is
+used for determining the maximum transfer size that can be performed in a single
+\fBUSCSICMD\fR ioctl. If the SCSI request is larger than the specified size,
+then it may not work, depending on the hardware platform.
+
.SH IOCTLS
-.sp
.LP
The \fBioctl\fR supported by drivers providing the \fBuscsi\fR interface is:
.sp
@@ -371,10 +376,24 @@ status, and Request Sense is enabled, the sense data itself is returned in
Sense data transfer.
.RE
-.SH ERRORS
.sp
.ne 2
.na
+.B USCSIMAXXFER
+.ad
+.RS 12n
+The argument is a pointer to a \fBuscsi_xfer_t\fR value. The maximum transfer
+size that can be used with the \fBUSCSICMD\fR ioctl for the current device will
+be returned in the \fBuscsi_xfer_t\fR.
+.sp
+.LP
+Not all devices which support the \fBUSCSICMD\fR ioctl also support the
+\fBUSCSIMAXXFER\fR ioctl.
+.RE
+
+.SH ERRORS
+.ne 2
+.na
\fB\fBEINVAL\fR\fR
.ad
.RS 10n
@@ -396,7 +415,8 @@ An error occurred during the execution of the command.
\fB\fBEPERM\fR\fR
.ad
.RS 10n
-A process without root credentials tried to execute the \fBUSCSICMD\fR ioctl.
+A process without root credentials tried to execute the \fBUSCSICMD\fR or
+\fRUSCSIMAXXFER\fR ioctl.
.RE
.sp
@@ -405,12 +425,11 @@ A process without root credentials tried to execute the \fBUSCSICMD\fR ioctl.
\fB\fBEFAULT\fR\fR
.ad
.RS 10n
-The \fBuscsi_cmd\fR itself, the \fBuscsi_cdb\fR, the \fBuscsi_buf\fR, or the
-\fBuscsi_rqbuf\fR point to an invalid address.
+The \fBuscsi_cmd\fR itself, the \fBuscsi_cdb\fR, the \fBuscsi_buf\fR, the
+\fBuscsi_rqbuf\fR, or the \fBuscsi_xfer_t\fR point to an invalid address.
.RE
.SH ATTRIBUTES
-.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
@@ -426,14 +445,12 @@ Interface Stability Committed
.TE
.SH SEE ALSO
-.sp
.LP
\fBioctl\fR(2), \fBattributes\fR(5), \fBsd\fR(7D), \fBst\fR(7D)
.sp
.LP
\fIANSI Small Computer System Interface-2 (SCSI-2)\fR
.SH WARNINGS
-.sp
.LP
The \fBuscsi\fR command is very powerful, but somewhat dangerous, and so its
use is restricted to processes running as root, regardless of the file
@@ -450,7 +467,8 @@ number is used to send the command.
The \fBuscsi\fR interface is not recommended for very large data transfers
(typically more than 16MB). If the requested transfer size exceeds the maximum
transfer size of the DMA engine, it will not be broken up into multiple
-transfers and DMA errors may result.
+transfers and DMA errors may result. The \fBUSCSIMAXXFER\fR ioctl can be used
+to determine the maximum transfer size.
.sp
.LP
The \fBUSCSICMD\fR ioctl associates a \fBstruct uscsi_cmd\fR with a device by
diff --git a/usr/src/man/man7m/Makefile b/usr/src/man/man7m/Makefile
index bb44184ba7..36eb293fc3 100644
--- a/usr/src/man/man7m/Makefile
+++ b/usr/src/man/man7m/Makefile
@@ -12,6 +12,7 @@
#
# Copyright 2011, Richard Lowe
# Copyright 2013 Nexenta Systems, Inc. All rights reserved.
+# Copyright 2015 Joyent, Inc.
#
include $(SRC)/Makefile.master
@@ -20,6 +21,7 @@ MANSECT= 7m
_MANFILES = bufmod.7m \
connld.7m \
+ datafilt.7m \
ldterm.7m \
pckt.7m \
pfmod.7m \
diff --git a/usr/src/man/man7m/datafilt.7m b/usr/src/man/man7m/datafilt.7m
new file mode 100644
index 0000000000..f840e389c8
--- /dev/null
+++ b/usr/src/man/man7m/datafilt.7m
@@ -0,0 +1,48 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright 2014 Ryan Zezeski
+.\" Copyright 2015 Joyent, Inc.
+.\"
+.Dd Apr 21, 2015
+.Dt DATAFILT 7M
+.Os
+.Sh NAME
+.Nm datafilt
+.Nd socket filter module for deferred TCP connections
+.Sh DESCRIPTION
+The
+.Nm datafilt
+socket filter provides deferment of
+.Xr accept 3SOCKET
+for TCP connections.
+The accept call will not return until at least one byte has been
+buffered by the kernel.
+Deferment assures the application that the first call to
+.Xr read 2
+or
+.Xr recv 3SOCKET
+will not block.
+It reduces unnecessary switching between user and kernel.
+.Sh EXAMPLES
+.Ss Example 1
+Enable deferment on the listening socket.
+.Bd -literal
+ setsockopt(lsock, SOL_FILTER, FIL_ATTACH, "datafilt", 8);
+.Ed
+.Ss Example 2
+Disable deferment on the listening socket.
+.Bd -literal
+ char filt[] = "datafilt";
+ setsockopt(lsock, SOL_FILTER, FIL_DETACH, filt, strlen(filt) + 1);
+.Ed
+.Sh SEE ALSO
+.Xr setsockopt 3SOCKET
diff --git a/usr/src/man/man7p/Makefile b/usr/src/man/man7p/Makefile
index 13cb58770d..f73a157f47 100644
--- a/usr/src/man/man7p/Makefile
+++ b/usr/src/man/man7p/Makefile
@@ -39,7 +39,8 @@ MANFILES= arp.7p \
sip.7p \
slp.7p \
tcp.7p \
- udp.7p
+ udp.7p \
+ vxlan.7p
MANLINKS= AH.7p \
ARP.7p \
@@ -51,6 +52,7 @@ MANLINKS= AH.7p \
SCTP.7p \
TCP.7p \
UDP.7p \
+ VXLAN.7p \
if.7p
ARP.7p := LINKSRC = arp.7p
@@ -75,6 +77,8 @@ TCP.7p := LINKSRC = tcp.7p
UDP.7p := LINKSRC = udp.7p
+VXLAN.7p := LINKSRC = vxlan.7p
+
.KEEP_STATE:
include $(SRC)/man/Makefile.man
diff --git a/usr/src/man/man7p/vxlan.7p b/usr/src/man/man7p/vxlan.7p
new file mode 100644
index 0000000000..43c4756585
--- /dev/null
+++ b/usr/src/man/man7p/vxlan.7p
@@ -0,0 +1,130 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright 2015 Joyent, Inc.
+.\"
+.Dd Apr 10, 2015
+.Dt VXLAN 7P
+.Os
+.Sh NAME
+.Nm VXLAN ,
+.Nm vxlan
+.Nd Virtual eXtensible Local Area Network
+.Sh SYNOPSIS
+.In sys/vxlan.h
+.Sh DESCRIPTION
+.Nm
+(RFC 7348) is a network encapsulation protocol that is used by
+.Xr overlay 5
+devices.
+A payload, commonly an Ethernet frame, is placed inside of a
+UDP packet and prepended with an 8-byte
+.Nm
+header.
+.Pp
+The
+.Nm
+header contains two 32-bit words.
+The first word is an 8-bit flags field followed by 24 reserved bits.
+The second word is a 24-bit virtual network identifier followed by 8
+reserved bits.
+The virtual network identifier identifies a unique
+.Nm
+and
+is similar in concept to an IEEE 802.1Q VLAN identifier.
+.Pp
+The system provides access to
+.Nm
+through dladm overlays.
+See
+.Xr dladm 1M
+and
+.Xr overlay 5
+for more information.
+.Pp
+The
+.In sys/vxlan.h
+header provides information for working with the
+.Nm
+protocol.
+The contents of this header are
+.Sy uncommitted .
+The header defines a structure that may be used to encode and decode a VXLAN
+header.
+It defines a packed structure type
+.Sy vxlan_hdr_t
+which represents the
+.Nm
+frame header and has the following members:
+.Bd -literal
+ uint32_t vxlan_flags; /* flags in upper 8 bits */
+ uint32_t vxlan_id; /* VXLAN ID in upper 24 bits */
+.Ed
+.Sh EXAMPLES
+.Sy Example 1
+Decoding a
+.Nm
+header
+.Pp
+The following example shows how to validate a
+.Nm header.
+For more information on this process, see RFC 7348.
+.Bd -literal -offset indent
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <inttypes.h>
+#include <sys/vxlan.h>
+
+\&...
+
+/*
+ * Validate the following bytes as a VXLAN header. If valid, return
+ * 0 and store the VXLAN identifier in *vidp. Otherwise, return an
+ * error.
+ */
+int
+validate_vxlan(void *buf, int len, uint32_t *vidp)
+{
+ vxlan_hdr_t *hdr;
+
+ if (len < sizeof (vxlan_hdr_t))
+ return (EINAVL);
+
+ hdr = buf;
+ if ((ntohl(hdr->vxlan_flags) & VXLAN_MAGIC) == 0)
+ return (EINAVL);
+
+ *vidp = ntohl(vxlan->vxlan_id) >> VXLAN_ID_SHIFT;
+
+ return (0);
+}
+.Ed
+.Sh STABILITY
+The contents of
+.In sys/vxlan.h
+are
+.Sy Uncommitted .
+.Sh SEE ALSO
+.Xr dladm 1M ,
+.Xr overlay 5
+.Rs
+.%A Mahalingam, M.
+.%A Dutt, D.
+.%A Duda, K.
+.%A Agarwal, P.
+.%A Kreeger L.
+.%A Sridhar, T.
+.%A Bursell, M.
+.%A C. Wright
+.%T RFC 7348, Virtual eXtensible Local Area Network (VXLAN): A Framework
+.%T for Overlaying Virtualized Layer 2 Networks over Layer 3 Networks
+.%D August 2014
+.Re
diff --git a/usr/src/man/man9/Makefile b/usr/src/man/man9/Makefile
index 66bd9e9a4c..103a1e6b28 100644
--- a/usr/src/man/man9/Makefile
+++ b/usr/src/man/man9/Makefile
@@ -18,12 +18,19 @@ include $(SRC)/Makefile.master
MANSECT= 9
MANFILES= Intro.9 \
+ iport.9 \
vmem.9
-MANLINKS= intro.9
+MANLINKS= intro.9 \
+ iportmap.9 \
+ phymap.9 \
+ tgtmap.9
intro.9 := LINKSRC = Intro.9
+iportmap.9 := LINKSRC = iport.9
+phymap.9 := LINKSRC = iport.9
+tgtmap.9 := LINKSRC = iport.9
.KEEP_STATE:
diff --git a/usr/src/man/man9/iport.9 b/usr/src/man/man9/iport.9
new file mode 100644
index 0000000000..c51a8bc41a
--- /dev/null
+++ b/usr/src/man/man9/iport.9
@@ -0,0 +1,334 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright (c) 2017, Joyent, Inc.
+.\"
+.Dd Apr 18, 2017
+.Dt IPORT 9
+.Os
+.Sh NAME
+.Nm iport ,
+.Nm iportmap ,
+.Nm phymap ,
+.Nm tgtmap
+.Nd SCSI Device Management Concepts
+.Sh DESCRIPTION
+The
+.Sy iport ,
+.Sy iportmap ,
+.Sy phymap ,
+and
+.Sy tgtmap
+abstractions enable host bus adapter (HBA) drivers to represent the
+devices that they are responsible for enumerating, as well as the
+relationships between these devices.
+These interfaces simplify device drivers by taking care of the creation
+and destruction of device nodes in the devices tree for enumerated
+devices as well as performing some amount of hysteresis.
+.Pp
+These abstractions are used in tandem with SCSI complex addressing.
+A device driver that uses these interfaces generally passes both the
+.Dv SCSI_HBA_HBA
+flag and the
+.Dv SCSI_HBA_ADDR_COMPLEX
+in the
+.Fa hba_flags
+argument to
+.Xr scsi_hba_attach_setup 9F .
+.Ss iport
+The
+.Sy iport ,
+or initiator port, abstracts a collection of attached devices.
+One way to view an iport is that each iport maps to a phy on the HBA.
+A phy refers to a physical connector between the HBA and devices.
+A phy may be made up of individual lanes.
+A lane is connected to a device, for example a disk driver.
+Multiple lanes maybe plugged into the same device, for example, an
+expander.
+When a phy connects to a device with a single lane, this is often
+called a
+.Em narrow phy .
+When a phy connects to a device with multiple lanes, this is often
+called a
+.Em wide phy .
+.Pp
+Consider a device that has two physical ports, and thus two phys.
+Each phy has four lanes, thus we describe the phy as having a mask of
+0xf.
+Each bit in the mask corresponds to a specific lane.
+In this example, each phy would be represented in the system by an iport
+and may enumerate a different device for each lane of the phy.
+If an expander is attached to one or more of the lanes of a phy, then
+additional devices will be enumerated under the expander and be added to
+that phy's iport.
+.Pp
+Another example to consider is when each lane of a phy is directly
+connected to a single disk through a passive backplane.
+In this case, each lane may represent its own iport, since the
+management of each is independent, basically there are many devices each
+with a mask of 0x1.
+.Pp
+iports do not need to map to a physical phy.
+Some HBAs support a combination of both physical and virtual devices.
+In that case, the driver may create two different iports, one for the
+physical devices and one for the virtual devices.
+.Pp
+One property of iports is that they're attached separately from the main
+device and therefore have their own
+.Xr scsi_hba_tran 9S
+structure.
+As a result, that means that a driver can provide different
+entry points for each iport, especially if they represent different
+classes of resources, for example one iport for all physical devices and
+one for all virtual devices.
+This allows for a driver to return different capabilities, among other
+behaviors and entry points, for these different iports.
+One specific case of this is that while physical devices may provide a
+means to get to a SCSI WWN, virtual devices may not have a WWN and
+instead must use a different addressing format.
+.Pp
+iports are considered children of the device driver that attach them,
+but they are bound to the same driver.
+This means that when an iport is created, the
+.Xr attach 9E
+and
+.Xr probe 9E
+entry points of the parent driver (usually indicated by passing a
+.Vt dev_info
+structure) will be called.
+Similarly, when an iport is removed from the system, then the driver's
+.Xr detach 9E
+entry point will be called.
+A driver can determine whether an iport is being attached or not by
+calling the
+.Xr scsi_hba_iport_unit_address 9F
+function.
+The value will return
+.Dv NULL
+if the attaching device represents the driver.
+.Pp
+To manage iports, drivers have two different options.
+If the set of iport an HBA supports are static, then they should use the
+.Xr scsi_hba_iport_register 9F
+function to register an iport.
+.Pp
+If instead, the set of iports are dynamic and map to the coming and
+going of phys discovered by the driver (or some other dynamic source),
+then the driver should use the iportmap set of functions.
+See the section
+.Sx phymap and iportmap
+for more information.
+.Ss tgtmap
+The target map represents a set of devices that have been enumerated
+under an iport.
+Each device is represented by a string, which is an address of some
+kind.
+Usually a physical device's WWN is used.
+.Pp
+By using a target map, the operating system will take
+responsibility for notifying the driver when devices have come and gone
+from a target map, once it has settled, and it will also take
+responsibility for having device nodes come and go, meaning that the
+device driver does not need to know anything about the devices tree or
+worry about other parts of being a nexus driver.
+.Pp
+Target maps come in two forms which change how the HBA driver is
+responsible for reporting changes:
+.Bl -enum
+.It
+Full-set
+.It
+Per-address
+.El
+.Pp
+In the full-set mode, the driver always reports the full set of current
+devices that it sees.
+When the driver finishes the report, the operating system will inform
+the driver of addresses that were added and addresses that were removed.
+These addresses correspond to newly found devices and recently removed
+devices, respectively.
+The full-set mode allows for a simpler device driver, particularly if
+addition and removal notifications may be dropped by the hardware.
+.Pp
+When using the per-address mode of a target map, the HBA driver is
+responsible for indicating which addresses have come and gone from the
+system.
+.Pp
+In either mode, the driver will receive two callbacks, if they have been
+registered when the target map was created.
+The first callback fires before a target driver like sd, ses, etc. is
+attached.
+The second callback fires after the corresponding driver has been
+attached.
+These allow the HBA driver to perform any operations that are
+required on the devices.
+.Pp
+Each target map has two different sets of devices that it manages in
+this form.
+The devices are separated into the following groups:
+.Bl -enum
+.It
+SCSI Devices
+.It
+SMP (SCSI Management Protocol) devices
+.El
+.Pp
+All SATA, SCSI, SAS, SES, etc. devices all are considered part of the
+first category.
+.Pp
+Target maps can be created and destroyed with the
+.Xr scsi_hba_tgtmap_create 9F
+and
+.Xr scsi_hba_tgtmap_destroy 9F
+functions.
+.Pp
+The following functions are used to manage target maps operating in
+full-set mode:
+.Bl -dash
+.It
+.Xr scsi_hba_tgtmap_set_begin 9F
+.It
+.Xr scsi_hba_tgtmap_set_add 9F
+.It
+.Xr scsi_hba_tgtmap_set_end 9F
+.It
+.Xr scsi_hba_tgtmap_set_flush 9F
+.El
+.Pp
+The following functions are used to manage target maps operating in
+per-address mode:
+.Bl -dash
+.It
+.Xr scsi_hba_tgtmap_tgt_add 9F
+.It
+.Xr scsi_hba_tgtmap_tgt_remove 9F
+.El
+.Ss phymap and iportmap
+The phymap and iportmap are often used together to represent complex SAS
+topologies.
+The phymap provides a way to see what phys have been grouped together
+under the same SAS port.
+The SAS port is represented by the
+.Dq local
+and
+.Dq remote
+WWNs.
+When additional phys come online, if they end up referring to the
+same WWNs, then they'll map to the same port.
+.Pp
+The iportmap is used to maintain a dynamic set of iports related to a
+device.
+The iports are each identified by an address, which is generally
+a unit address string.
+For example, when a new phy is added to the phymap which represents a
+new SAS port being used, then a corresponding iport will be created and
+associated with that entry from the phymap.
+Once the iport has been created, a normal target map can be created on
+top of it to handle detected SCSI and SMP devices.
+.Pp
+Both the phymap and iportmap operate in a similar fashion to the
+per-address mode of a tgtmap.
+Entries can be added and removed through direct functions.
+The phymap provides callbacks similar to the tgtmap; however, the
+iportmap does not.
+This is because when an iport is added or removed, a new node is added
+to the devices tree and the driver's
+.Xr attach 9E
+entry point is called with a new
+.Vt dev_info_t
+structure representing the iport.
+.Pp
+During the phymap callback, the HBA driver should create a new iport
+with the unit address passed in from the callback function.
+This relationship is important when taking advantage of the ability to
+map between an iport and the set of phys that it represents.
+.Pp
+The following functions are used to manage iportmaps:
+.Bl -dash
+.It
+.Xr scsi_hba_iportmap_create 9F
+.It
+.Xr scsi_hba_iportmap_iport_add 9F
+.It
+.Xr scsi_hba_iportmap_iport_remove 9F
+.It
+.Xr scsi_hba_iportmap_destroy 9F
+.El
+.Pp
+The following functions are used to manage phymaps:
+.Bl -dash
+.It
+.Xr sas_phymap_create 9F
+.It
+.Xr sas_phymap_destroy 9F
+.It
+.Xr sas_phymap_phy_add 9F
+.It
+.Xr sas_phymap_phy_rem 9F
+.El
+.Ss SCSI Complex Addressing
+Traditionally, SCSI devices were represented by a simple structure, the
+.Xr scsi_address 9S .
+This represented devices by a simple target and lun number.
+While this interface is useful for simple devices and traditional
+parallel SCSI devices, it is not as useful for SAS-era devices where the
+SCSI bus is now a fabric.
+A driver may opt into such a complex addressing mode by setting the
+.Dv SCSI_HBA_ADDR_COMPLEX
+flag.
+.Pp
+When this flag is set, the HBA driver must treat the SCSI address
+as an opaque structure.
+Once in this mode, the driver may get and set a private data structure
+on the SCSI device.
+This is facilitated by the
+.Xr scsi_device_hba_private_set 9F
+and
+.Xr scsi_device_hba_private_get 9F
+functions.
+In addition, the system provides a means to map between the
+.Xr scsi_address 9S
+structure and the corresponding
+.Xr scsi_device 9S
+structure.
+This is performed by the
+.Xr scsi_device_unit_address 9F
+function.
+.Sh SEE ALSO
+.Xr attach 9E ,
+.Xr attach 9E ,
+.Xr detach 9E ,
+.Xr sas_phymap_create 9F ,
+.Xr sas_phymap_destroy 9F ,
+.Xr sas_phymap_phy_add 9F ,
+.Xr sas_phymap_phy_rem 9F ,
+.Xr scsi_device_hba_private_get 9F ,
+.Xr scsi_device_hba_private_set 9F ,
+.Xr scsi_device_unit_address 9F ,
+.Xr scsi_hba_attach_setup 9F ,
+.Xr scsi_hba_iport_register 9F ,
+.Xr scsi_hba_iport_unit_address 9F ,
+.Xr scsi_hba_iportmap_create 9F ,
+.Xr scsi_hba_iportmap_destroy 9F ,
+.Xr scsi_hba_iportmap_iport_add 9F ,
+.Xr scsi_hba_iportmap_iport_remove 9F ,
+.Xr scsi_hba_tgtmap_create 9F ,
+.Xr scsi_hba_tgtmap_destroy 9F ,
+.Xr scsi_hba_tgtmap_set_add 9F ,
+.Xr scsi_hba_tgtmap_set_begin 9F ,
+.Xr scsi_hba_tgtmap_set_end 9F ,
+.Xr scsi_hba_tgtmap_set_flush 9F ,
+.Xr scsi_hba_tgtmap_tgt_add 9F ,
+.Xr scsi_hba_tgtmap_tgt_remove 9F ,
+.Xr scsi_address 9S ,
+.Xr scsi_address 9S ,
+.Xr scsi_device 9S ,
+.Xr scsi_hba_tran 9S
diff --git a/usr/src/man/man9e/Makefile b/usr/src/man/man9e/Makefile
index 0c29674b11..8036f34cda 100644
--- a/usr/src/man/man9e/Makefile
+++ b/usr/src/man/man9e/Makefile
@@ -43,6 +43,7 @@ MANFILES= Intro.9e \
ks_update.9e \
mac.9e \
mac_capab_transceiver.9e \
+ mac_capab_led.9e \
mc_getcapab.9e \
mc_getprop.9e \
mc_getstat.9e \
@@ -112,6 +113,7 @@ MANLINKS= _info.9e \
MAC.9e \
mc_close.9e \
mc_stop.9e \
+ mcl_set.9e \
mct_info.9e \
mct_read.9e \
intro.9e \
@@ -151,6 +153,8 @@ gldm_stop.9e := LINKSRC = gld.9e
mc_close.9e := LINKSRC = mc_open.9e
mc_stop.9e := LINKSRC = mc_start.9e
+mcl_set.9e := LINKSRC = mac_capab_led.9e
+
mct_info.9e := LINKSRC = mac_capab_transceiver.9e
mct_read.9e := LINKSRC = mac_capab_transceiver.9e
diff --git a/usr/src/man/man9e/mac_capab_led.9e b/usr/src/man/man9e/mac_capab_led.9e
new file mode 100644
index 0000000000..cf6b3713d3
--- /dev/null
+++ b/usr/src/man/man9e/mac_capab_led.9e
@@ -0,0 +1,228 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright (c) 2017, Joyent, Inc.
+.\"
+.Dd Feb 21, 2017
+.Dt MAC_CAPAB_LED 9E
+.Os
+.Sh NAME
+.Nm mac_capab_led ,
+.Nm mcl_set
+.Nd MAC LED capability
+.Sh SYNOPSIS
+.In sys/mac_provider.h
+.Vt typedef struct mac_capab_led mac_capab_led_t;
+.Vt typedef enum mac_led_mode mac_led_mode_t;
+.Ft int
+.Fo mcl_set
+.Fa "void *driver"
+.Fa "mac_led_mode_t mode"
+.Fa "uint_t flags"
+.Fc
+.Sh INTERFACE LEVEL
+.Sy Evolving -
+This interface is still evolving.
+API and ABI stability is not guaranteed.
+.Sh PARAMETERS
+.Bl -tag -width Fa
+.It Fa driver
+A pointer to the driver's private data that was passed in via the
+.Sy m_pdata
+member of the
+.Xr mac_register 9S
+structure to the
+.Xr mac_register 9F
+function.
+.It Fa mode
+A value that indicates how the driver should drive the LEDs.
+See the
+.Sx LED MODES
+section for a list of supported modes.
+.It Fa flags
+Reserved for future use.
+.El
+.Sh DESCRIPTION
+The
+.Sy MAC_CAPAB_LED
+capability allows GLDv3 device drivers to expose an interface for
+controlling the LEDs on the device.
+This allows the system to control the LEDs to assist system
+administrators in finding and identifying specific physical devices in
+the system.
+.Pp
+Implementing this capability is optional.
+For more information on how to handle capabilities and how to indicate
+that a capability is not supported, see
+.Xr mc_getcapab 9E .
+.Pp
+This capability should be implemented if the device in question provides
+a way to manipulate its LEDs.
+Generally the LEDs on a device default to indicating link status and
+activity.
+However, they can often be turned off or set to a specific pattern for
+identification purposes.
+.Ss LED MODES
+The system has a notion of different LED modes.
+Each LED mode suggests a different way that a device driver should drive
+the indicator LEDs on the device.
+While we generally want all such LED modes to be as uniform
+as possible, there is a limit to such similarities due to the
+capabilities of NICs.
+Each mode is a member of the
+.Vt mac_led_mode_t
+enumeration.
+The currently defined modes are:
+.Bl -tag -width Dv -offset indent
+.It Dv MAC_LED_DEFAULT
+This mode indicates that the device's default behavior should be used.
+This is usually some form of link status and activity.
+It is device specific and usually is the default behavior after a device
+is powered on.
+.It Dv MAC_LED_OFF
+This mode indicates that the device's LEDs should be turned off and not
+emit any light.
+.It Dv MAC_LED_ON
+This mode indicates that the device's LEDs should be turned on and
+remain solid.
+.It Dv MAC_LED_IDENT
+This mode indicates that the driver should emit some form of
+identification pattern.
+We suggest that devices indicate some form of solid blinking light that
+is on and off at alternating units of time, for example, every 200
+milliseconds.
+If it is possible to use an alternate color from the normal link up and
+activity lighting, that is recommended.
+.El
+.Ss MAC Capability Structure
+When the device driver's
+.Xr mc_getcapab 9E
+function entry point is called with the capability set to
+.Dv MAC_CAPAB_LED ,
+then the value of the capability structure is the following structure:
+.Bd -literal -offset indent
+typedef struct mac_capab_led {
+ uint_t mcl_flags;
+ mac_led_mode_t mcl_modes;
+ int (*mcl_set)(void *driver, mac_led_mode_t mode,
+ uint_t flags);
+} mac_capab_led_t;
+.Ed
+.Pp
+If the driver supports the
+.Dv MAC_CAPAB_LED
+capability, it should fill in this structure, based on the following
+rules:
+.Bl -tag -width Vt
+.It Fa mcl_flags
+The
+.Fa mcl_flags
+member is used to negotiate extensions with the driver.
+MAC will set the value of
+.Fa mcl_flags
+to include all of the currently known extensions.
+The driver should intersect this list with the set that they actually
+support.
+At this time, no such features are defined and the driver should set the
+member to
+.Sy 0 .
+.It Fa mcl_modes
+The
+.Fa mcl_modes
+member represents the support modes of the device driver.
+The device driver should set
+.Vt mcl_modes
+to the bitwise-inclusive-OR of the LED modes listed in
+.Sx LED MODES .
+.Pp
+If the driver does not support anything other than the default behavior
+of
+.Dv MAC_LED_DEFAULT ,
+then the device driver should not indicate that it supports this
+capability.
+.It Fa mcl_set
+The
+.Fa mcl_set
+entry point will be called by the MAC framework when it needs the device
+driver to change how it is driving its LEDs.
+Each call will ask the driver to change the display mode to the
+specified mode.
+The driver does not have to multiplex requests for multiple modes or
+keep track of what has been requested, that is taken care of by the
+system itself.
+.Pp
+The driver should first validate that
+.Fa mode
+is a mode that it supports.
+While the device reports the set of supported modes as a
+bitwise-inclusive-OR, the driver should only receive a single value in
+.Fa mode .
+The value of the
+.Fa flags
+argument is reserved for future use.
+Drivers must check that the value of flags is zero and if not, return
+.Er EINVAL .
+.Pp
+When this entry point is first called on a driver, it should snapshot
+its device registers such that it knows how to restore the default
+behavior.
+Because each method of programming the LEDs is different, it
+is up to the driver itself to take care of this, the broader framework
+cannot take care of it.
+.Pp
+If for some reason the driver is asked to program the same mode that it
+is already driving, then it need not do anything and should simply
+return success.
+.Pp
+Once the driver successfully changes the LED driving mode, it should
+return
+.Sy 0 .
+Otherwise, it should return the appropriate error number.
+For a full list of error numbers, see
+.Xr Intro 2 .
+Common values are:
+.Bl -tag -width Er -offset width
+.It Er EINVAL
+.Fa flag
+contains an unknown value.
+.It Er ENOTSUP
+.Fa mode
+is unsupported.
+.Fa flags
+contains an unsupported or unknown value.
+.It Er EIO
+An I/O error occurred while trying to program the device's registers.
+This could be because a command timed out or an FM-aware driver
+encountered an error.
+.El
+.Pp
+The broader framework will guarantee that only a single call to the
+.Fa mcl_set
+function is ongoing at any time.
+If other parts of the driver refer to the data used by the
+.Fa mcl_set
+function, then the driver must ensure that it is performing sufficient
+locking of its data.
+.El
+.Sh CONTEXT
+The
+.Ft mcl_set
+entry point will only be called from
+.Sy user
+or
+.Sy kernel
+context.
+It will never be called from interrupt context.
+.Sh SEE ALSO
+.Xr Intro 2 ,
+.Xr mac 9E ,
+.Xr mc_getcapab 9E ,
+.Xr mac_register 9F
diff --git a/usr/src/man/man9f/Makefile b/usr/src/man/man9f/Makefile
index dcea9314f9..3d02d6e075 100644
--- a/usr/src/man/man9f/Makefile
+++ b/usr/src/man/man9f/Makefile
@@ -442,7 +442,10 @@ MANFILES= ASSERT.9f \
rmvb.9f \
rmvq.9f \
rwlock.9f \
+ sas_phymap_create.9f \
+ sas_phymap_lookup_ua.9f \
scsi_abort.9f \
+ scsi_address_device.9f \
scsi_alloc_consistent_buf.9f \
scsi_cname.9f \
scsi_destroy_pkt.9f \
@@ -455,10 +458,15 @@ MANFILES= ASSERT.9f \
scsi_get_device_type_string.9f \
scsi_hba_attach_setup.9f \
scsi_hba_init.9f \
+ scsi_hba_iport_exist.9f \
+ scsi_hba_iport_register.9f \
+ scsi_hba_iport_unit_address.9f \
+ scsi_hba_iportmap_create.9f \
scsi_hba_lookup_capstr.9f \
scsi_hba_pkt_alloc.9f \
scsi_hba_pkt_comp.9f \
scsi_hba_probe.9f \
+ scsi_hba_tgtmap_create.9f \
scsi_hba_tran_alloc.9f \
scsi_ifgetcap.9f \
scsi_init_pkt.9f \
@@ -476,6 +484,7 @@ MANFILES= ASSERT.9f \
scsi_unprobe.9f \
scsi_validate_sense.9f \
scsi_vu_errmsg.9f \
+ scsi_wwnstr_to_wwn.9f \
semaphore.9f \
sprintf.9f \
stoi.9f \
@@ -746,7 +755,9 @@ MANLINKS= AVL_NEXT.9f \
ddi_dmae_release.9f \
ddi_dmae_stop.9f \
ddi_exit_critical.9f \
+ ddi_ffsll.9f \
ddi_fls.9f \
+ ddi_flsll.9f \
ddi_fm_capable.9f \
ddi_fm_dma_err_clear.9f \
ddi_fm_dma_err_get.9f \
@@ -1166,11 +1177,34 @@ MANLINKS= AVL_NEXT.9f \
rw_tryenter.9f \
rw_tryupgrade.9f \
samestr.9f \
+ sas_phymap_destroy.9f \
+ sas_phymap_lookup_uapriv.9f \
+ sas_phymap_phy_add.9f \
+ sas_phymap_phy_rem.9f \
+ sas_phymap_phy2ua.9f \
+ sas_phymap_phys_free.9f \
+ sas_phymap_phys_next.9f \
+ sas_phymap_ua_free.9f \
+ sas_phymap_ua2phys.9f \
+ sas_phymap_uahasphys.9f \
+ scsi_device_unit_address.9f \
+ scsi_device_hba_private_get.9f \
+ scsi_device_hba_private_set.9f \
scsi_dmafree.9f \
scsi_dname.9f \
scsi_hba_detach.9f \
scsi_hba_fini.9f \
+ scsi_hba_iport_find.9f \
+ scsi_hba_iportmap_destroy.9f \
+ scsi_hba_iportmap_iport_add.9f \
+ scsi_hba_iportmap_iport_remove.9f \
scsi_hba_pkt_free.9f \
+ scsi_hba_tgtmap_set_begin.9f \
+ scsi_hba_tgtmap_set_add.9f \
+ scsi_hba_tgtmap_set_end.9f \
+ scsi_hba_tgtmap_set_flush.9f \
+ scsi_hba_tgtmap_tgt_add.9f \
+ scsi_hba_tgtmap_tgt_remove.9f \
scsi_hba_tran_free.9f \
scsi_ifsetcap.9f \
scsi_mname.9f \
@@ -1184,6 +1218,8 @@ MANLINKS= AVL_NEXT.9f \
scsi_sense_info_uint64.9f \
scsi_sname.9f \
scsi_unslave.9f \
+ scsi_wwn_to_wwnstr.9f \
+ scsi_free_wwnstr.9f \
sema_destroy.9f \
sema_init.9f \
sema_p.9f \
@@ -1522,7 +1558,9 @@ ddi_dmae_stop.9f := LINKSRC = ddi_dmae.9f
ddi_exit_critical.9f := LINKSRC = ddi_enter_critical.9f
+ddi_ffsll.9f := LINKSRC = ddi_ffs.9f
ddi_fls.9f := LINKSRC = ddi_ffs.9f
+ddi_flsll.9f := LINKSRC = ddi_ffs.9f
ddi_fm_dma_err_clear.9f := LINKSRC = ddi_fm_acc_err_clear.9f
@@ -2022,6 +2060,22 @@ rw_read_locked.9f := LINKSRC = rwlock.9f
rw_tryenter.9f := LINKSRC = rwlock.9f
rw_tryupgrade.9f := LINKSRC = rwlock.9f
+sas_phymap_destroy.9f := LINKSRC = sas_phymap_create.9f
+sas_phymap_phy_add.9f := LINKSRC = sas_phymap_create.9f
+sas_phymap_phy_rem.9f := LINKSRC = sas_phymap_create.9f
+
+sas_phymap_lookup_uapriv.9f := LINKSRC = sas_phymap_lookup_ua.9f
+sas_phymap_phy2ua.9f := LINKSRC = sas_phymap_lookup_ua.9f
+sas_phymap_ua_free.9f := LINKSRC = sas_phymap_lookup_ua.9f
+sas_phymap_uahasphys.9f := LINKSRC = sas_phymap_lookup_ua.9f
+sas_phymap_ua2phys.9f := LINKSRC = sas_phymap_lookup_ua.9f
+sas_phymap_phys_next.9f := LINKSRC = sas_phymap_lookup_ua.9f
+sas_phymap_phys_free.9f := LINKSRC = sas_phymap_lookup_ua.9f
+
+scsi_device_unit_address.9f := LINKSRC = scsi_address_device.9f
+scsi_device_hba_private_get.9f := LINKSRC = scsi_address_device.9f
+scsi_device_hba_private_set.9f := LINKSRC = scsi_address_device.9f
+
scsi_dname.9f := LINKSRC = scsi_cname.9f
scsi_mname.9f := LINKSRC = scsi_cname.9f
scsi_rname.9f := LINKSRC = scsi_cname.9f
@@ -2036,8 +2090,21 @@ scsi_hba_detach.9f := LINKSRC = scsi_hba_attach_setup.9f
scsi_hba_fini.9f := LINKSRC = scsi_hba_init.9f
+scsi_hba_iportmap_destroy.9f := LINKSRC = scsi_hba_iportmap_create.9f
+scsi_hba_iportmap_iport_add.9f := LINKSRC = scsi_hba_iportmap_create.9f
+scsi_hba_iportmap_iport_remove.9f := LINKSRC = scsi_hba_iportmap_create.9f
+
+scsi_hba_iport_find.9f := LINKSRC = scsi_hba_iport_exist.9f
+
scsi_hba_pkt_free.9f := LINKSRC = scsi_hba_pkt_alloc.9f
+scsi_hba_tgtmap_set_begin.9f := LINKSRC = scsi_hba_tgtmap_create.9f
+scsi_hba_tgtmap_set_add.9f := LINKSRC = scsi_hba_tgtmap_create.9f
+scsi_hba_tgtmap_set_end.9f := LINKSRC = scsi_hba_tgtmap_create.9f
+scsi_hba_tgtmap_set_flush.9f := LINKSRC = scsi_hba_tgtmap_create.9f
+scsi_hba_tgtmap_tgt_add.9f := LINKSRC = scsi_hba_tgtmap_create.9f
+scsi_hba_tgtmap_tgt_remove.9f := LINKSRC = scsi_hba_tgtmap_create.9f
+
scsi_hba_tran_free.9f := LINKSRC = scsi_hba_tran_alloc.9f
scsi_ifsetcap.9f := LINKSRC = scsi_ifgetcap.9f
@@ -2051,6 +2118,9 @@ scsi_sense_ascq.9f := LINKSRC = scsi_sense_key.9f
scsi_unslave.9f := LINKSRC = scsi_unprobe.9f
+scsi_wwn_to_wwnstr.9f := LINKSRC = scsi_wwnstr_to_wwn.9f
+scsi_free_wwnstr.9f := LINKSRC = scsi_wwnstr_to_wwn.9f
+
sema_destroy.9f := LINKSRC = semaphore.9f
sema_init.9f := LINKSRC = semaphore.9f
sema_p.9f := LINKSRC = semaphore.9f
diff --git a/usr/src/man/man9f/ddi_ffs.9f b/usr/src/man/man9f/ddi_ffs.9f
index afd1e13dbd..e6d5c1dfe2 100644
--- a/usr/src/man/man9f/ddi_ffs.9f
+++ b/usr/src/man/man9f/ddi_ffs.9f
@@ -3,74 +3,95 @@
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH DDI_FFS 9F "Jun 5, 2013"
-.SH NAME
-ddi_ffs, ddi_fls \- find first (last) bit set in a long integer
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/conf.h>
-#include <sys/ddi.h>
-#include <sys/sunddi.h>
-
-
-
-\fBint\fR \fBddi_ffs\fR(\fBlong\fR \fImask\fR);
-.fi
-
-.LP
-.nf
-\fBint\fR \fBddi_fls\fR(\fBlong\fR \fImask\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
+.Dd July 14, 2017
+.Dt DDI_FFS 9F
+.Os
+.Sh NAME
+.Nm ddi_ffs, ddi_ffsll, ddi_fls, ddi_flsll
+.Nd find first (last) bit set in a long (long) integer
+.Sh SYNOPSIS
+.In sys/conf.h
+.In sys/ddi.h
+.In sys/sunddi.h
+.Ft int
+.Fo "ddi_ffs"
+.Fa "long mask"
+.Fc
+.Ft int
+.Fo "ddi_fls"
+.Fa "long mask"
+.Fc
+.Ft int
+.Fo "ddi_ffs"
+.Fa "long long mask"
+.Fc
+.Ft int
+.Fo "ddi_fls"
+.Fa "long long mask"
+.Fc
+.Sh INTERFACE LEVEL
Solaris DDI specific (Solaris DDI).
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fImask\fR\fR
-.ad
-.RS 8n
-A 32-bit argument value to search through.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-The function \fBddi_ffs()\fR takes its argument and returns the shift count
-that the first (least significant) bit set in the argument corresponds to. The
-function \fBddi_fls()\fR does the same, only it returns the shift count for the
-last (most significant) bit set in the argument.
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fB0\fR\fR
-.ad
-.RS 5n
+.Sh PARAMETERS
+.Bl -tag -width Va
+.It Fa mask
+A 32-bit or 64-bit argument value to search through.
+.El
+.Sh DESCRIPTION
+The functions
+.Fn ddi_ffs
+and
+.Fn ddi_ffsll
+take their argument and return the shift count that the first (least
+significant) bit set in the argument corresponds to.
+The functions
+.Fn ddi_fls
+and
+.Fn ddi_flsll
+do the same, only they returns the shift count for the last (most
+significant) bit set in the argument.
+.Fn ddi_ffs
+and
+.Fn ddi_fls
+operate on 32-bit values, while
+.Fn ddi_ffsll
+and
+.Fn ddi_flsll
+operate on 64-bit values.
+.Sh CONTEXT
+These functions can be called from user, interrupt, or kernel context.
+.Sh RETURN VALUES
+.Bl -tag -width Va
+.It 0
No bits are set in mask.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIN\fR\fR
-.ad
-.RS 5n
-Bit \fIN\fR is the least significant (\fBddi_ffs\fR) or most significant
-(\fBddi_fls\fR) bit set in mask. Bits are numbered from \fB1\fR to \fB32\fR,
-with bit \fB1\fR being the least significant bit position and bit \fB32\fR the
-most significant position.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function can be called from user, interrupt, or kernel context.
-.SH SEE ALSO
-.sp
-.LP
+.It N
+Bit
+.Em N
+is the least significant
+.Po
+.Fn ddi_ffs ,
+.Fn ddi_ffsll
+.Pc
+or most significant
+.Po
+.Fn ddi_fls ,
+.Fn ddi_flsll
+.Pc
+bit set in
+.Fa mask .
+Bits are numbered from
+.Em 1
+to
+.Em 32
+or
+.Em 64 ,
+with bit
+.Em 1
+being the least significant bit position and bit
+.Em 32
+or
+.Em 64
+the most significant position, depending on the variant of the
+functions used.
+.El
+.Sh SEE ALSO
\fIWriting Device Drivers\fR
diff --git a/usr/src/man/man9f/kmem_alloc.9f b/usr/src/man/man9f/kmem_alloc.9f
index 9c4f8ccb0c..201544b57c 100644
--- a/usr/src/man/man9f/kmem_alloc.9f
+++ b/usr/src/man/man9f/kmem_alloc.9f
@@ -129,5 +129,8 @@ uninitialized kernel memory should be handled carefully. For example, never
.SH NOTES
.sp
.LP
-\fBkmem_alloc(0\fR, \fIflag\fR\fB)\fR always returns \fINULL\fR.
-\fBkmem_free(NULL, 0)\fR is legal.
+\fBkmem_alloc(0\fR, \fIflag\fR\fB)\fR always returns \fINULL\fR, but
+if \fBKM_SLEEP\fR is set, this behavior is considered to be deprecated;
+the system may be configured to explicitly panic in this case in lieu
+of returning \fINULL\fR.
+\fBkmem_free(NULL, 0)\fR is legal, however.
diff --git a/usr/src/man/man9f/sas_phymap_create.9f b/usr/src/man/man9f/sas_phymap_create.9f
new file mode 100644
index 0000000000..97b5515946
--- /dev/null
+++ b/usr/src/man/man9f/sas_phymap_create.9f
@@ -0,0 +1,307 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright (c) 2017, Joyent, Inc.
+.\"
+.Dd Apr 20, 2017
+.Dt SAS_PHYMAP_CREATE 9F
+.Os
+.Sh NAME
+.Nm sas_phymap_create ,
+.Nm sas_phymap_destroy ,
+.Nm sas_phymap_phy_add ,
+.Nm sas_phymap_phy_rem
+.Nd SAS PHY map functions
+.Sh SYNOPSIS
+.In sys/scsi/scsi.h
+.Ft int
+.Fo sas_phymap_create
+.Fa "dev_info_t *dip"
+.Fa "int settle_usec"
+.Fa "sas_phymap_mode_t mode"
+.Fa "void *mode_argument"
+.Fa "void *phymap_priv"
+.Fa "sas_phymap_activate_cb_t activate_cb"
+.Fa "sas_phymap_deactivate_cb_t deactivate_cb"
+.Fa "sas_phymap_t **phymapout"
+.Fc
+.Ft void
+.Fo sas_phymap_destroy
+.Fa "sas_phymap_t *phymap"
+.Fc
+.Ft int
+.Fo sas_phymap_phy_add
+.Fa "sas_phymap_t *phymap"
+.Fa "int phy"
+.Fa "uint64_t local"
+.Fa "uint64_t remote"
+.Fc
+.Ft int
+.Fo sas_phymap_phy_rem
+.Fa "sas_phymap_t *phymap"
+.Fa "int phy"
+.Fc
+.Ft void
+.Fo (*sas_phymap_activate_cb_t)
+.Fa "void *phymap_priv"
+.Fa "char *ua"
+.Fa "void **ua_privp"
+.Fc
+.Ft void
+.Fo (*sas_phymap_deactivate_cb_t)
+.Fa "void *phymap_priv"
+.Fa "char *ua"
+.Fa "void *ua_priv"
+.Fc
+.Sh INTERFACE LEVEL
+.Sy Evolving -
+This interface is still evolving in illumos.
+API and ABI stability is
+not guaranteed.
+.Sh PARAMETERS
+.Bl -tag -width Fa
+.It Fa dip
+Pointer to
+.Vt dev_info
+structure.
+.It Fa settle_usec
+A time in microseconds.
+.It Fa mode
+Mode of operation for the phy map.
+Should be set to
+.Dv PHYMAP_MODE_SIMPLE .
+.It Fa mode_priv
+Drivers should pass
+.Dv NULL .
+.It Fa phymap_priv
+A private argument to be used in callback functions.
+.It Fa activate_cb
+An optional callback that will be called when a new phy is being
+added to the system.
+.It Fa deactivate_cb
+An optional callback that will be called when an existing phys is
+removed from the system.
+.It Fa phymapout
+Pointer where the phy map is stored.
+.It Fa phymap
+Pointer to an allocated phy map.
+.It Fa phy
+A non-negative integer that uniquely identifies a phy on a device.
+.It Fa local
+The World Wide Number (WWN) of the HBA-owned side of the phy.
+.It Fa remote
+The World Wide Number (WWN) of the device that is plugged into the phy.
+.It Fa ua
+A character string that indicates the system generated unit address for
+the logical port.
+.It Fa ua_privp
+A private value that can be stored for the corresponding unit address.
+.It Fa ua_priv
+A private value for the unit address stored into
+.Fa ua_privp .
+.El
+.Sh DESCRIPTION
+The
+.Fn sas_phymap_create
+and
+.Fn sas_phymap_destroy
+functions create and destroy phymaps which are used to manage a set of
+potentially-active SAS phys and the attached devices.
+For more background, see
+.Xr phymap 9 .
+If the driver in question is not a SAS HBA or a similar fabric-like
+device, then do not use this interface.
+.Pp
+The phy map maps one or more phys to a logical port-like construct that
+is represented based on the WWNs in question.
+This logical SAS port has a unit address derived from the two WWNs.
+When the first phy is noted as using these WWNs, then the phymap will
+call any registered callbacks as the port is created.
+If additional phys come online in service of the
+same port, then a new port will not be created.
+.Pp
+To facilitate the mapping between a PHY and the corresponding port unit
+address, the
+.Xr sas_phymap_phy2ua 9F
+and
+.Xr sas_phymap_lookup_ua 9F
+functions are available.
+.Pp
+To create a phy map, the driver uses the
+.Fn sas_phymap_create
+function.
+The resulting phy map will be stored in the
+.Fa phymapout
+argument.
+The value in
+.Fa settle_usec
+indicates the amount of time that the system should wait to quiesce all
+changes and consider the resulting system stable.
+Changes will not be reported until after
+.Fa settle_usec
+have passed.
+.Pp
+If a driver places a function pointer for either the
+.Fa activate_cb
+or
+.Fa deactivate cb
+then those functions will be called when phys are added and removed from
+the phy map.
+.Pp
+The value placed in the
+.Fa phymap_priv
+argument will be passed to both callback functions.
+.Pp
+To destroy a phymap, the driver should call the
+.Fn sas_phymap_destroy
+function.
+A side effect of this is that all existing entries in the phy
+map will be removed and their deactivate callbacks will fire.
+.Ss Callbacks
+The phymap provides a means for receiving callbacks when the addition of
+a phy causes a new logical port to be created or when the phy being
+removed is the last phy that is a member of the port.
+Unlike with the
+.Xr tgtmap 9 ,
+there is no system managed driver that is attached with the phymap.
+For the phymap to be useful to drivers, the callbacks should generally
+be registered.
+.Pp
+It's important to emphasize that the callbacks do not represent phys,
+but instead the logical port that they are bound to.
+This is different
+from the
+.Xr tgtmap 9
+and
+.Xr iportmap 9 .
+Calls to the
+.Fn sas_phymap_phy_add
+and
+.Fn sas_phymap_phy_rem
+functions may not result in anything being created in the system.
+.Pp
+The
+.Fa activate_cb
+callback occurs whenever a new logical port is created because the first
+phy that references that pair of WWNs has been created.
+The
+.Fa phymap_priv
+argument corresponds to the value passed in the
+.Fn sas_phymap_create
+function.
+.Pp
+The
+.Fa ua
+argument is a unit-address string that the system constructs based on
+the WWNs passed in the
+.Fa local
+and
+.Fa remote
+arguments to the
+.Fn sas_phymap_phy_add
+function.
+If this is being used together with an
+.Xr iportmap 9
+then the
+.Fa ua
+should be the name of the added iport.
+.Pp
+The
+.Fa ua_privp
+argument allows for data to be correlated with the unit-address.
+This data is accessible throughout the lifetime of the unit-address
+through the
+.Xr sas_phymap_lookup_uapriv 9F
+function and is also made available during the deactivate callback.
+.Pp
+The
+.Fa deactivate_cb
+callback occurs when the logical port is being removed, because the last
+associated phy has been removed.
+The arguments to this are the same as to the activate callback, with the
+exception that the
+.Fa ua_priv
+argument is the value that was stored in the
+.Fa ua_privp
+argument of the activate callback.
+.Ss Adding and Removing PHYs
+To add a phy to the system, the driver should call the
+.Fn sas_phymap_phy_add
+function.
+The
+.Fa phy
+argument should indicate the phy identifier of the phy that has come up.
+The
+.Fa local
+WWN generally corresponds to the SAS port on the controller, while the
+.Fa remote
+WWN is whatever device is on the other side of the phy.
+The system enforces that a given phy only maps to a single port at any
+time.
+.Pp
+When a phy goes offline, then the driver should call the
+.Fn sas_phymap_phy_rem
+function using the same phy identifier that it used when adding the phy.
+If this is the last phy that was used for this logical port, then the
+corresponding logical port will be removed and the deactivate callback
+function, if registered, will be called.
+.Sh CONTEXT
+The
+.Fn sas_phymap_create
+and
+.Fn sas_phymap_destroy
+functions are generally called during an HBA driver's
+.Xr attach 9E
+and
+.Xr detach 9E
+entry points, though may be called by a driver from
+.Sy user
+or
+.Sy kernel
+context.
+.Pp
+The optional
+.Fn activate_cb
+and
+.Fn deactivate_cb
+functions for a phymap will be called into the driver from
+.Sy kernel
+context.
+.Pp
+The
+.Fn sas_phymap_phy_add
+and
+.Fn sas_phymap_phy_rem
+functions may be called from
+.Sy user
+or
+.Sy kernel
+context.
+.Sh RETURN VALUES
+Upon successful completion, the
+.Fn sas_phymap_create ,
+.Fn sas_phymap_phy_add ,
+and
+.Fn sas_phymap_phy_rem
+functions return
+.Dv DDI_SUCCESS .
+Otherwise,
+.Dv DDI_FAILURE
+is returned to indicate failure.
+.Sh SEE ALSO
+.Xr iportmap 9 ,
+.Xr phymap 9 ,
+.Xr tgtmap 9 ,
+.Xr attach 9E ,
+.Xr detach 9E ,
+.Xr sas_phymap_lookup_ua 9F ,
+.Xr sas_phymap_lookup_uapriv 9F ,
+.Xr sas_phymap_phy2ua 9F
diff --git a/usr/src/man/man9f/sas_phymap_lookup_ua.9f b/usr/src/man/man9f/sas_phymap_lookup_ua.9f
new file mode 100644
index 0000000000..5255f49632
--- /dev/null
+++ b/usr/src/man/man9f/sas_phymap_lookup_ua.9f
@@ -0,0 +1,213 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright (c) 2017, Joyent, Inc.
+.\"
+.Dd Apr 20, 2017
+.Dt SAS_PHYMAP_LOOKUP_UA 9F
+.Os
+.Sh NAME
+.Nm sas_phymap_lookup_ua ,
+.Nm sas_phymap_lookup_uapriv ,
+.Nm sas_phymap_phy2ua ,
+.Nm sas_phymap_ua_free ,
+.Nm sas_phymap_uahasphys ,
+.Nm sas_phymap_ua2phys ,
+.Nm sas_phymap_phys_next ,
+.Nm sas_phymap_phys_free
+.Nd SAS phymap utility functions
+.Sh SYNOPSIS
+.In sys/scsi/scsi.h
+.Ft "char *"
+.Fo sas_phymap_lookup_ua
+.Fa "sas_phymap_t *phymap"
+.Fa "uint64_t local"
+.Fa "uint64_t remote"
+.Fc
+.Ft "void *"
+.Fo sas_phymap_lookup_uapriv
+.Fa "sas_phymap_t *phymap"
+.Fa "char *ua"
+.Fc
+.Ft int
+.Fo sas_phymap_uahasphys
+.Fa "sas_phymap_t *phymap"
+.Fa "char *ua"
+.Fc
+.Ft "char *"
+.Fo sas_phymap_phy2ua
+.Fa "sas_phymap_t *phymap"
+.Fa "int phy"
+.Fc
+.Ft void
+.Fo sas_phymap_ua_free
+.Fa "char *ua"
+.Fc
+.Ft "sas_phymap_phys_t *"
+.Fo sas_phymap_ua2phys
+.Fa "sas_phymap_t *phymap"
+.Fa "char *ua"
+.Fc
+.Ft int
+.Fo sas_phymap_phys_next
+.Fa "sas_phymap_phys_t *phys"
+.Fc
+.Ft void
+.Fo sas_phymap_phys_free
+.Fa "sas_phymap_phys_t *phys"
+.Fc
+.Sh INTERFACE LEVEL
+.Sy Evolving -
+This interface is still evolving in illumos.
+API and ABI stability is
+not guaranteed.
+.Sh PARAMETERS
+.Bl -tag -width Fa
+.It Fa phymap
+Pointer to an allocated phy map.
+.It Fa local
+The World Wide Number (WWN) of the HBA-owned side of the phy.
+.It Fa remote
+The World Wide Number (WWN) of the device that is plugged into the phy.
+.It Fa ua
+A character string that indicates the system generated unit address for
+the logical port.
+.It Fa phy
+A non-negative integer that uniquely identifies a phy on a device.
+.It Fa phys
+An opaque structure that represents a collection of phys on a port.
+.El
+.Sh DESCRIPTION
+The functions described here are all utility functions for operating on
+a phymap and the entities it creates.
+ For more information on phymaps,
+see
+.Xr phymap 9
+and
+.Xr sas_phymap_create 9F .
+.Pp
+The
+.Fn sas_phymap_lookup_ua
+function finds the unit address of the logical port that corresponds to
+the tuple of the
+.Fa local
+and
+.Fa remote
+WWN.
+If a logical port exists for that tuple, then a pointer to its
+system generated unit-address is returned.
+This string is managed by the system and it must not be modified or freed.
+If it cannot be found, then
+.Dv NULL
+is returned.
+.Pp
+The
+.Fn sas_phymap_lookup_uapriv
+function returns the private value that was stored during the activate
+callback of the logical port represented by the unit address
+.Fa ua
+that is a part of the phymap
+.Fa phymap .
+.Pp
+The
+.Fn sas_phymap_uahasphys
+function is used to determine whether or not the logical port
+represented by the unit address specified in
+.Fa ua
+that is a part of the phymap
+.Fa phymap
+has any phys.
+If phys are found, then the function returns
+.Sy 1 .
+.Pp
+The
+.Fn sas_phymap_phy2ua
+function attempts to map a given phy specified by
+.Fa phy
+to its unit-address in the map
+.Fa phymap .
+This function will allocate memory for the character string, thus it can
+be modified.
+The caller must call the
+.Fa sas_phymap_ua_free
+function to release the memory that was allocated.
+The
+.Fa sas_phymap_ua_free
+function should not be used with the string returned from the
+.Fn sas_phymap_lookup_ua
+function.
+.Pp
+The
+.Fn sas_phymap_ua2phys
+function creates a collection of phys that exist on a given logical port
+represented by the unit-address
+.Fa ua
+in the map
+.Fa phymap .
+This set can be iterated by calling the
+.Fn sas_phyap_phys_next
+function.
+Each time the function is called, an entry is returned.
+When the value
+.Sy -1
+is returned it indicates that the set is empty.
+Regardless of whether or not the set has been iterated over, the caller
+must call the
+.Fn sas_phymap_phys_free
+function to release the memory associated with the set.
+.Sh CONTEXT
+All functions may be used in
+.Sy user ,
+.Sy kernel ,
+and
+.Sy interrupt
+context.
+.Sh RETURN VALUES
+Upon successful completion, the
+.Fn sas_phymap_lookup_ua
+and
+.Fn sas_phymap_phy2ua
+function returns a pointer to the unit-address.
+If the port or phy could not be found or another error occurred, then
+the function returns
+.Dv NULL .
+.Pp
+Upon successful completion, the
+.Fn sas_phymap_lookup_uapriv
+function returns a pointer to the port's private data, if any exists.
+Otherwise, if the port could not be found or another error occurred, then
+the function returns
+.Dv NULL .
+Upon successful completion, the
+.Fn sas_phymap_uahasphys
+returns
+.Sy 1
+to indicate that the unit-address has phys.
+If the unit-address has no phys, then it returns
+.Sy 0 .
+If an error occurred or the port doesn't exist, then the function returns
+.Sy 0 .
+.Pp
+Upon successful completion, the
+.Fn sas_phymap_ua2phys
+function returns a pointer to an allocated phy set.
+Otherwise, it returns
+.Dv NULL .
+.Pp
+The
+.Fn sas_phymap_phys_next
+function returns a non-negative integer indicating a present phy or it
+returns
+.Sy -1
+to indicate that no values remain.
+.Sh SEE ALSO
+.Xr phymap 9 ,
+.Xr sas_phymap_create 9F
diff --git a/usr/src/man/man9f/scsi_address_device.9f b/usr/src/man/man9f/scsi_address_device.9f
new file mode 100644
index 0000000000..f550d5d324
--- /dev/null
+++ b/usr/src/man/man9f/scsi_address_device.9f
@@ -0,0 +1,169 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright (c) 2017, Joyent, Inc.
+.\"
+.Dd Apr 20, 2017
+.Dt SCSI_ADDRESS_DEVICE 9F
+.Os
+.Sh NAME
+.Nm scsi_address_device ,
+.Nm scsi_device_unit_address ,
+.Nm scsi_device_hba_private_get ,
+.Nm scsi_device_hba_private_set
+.Nd SCSI Complex addressing utility functions
+.Sh SYNOPSIS
+.In sys/scsi/scsi.h
+.Ft "struct scsi_device *"
+.Fo scsi_address_device
+.Fa "struct scsi_address *sa"
+.Fc
+.Ft "void *"
+.Fo scsi_device_hba_private_get
+.Fa "struct scsi_device *sd"
+.Fc
+.Ft void
+.Fo scsi_device_hba_private_set
+.Fa "struct scsi_device *sd"
+.Fa "void *data"
+.Fc
+.Ft "char *"
+.Fo scsi_device_unit_address
+.Fa "struct scsi_device *sd"
+.Fc
+.Sh INTERFACE LEVEL
+.Sy Evolving -
+This interface is still evolving in illumos.
+API and ABI stability is
+not guaranteed.
+.Sh PARAMETERS
+.Bl -tag -width Fa
+.It Fa sa
+Pointer to a
+.Xr scsi_address 9S
+structure.
+.It Fa sd
+Pointer to a
+.Xr scsi_device 9S
+structure.
+.It Fa data
+A private value that the driver can get and set.
+.El
+.Sh DESCRIPTION
+These functions provide useful services for SCSI HBA drivers that use
+complex addressing.
+In complex addressing mode, the
+.Xr scsi_address 9S
+structure is treated as an opaque structure and is not a simple target
+and LUN.
+To use these functions, the driver must have enabled complex addressing
+by passing the
+.Dv SCSI_HBA_ADDR_COMPLEX
+flag into the
+.Fa hba_flags
+argument of the
+.Xr scsi_hba_attach_setup 9F
+function.
+If the
+.Dv SCSI_HBA_ADDR_COMPLEX
+flag was not passed, then the driver must not call the
+.Fn scsi_device_hba_private_get ,
+.Fn scsi_device_hba_private_set ,
+or
+.Fn scsi_device_unit_address
+functions.
+.Pp
+The
+.Fn scsi_address_device
+function maps the
+.Xr scsi_address 9S
+function back to its corresponding
+.Xr scsi_device 9S
+structure.
+If the
+.Dv SCSI_HBA_ADDR_COMPLEX
+flag has not been set, then the function will return
+.Dv NULL .
+This can be used as a way to check if the flag has been set on the
+device.
+.Pp
+The
+.Fn scsi_device_hba_private_set
+function, allows a driver to set a private data value on the
+.Xr scsi_device 9S
+structure, which it can later retrieve through the
+.Fn scsi_device_hba_private_get
+function.
+Most drivers will set a value during the
+.Xr tran_start 9E
+entry point and then reference the data structure later on.
+This is designed to simplify the management of mapping between driver
+data structures and the corresponding system objects.
+.Pp
+The
+.Fn scsi_device_unit_address
+function returns the unit address of the
+.Xr scsi_device 9S
+structure.
+The returned string should not be modified by the device driver.
+The unit address string comes from values that are passed when
+the device is enumerated, generally through an instance of an
+.Xr iport 9 .
+.Sh CONTEXT
+These functions may be used in
+.Sy user ,
+.Sy kernel ,
+and
+.Sy interrupt
+context.
+.Sh RETURN VALUES
+Upon successful completion, the
+.Fn scsi_address_device
+function returns a pointer to the
+.Xr scsi_device 9S
+structure.
+Otherwise, if an error occurred
+.Dv NULL
+is returned.
+.Pp
+The
+.Fn scsi_device_hba_private_set
+function returns a data value registered via the
+.Fn scsi_device_hba_private_get
+function.
+If the
+.Fn scsi_device_hba_private_get
+was never called,
+.Dv NULL
+is returned.
+.Pp
+Upon successful completion, the
+.Fn scsi_device_unit_address
+returns a pointer to a character string with the device's unit address.
+Otherwise,
+.Dv NULL
+is returned.
+.Pp
+If the
+.Dv SCSI_HBA_ADDR_COMPLEX
+flag has not been set for the HBA structure or iport, then the
+.Fn scsi_address_device ,
+.Fn scsi_device_hba_private_get ,
+and
+.Fn scsi_device_unit_address
+functions return
+.Dv NULL .
+.Sh SEE ALSO
+.Xr iport 9 ,
+.Xr tran_start 9E ,
+.Xr scsi_hba_attach_setup 9F ,
+.Xr scsi_address 9S ,
+.Xr scsi_device 9S
diff --git a/usr/src/man/man9f/scsi_hba_attach_setup.9f b/usr/src/man/man9f/scsi_hba_attach_setup.9f
index dfe56db9f4..45a72a06ca 100644
--- a/usr/src/man/man9f/scsi_hba_attach_setup.9f
+++ b/usr/src/man/man9f/scsi_hba_attach_setup.9f
@@ -1,292 +1,281 @@
-'\" te
.\" Copyright (c) 2006 Sun Microsystems, Inc., All Rights Reserved
.\" Copyright 2014 Garrett D'Amore <garrett@damore.org>
+.\" Copyright (c) 2017, Joyent, Inc.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH SCSI_HBA_ATTACH_SETUP 9F "May 24, 2014"
-.SH NAME
-scsi_hba_attach_setup, scsi_hba_detach \- SCSI HBA attach and
-detach routines
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/scsi/scsi.h>
-
-
-
-\fBint\fR \fBscsi_hba_attach_setup\fR(\fBdev_info_t *\fR\fIdip\fR, \fBddi_dma_attr_t *\fR\fIhba_dma_attr\fR,
- \fBscsi_hba_tran_t *\fR\fIhba_tran\fR, \fBint\fR \fIhba_flags\fR);
-.fi
-
-.LP
-.nf
-\fBint\fR \fBscsi_hba_detach\fR(\fBdev_info_t *\fR\fIdip\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris architecture specific (Solaris DDI).
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIdip\fR\fR
-.ad
-.RS 16n
-Pointer to the \fBdev_info_t\fR structure that refers to the instance of the
-HBA device.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIhba_tran\fR\fR
-.ad
-.RS 16n
-Pointer to a \fBscsi_hba_tran\fR(9S) structure.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIhba_flags\fR\fR
-.ad
-.RS 16n
-Flag modifiers. The defined flag values are \fBSCSI_HBA_TRAN_CLONE\fR,
-\fBSCSI_HBA_TRAN_SCB\fR, and \fBSCSI_HBA_TRAN_CDB\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIhba_options\fR\fR
-.ad
-.RS 16n
-Optional features provided by the HBA driver for future extensions; must be
-\fINULL\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIhba_dma_attr\fR\fR
-.ad
-.RS 16n
-Pointer to a \fBddi_dma_attr\fR(9S) structure.
-.RE
-
-.SH DESCRIPTION
-.sp
-.SS "scsi_hba_attach_setup(\|)"
-.sp
-.LP
-The \fBscsi_hba_attach_setup()\fR function registers the
-\fIhba_dma_attr\fR DMA attributes and the \fIhba_tran\fR transport vectors of
-each instance of the HBA device defined by \fIdip\fR. The HBA driver can pass
-different DMA attributes and the transport vectors for each
-instance of the device to support any constraints imposed by the HBA itself.
-.sp
-.LP
-The \fBscsi_hba_attach_setup()\fR function uses the
-\fBdev_bus_ops\fR field in the \fBdev_ops\fR(9S) structure. The HBA driver
-should initialize this field to \fINULL\fR before calling
-\fBscsi_hba_attach_setup()\fR.
-.sp
-.LP
-If \fBSCSI_HBA_TRAN_CLONE\fR is requested in \fIhba_flags\fR, the
-\fBhba_tran\fR structure is cloned once for each target that is attached to the
-HBA. The structure is cloned before the \fBtran_tgt_init\fR(9E) entry point is
-called to initialize a target. At all subsequent HBA entry points, including
-\fBtran_tgt_init\fR(9E), the \fBscsi_hba_tran_t\fR structure passed as an
-argument or found in a \fBscsi_address\fR structure is the cloned
-\fBscsi_hba_tran_t\fR structure,which allows the HBA to use the
-\fBtran_tgt_private\fR field in the \fBscsi_hba_tran_t\fR structure to point to
-per-target data. The HBA should free only the same \fBscsi_hba_tran_t\fR
-structure allocated when the HBA detaches. All cloned \fBscsi_hba_tran_t\fR
+.Dd Apr 23, 2017
+.Dt SCSI_HBA_ATTACH_SETUP 9F
+.Os
+.Sh NAME
+.Nm scsi_hba_attach_setup ,
+.Nm scsi_hba_detach
+.Nd SCSI HBA attach and detach routines
+.Sh SYNOPSIS
+.In sys/scsi/scsi.h
+.Ft int
+.Fo scsi_hba_attach_setup
+.Fa "dev_info_t *dip"
+.Fa "ddi_dma_attr_t *hba_dma_attr"
+.Fa "scsi_hba_tran_t *hba_tran"
+.Fa "int hba_flags"
+.Fc
+.Ft int
+.Fo scsi_hba_detach
+.Fa "dev_info_t *dip"
+.Fc
+.Sh INTERFACE LEVEL
+illumos architecture specific (illumos DDI).
+.Sh PARAMETERS
+.Bl -tag -width Fa
+.It Fa dip
+Pointer to the
+.Vt dev_info_t
+structure that refers to the instance of the HBA device.
+.It Fa hba_tran
+Pointer to a
+.Xr scsi_hba_tran 9S
+structure.
+.It Fa hba_flags
+Flag modifiers.
+The defined flag values are
+.Dv SCSI_HBA_TRAN_CLONE ,
+.Dv SCSI_HBA_TRAN_SCB ,
+.Dv SCSI_HBA_TRAN_CDB ,
+.Dv SCSI_HBA_HBA ,
+and
+.Dv SCSI_HBA_ADDR_COMPLEX .
+.It Fa hba_dma_attr
+Pointer to a
+.Xr ddi_dma_attr 9S
+structure.
+.El
+.Sh DESCRIPTION
+.Ss Fn scsi_hba_attach_setup
+The
+.Fn scsi_hba_attach_setup
+function registers the
+.Fa hba_dma_attr
+DMA attributes and the
+.Fa hba_tran
+transport vectors of each instance of the HBA device defined by
+.Fa dip .
+The HBA driver can pass different DMA attributes and the transport
+vectors for each instance of the device to support any constraints
+imposed by the HBA itself.
+.Pp
+The
+.Fn scsi_hba_attach_setup
+function uses the
+.Vt dev_bus_ops
+field in the
+.Xr dev_ops 9S
+structure.
+The HBA driver should initialize this field to
+.Dv NULL
+before calling
+.Fn scsi_hba_attach_setup .
+.Pp
+If
+.Dv SCSI_HBA_TRAN_CLONE
+is requested in
+.Fa hba_flags ,
+the
+Fa hba_tran
+structure is cloned once for each target that is attached to the
+HBA.
+The use of this flag is deprecated, drivers should instead use
+.Dv SCSI_HBA_ADDR_COMPLEX
+for per-target data.
+.Pp
+The structure is cloned before the
+.Xr tran_tgt_init 9E
+entry point is called to initialize a target.
+At all subsequent HBA
+entry points, including
+.Xr tran_tgt_init 9E ,
+the
+.Vt scsi_hba_tran_t
+structure passed as an
+argument or found in a
+.Xr scsi_address 9S
+structure is the cloned
+.Vt scsi_hba_tran_t
+structure, which allows the HBA to use the
+.Vt tran_tgt_private
+field in the
+.Vt scsi_hba_tran_t
+structure to point to per-target data.
+The HBA should free only the same
+.Vt scsi_hba_tran_t
+structure allocated when the HBA detaches.
+All cloned
+.Vt scsi_hba_tran_t
structures that are allocated by the system are freed by the system.
-.sp
-.LP
-The flags \fBSCSI_HBA_TRAN_CDB\fR and \fBSCSI_HBA_TRAN_SCB\fR are only valid
-when \fBtran_setup_pkt()\fR is used. See \fBtran_setup_pkt\fR(9E) for
-information on using these flags.
-.sp
-.LP
-The \fBscsi_hba_attach_setup()\fR function attaches
-a number of integer-valued properties to \fIdip\fR, unless properties of the
-same name are already attached to the node. An HBA driver should retrieve these
-configuration parameters via \fBddi_prop_get_int\fR(9F), and respect any
-settings for features provided the HBA.
-.sp
-.ne 2
-.na
-\fB\fBscsi-options\fR\fR
-.ad
-.RS 26n
-\fBOptional\fR \fBSCSI\fR \fBconfiguration bits\fR
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBSCSI_OPTIONS_DR\fR\fR
-.ad
-.RS 26n
+.Pp
+The flags
+.Dv SCSI_HBA_TRAN_CDB
+and
+.Dv SCSI_HBA_TRAN_SCB
+are only valid
+when
+.Fn tran_setup_pkt
+is used.
+See
+.Xr tran_setup_pkt 9E
+for information on using these flags.
+.Pp
+The flag
+.Dv SCSI_HBA_ADDR_COMPLEX
+indicates to the system that this device handles more complex SCSI
+topologies, such as SAS.
+When this flag is set, the
+.Xr scsi_address 9S
+structure becomes opaque.
+The driver must not check it for the traditional target and LUN values.
+Instead, a target and LUN are identified by a unit address which can be
+retrieved using the
+.Xr scsi_device_unit_address 9F
+function.
+.Pp
+When operating with the flag
+.Dv SCSI_HBA_ADDR COMPLEX ,
+the driver may associate private data with the
+.Xr scsi_device 9S
+structure.
+This obviates the need and complexity around using
+.Dv SCSI_HBA_TRAN_CLONE
+flag.
+To get and set private data, the driver can use the
+.Xr scsi_device_hba_private_get 9F
+and
+.Xr scsi_device_hba_private_set 9F
+functions.
+Notably, the
+.Fn scsi_device_hba_private_set
+function should be used during the
+.Xr tran_tgt_init 9E
+entry point.
+The
+.Fn scsi_device_hba_private_get
+function should then be used during other SCSI HBA entry points.
+In addition, the
+.Xr scsi_address_device 9F
+function now becomes available to the driver to map between the
+.Xr scsi_device 9S
+and
+.Xr scsi_address 9S
+structures.
+.Pp
+The
+.Dv SCSI_HBA_HBA
+flag indicates that the HBA driver will only enumerate direct children
+which are
+.Xr iport 9
+instances.
+This mode of operation is recommended for device drivers as
+it simplifies the management of discovered devices.
+This flag is often used in tandem with
+.Dv SCSI_HBA_ADDR_COMPLEX
+and is recommended for all new SAS-based HBA drivers.
+For more information on the management of iports and the use of target
+maps, please see
+.Xr iport 9 .
+.Pp
+The
+.Fn scsi_hba_attach_setup
+function attaches a number of integer-valued properties to
+.Fa dip ,
+unless properties of the same name are already attached to the node.
+An HBA driver should retrieve these configuration parameters via
+.Xr ddi_prop_get_int 9F ,
+and respect any settings for features provided the HBA.
+.Bl -tag -width Sy
+.It Sy scsi-options
+.Sy Optional SCSI configuration bits .
+The following values may be bitwise-inclusive-ORed together.
+.Bl -tag -width Dv
+.It Dv SCSI_OPTIONS_DR
If not set, the HBA should not grant Disconnect privileges to target devices.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBSCSI_OPTIONS_TAG\fR\fR
-.ad
-.RS 26n
+.It Dv SCSI_OPTIONS_TAG
If not set, the HBA should not operate in Command Tagged Queueing mode.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBSCSI_OPTIONS_PARITY\fR\fR
-.ad
-.RS 26n
+.It Dv SCSI_OPTIONS_PARITY
If not set, the HBA should not operate in parity mode.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBSCSI_OPTIONS_QAS\fR\fR
-.ad
-.RS 26n
+.It Dv SCSI_OPTIONS_QAS
If not set, the HBA should not make use of the Quick Arbitration Select
-feature. Consult your Sun hardware documentation to determine whether your
+feature.
+Consult your hardware documentation to determine whether your
machine supports QAS.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBSCSI_OPTIONS_FAST\fR\fR
-.ad
-.RS 26n
+.It Dv SCSI_OPTIONS_FAST
If not set, the HBA should not operate the bus in FAST SCSI mode.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBSCSI_OPTIONS_FAST20\fR\fR
-.ad
-.RS 26n
+.It Dv SCSI_OPTIONS_FAST20
If not set, the HBA should not operate the bus in FAST20 SCSI mode.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBSCSI_OPTIONS_FAST40\fR\fR
-.ad
-.RS 26n
+.It Dv SCSI_OPTIONS_FAST40
If not set, the HBA should not operate the bus in FAST40 SCSI mode.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBSCSI_OPTIONS_FAST80\fR\fR
-.ad
-.RS 26n
+.It Dv SCSI_OPTIONS_FAST80
If not set, the HBA should not operate the bus in FAST80 SCSI mode.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBSCSI_OPTIONS_FAST160\fR\fR
-.ad
-.RS 26n
+.It Dv SCSI_OPTIONS_FAST160
If not set, the HBA should not operate the bus in FAST160 SCSI mode.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBSCSI_OPTIONS_FAST320\fR\fR
-.ad
-.RS 26n
+.It Dv SCSI_OPTIONS_FAST320
If not set, the HBA should not operate the bus in FAST320 SCSI mode.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBSCSI_OPTIONS_WIDE\fR\fR
-.ad
-.RS 26n
+.It Dv SCSI_OPTIONS_WIDE
If not set, the HBA should not operate the bus in WIDE SCSI mode.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBSCSI_OPTIONS_SYNC\fR\fR
-.ad
-.RS 26n
+.It Dv SCSI_OPTIONS_SYNC
If not set, the HBA should not operate the bus in synchronous transfer mode.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBscsi-reset-delay\fR\fR
-.ad
-.RS 26n
+.El
+.It Sy scsi-reset-delay
SCSI bus or device reset recovery time, in milliseconds.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBscsi-selection-timeout\fR\fR
-.ad
-.RS 26n
-Default SCSI selection phase timeout value, in milliseconds. Please refer to
-individual HBA man pages for any HBA-specific information
-.RE
-
-.SS "scsi_hba_detach(\|)"
-.sp
-.LP
-The \fBscsi_hba_detach()\fR function removes the reference to the DMA
-attributes structure and the transport vector for the given instance of an HBA
-driver.
-.SH RETURN VALUES
-.sp
-.LP
-The \fBscsi_hba_attach_setup()\fR and
-\fBscsi_hba_detach()\fR functions return \fBDDI_SUCCESS\fR if the function call
-succeeds, and return \fBDDI_FAILURE\fR on failure.
-.SH CONTEXT
-.sp
-.LP
-The \fBscsi_hba_attach_setup()\fR function should
-be called from \fBattach\fR(9E). The \fBscsi_hba_detach()\fR function should be
-called from \fBdetach\fR(9E).
-.SH SEE ALSO
-.sp
-.LP
-\fBattach\fR(9E), \fBdetach\fR(9E), \fBtran_setup_pkt\fR(9E),
-\fBtran_tgt_init\fR(9E), \fBddi_prop_get_int\fR(9F), \fBddi_dma_attr\fR(9S),
-\fBdev_ops\fR(9S), \fBscsi_address\fR(9S),
-\fBscsi_hba_tran\fR(9S)
-.sp
-.LP
-\fIWriting Device Drivers\fR
-.SH NOTES
-.sp
-.LP
+.It Sy scsi-selection-timeout
+Default SCSI selection phase timeout value, in milliseconds.
+Please refer to individual HBA man pages for any HBA-specific
+information
+.El
+.Ss Fn scsi_hba_detach
+The
+.Fn scsi_hba_detach
+function removes the reference to the DMA attributes structure and the
+transport vector for the given instance of an HBA driver.
+.Sh CONTEXT
+The
+.Fn scsi_hba_attach_setup
+function should be called from
+.Xr attach 9E .
+The
+.Fn scsi_hba_detach
+function should be called from
+.Xr detach 9E .
+.Sh RETURN VALUES
+The
+.Fn scsi_hba_attach_setup
+and
+.Fn scsi_hba_detach
+functions return
+.Dv DDI_SUCCESS
+if the function call succeeds, and return
+.Dv DDI_FAILURE
+on failure.
+.Sh SEE ALSO
+.Xr iport 9 ,
+.Xr attach 9E ,
+.Xr detach 9E ,
+.Xr tran_setup_pkt 9E ,
+.Xr tran_tgt_init 9E ,
+.Xr ddi_prop_get_int 9F ,
+.Xr scsi_address_device 9F ,
+.Xr scsi_device_hba_private_get 9F ,
+.Xr scsi_device_hba_private_set 9F ,
+.Xr scsi_device_unit_address 9F ,
+.Xr ddi_dma_attr 9S ,
+.Xr dev_ops 9S ,
+.Xr scsi_address 9S ,
+.Xr scsi_device 9S ,
+.Xr scsi_hba_tran 9S
+.Pp
+.Rs
+.%T Writing Device Drivers
+.Re
+.Sh NOTES
It is the HBA driver's responsibility to ensure that no more transport requests
will be taken on behalf of any SCSI target device driver after
-\fBscsi_hba_detach()\fR is called.
+.Fn scsi_hba_detach
+is called.
diff --git a/usr/src/man/man9f/scsi_hba_iport_exist.9f b/usr/src/man/man9f/scsi_hba_iport_exist.9f
new file mode 100644
index 0000000000..2f059bc1a7
--- /dev/null
+++ b/usr/src/man/man9f/scsi_hba_iport_exist.9f
@@ -0,0 +1,98 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright (c) 2017, Joyent, Inc.
+.\"
+.Dd Apr 18, 2017
+.Dt SCSI_HBA_IPORT_EXIST 9F
+.Os
+.Sh NAME
+.Nm scsi_hba_iport_exist ,
+.Nm scsi_hba_iport_find
+.Nd find and check if an iport exists
+.Sh SYNOPSIS
+.In sys/scsi/scsi.h
+.Ft int
+.Fo scsi_hba_iport_exist
+.Fa "dev_info_t *dip"
+.Fc
+.Ft "dev_info_t *"
+.Fo scsi_hba_iport_find
+.Fa "dev_info_t *dip"
+.Fa "char *ua"
+.Fc
+.Sh INTERFACE LEVEL
+.Sy Evolving -
+This interface is still evolving in illumos.
+API and ABI stability is not guaranteed.
+.Sh PARAMETERS
+.Bl -tag -width Fa
+.It Fa dip
+Pointer to
+.Vt dev_info
+structure.
+.It Fa ua
+The unit address of the iport being searched for.
+.El
+.Sh DESCRIPTION
+The
+.Fn scsi_hba_iport_exists
+function is used to determine whether or not
+.Fa dip
+has any child devices that are iports which have been added through
+.Xr scsi_hba_iport_register 9F
+or
+.Xr scsi_hba_iportmap_iport_add 9F .
+For more information on iports, see
+.Xr iport 9 .
+.Pp
+The
+.Fn scsi_hba_iport_find
+function attempts to find a child iport and return its
+.Vt dev_info
+structure if it exists.
+The iport is searched for by its unit address, which is passed in the
+.Fa ua
+argument.
+The unit address for an iport is established when the iport is created.
+.Sh CONTEXT
+The
+.Fn scsi_hba_iport_exist
+and
+.Fn scsi_hba_iport_find
+functions may be called in either
+.Sy user
+or
+.Sy kernel
+context.
+.Sh RETURN VALUES
+The
+.Fn scsi_hba_iport_exists
+function returns
+.Sy 1
+when there is a child iport of
+.Fa dip .
+Otherwise, it returns
+.Sy 0.
+.Pp
+The
+.Fn scsi_hba_iport_find
+function returns a pointer to the iport's
+.Vt dev_info
+structure, if found.
+Otherwise,
+.Dv NULL
+is returned.
+.Sh SEE ALSO
+.Xr iport 9 ,
+.Xr iportmap 9 ,
+.Xr scsi_hba_iport_register 9F ,
+.Xr scsi_hba_iportmap_iport_add 9F
diff --git a/usr/src/man/man9f/scsi_hba_iport_register.9f b/usr/src/man/man9f/scsi_hba_iport_register.9f
new file mode 100644
index 0000000000..085c88f3a0
--- /dev/null
+++ b/usr/src/man/man9f/scsi_hba_iport_register.9f
@@ -0,0 +1,88 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright (c) 2017, Joyent, Inc.
+.\"
+.Dd Apr 18, 2017
+.Dt SCSI_HBA_IPORT_REGISTER 9F
+.Os
+.Sh NAME
+.Nm scsi_hba_iport_register
+.Nd register a new iport
+.Sh SYNOPSIS
+.In sys/scsi/scsi.h
+.Ft int
+.Fo scsi_hba_iport_register
+.Fa "dev_info_t *dip"
+.Fa "char *port"
+.Fc
+.Sh INTERFACE LEVEL
+.Sy Evolving -
+This interface is still evolving in illumos.
+API and ABI stability is
+not guaranteed.
+.Sh PARAMETERS
+.Bl -tag -width Fa
+.It Fa dip
+Pointer to
+.Vt dev_info
+structure.
+.It Fa port
+The name of the iport to add.
+.El
+.Sh DESCRIPTION
+The
+.Fn scsi_hba_iport_register
+function is used to create a new iport.
+For more information on iports and their uses, see
+.Xr iport 9 .
+This interface is generally used then there are a fixed, static set of
+iports that exist in the system.
+If the set of iports is dynamic or related to phys coming online and
+offline, then the driver should instead consider using the
+.Xr iportmap 9
+abstraction.
+.Pp
+The iport will be created as a child of the device represented by
+.Fa dip .
+The iport will be bound to the same driver.
+To distinguish nodes, the driver should use the
+.Xr scsi_hba_iport_unit_address 9F
+function.
+.Pp
+The name of the iport, specified by
+.Fa port ,
+must be unique for a given parent.
+The iport will not be created if the name is already in use.
+While names generally are based on unit addresses, they may be synthetic
+names.
+.Sh CONTEXT
+The
+.Fn scsi_hba_iport_register
+function is generally called during the
+.Xr attach 9E
+entry point and may be called from
+.Sy user
+or
+.Sy kernel
+context.
+.Sh RETURN VALUES
+Upon successful completion, the
+.Fn scsi_hba_iport_register
+function returns
+.Dv DDI_SUCCESS .
+Otherwise,
+.Dv DDI_FAILURE
+is returned.
+.Sh SEE ALSO
+.Xr iport 9 ,
+.Xr iportmap 9 ,
+.Xr scsi_hba_iportmap_iport_add 9F
diff --git a/usr/src/man/man9f/scsi_hba_iport_unit_address.9f b/usr/src/man/man9f/scsi_hba_iport_unit_address.9f
new file mode 100644
index 0000000000..94b11d84c2
--- /dev/null
+++ b/usr/src/man/man9f/scsi_hba_iport_unit_address.9f
@@ -0,0 +1,74 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright (c) 2017, Joyent, Inc.
+.\"
+.Dd Apr 18, 2017
+.Dt SCSI_HBA_IPORT_UNIT_ADDRESS 9F
+.Os
+.Sh NAME
+.Nm scsi_hba_iport_unit_address
+.Nd Get the unit address of an iport
+.Sh SYNOPSIS
+.In sys/scsi/scsi.h
+.Ft "char *"
+.Fo scsi_hba_iport_unit_address
+.Fa "dev_info_t *dip"
+.Fc
+.Sh INTERFACE LEVEL
+.Sy Evolving -
+This interface is still evolving in illumos.
+API and ABI stability is
+not guaranteed.
+.Sh PARAMETERS
+.Bl -tag -width Fa
+.It Fa dip
+Pointer to
+.Vt dev_info
+structure.
+.El
+.Sh DESCRIPTION
+The
+.Fn scsi_hba_iport_unit_address
+function is used to obtain the unit address of an iport.
+For more information on iports, see
+.Xr iport 9 .
+.Pp
+This function can be used to determine whether or not a device node in
+the tree is an iport.
+If the device node corresponds to an iport, then
+the unit address used when it was created either through
+.Xr scsi_hba_iport_register 9F
+or
+.Xr scsi_hba_iportmap_iport_add 9F
+will be returned.
+.Sh CONTEXT
+The
+.Fn scsi_hba_iport_unit_address
+function may be called in
+.Sy user ,
+.Sy kernel ,
+or
+.Sy interrupt
+context.
+.Sh RETURN VALUES
+If
+.Fa dip
+is an iport, then the unit address string the device was registered with
+is returned.
+Otherwise,
+.Dv NULL
+is returned.
+.Sh SEE ALSO
+.Xr iport 9 ,
+.Xr iportmap 9 ,
+.Xr scsi_hba_iport_register 9F ,
+.Xr scsi_hba_iportmap_iport_add 9F
diff --git a/usr/src/man/man9f/scsi_hba_iportmap_create.9f b/usr/src/man/man9f/scsi_hba_iportmap_create.9f
new file mode 100644
index 0000000000..8c7e127160
--- /dev/null
+++ b/usr/src/man/man9f/scsi_hba_iportmap_create.9f
@@ -0,0 +1,179 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright (c) 2017, Joyent, Inc.
+.\"
+.Dd Apr 18, 2017
+.Dt SCSI_HBA_IPORTMAP_CREATE 9F
+.Os
+.Sh NAME
+.Nm scsi_hba_iportmap_create ,
+.Nm scsi_hba_iportmap_destroy ,
+.Nm scsi_hba_iportmap_iport_add ,
+.Nm scsi_hba_iportmap_iport_remove
+.Nd create and manage an iportmap
+.Sh SYNOPSIS
+.In sys/scsi/scsi.h
+.Ft int
+.Fo scsi_hba_iportmap_create
+.Fa "dev_info_t *dip"
+.Fa "int csync_usec"
+.Fa "int settle_usec"
+.Fa "scsi_hba_iportmap_t **iportmapout"
+.Fc
+.Ft void
+.Fo scsi_hba_iportmap_destroy
+.Fa "scsi_hba_iportmap_t *iportmap"
+.Fc
+.Ft int
+.Fo scsi_hba_iportmap_iport_add
+.Fa "scsi_hba_iportmap_t *iportmap"
+.Fa "char *ua"
+.Fa "void *priv"
+.Fc
+.Ft int
+.Fo scsi_hba_iportmap_iport_remove
+.Fa "scsi_hba_iportmap_t *iportmap"
+.Fa "char *ua"
+.Fc
+.Sh INTERFACE LEVEL
+.Sy Evolving -
+This interface is still evolving in illumos.
+API and ABI stability is not guaranteed.
+.Sh PARAMETERS
+.Bl -tag -width Fa
+.It Fa dip
+Pointer to
+.Vt dev_info
+structure.
+.It Fa csync_usec
+A time in microseconds.
+.It Fa settle_usec
+A time in microseconds.
+.It Fa iportmap
+An allocated iportmap.
+.It Fa iportmapout
+Pointer where the iportmap is stored.
+.It Fa ua
+A character string that represents a unit address for an iport.
+.It Fa priv
+Drivers should pass
+.Dv NULL
+for this field.
+.El
+.Sh DESCRIPTION
+The
+.Fn scsi_hba_iportmap_create
+and
+.Fn scsi_hba_iportmap_destroy
+functions are used by HBA drivers to create and destroy an iportmap.
+For more information on an iportmap and its purpose, see
+.Xr iportmap 9 .
+.Pp
+The
+.Fa csync_usec
+and
+.Fa settle_usec
+are both times measured in microseconds that control two different
+properties of the iportmap and how it behaves.
+The value in
+.Fa settle_usec
+indicates the amount of time that the system should wait to quiesce all
+changes and consider the resulting system stable.
+Changes will not be reported until after
+.Fa settle_usec
+have passed.
+.Fa csync_usec
+indicates how much time needs to elapse after creation before an initial
+enumeration has been completed.
+.Pp
+The
+.Vt dev_info
+structure passed into
+.Fa dip
+is usually the HBA driver's
+.Vt dev_info
+structure.
+.Pp
+When the
+.Fn scsi_hba_iportmap_iport
+function returns,
+.Fa iportmapout
+will be populated with a pointer to an iportmap that can be used to add
+and remove iports.
+.Pp
+To destroy the iportmap, drivers should use the
+.Fn scsi_hba_iportmap_destroy
+function.
+As part of destroying the iportmap, all associated iports will
+be detached from the system by having the driver's
+.Xr detach 9E
+entry point called.
+.Pp
+When the driver needs to add an iport to the system, generally in
+response to a hotplug event, then the driver should call the
+.Fn scsi_hba_iportmap_iport_add
+function.
+The value of
+.Fa ua
+should be a character string that uniquely identifies the device.
+If the driver is using a phymap, then this unit address should be the
+same one as the phymap's callback provided.
+Otherwise, the driver sets
+.Fa ua
+to a unique string which is generally the iport's WWN.
+.Pp
+When the corresponding iport needs to be removed, then the driver should
+call the
+.Fn scsi_hba_iportmap_remove
+function.
+The iport to remove is indicated by the
+.Fa ua
+argument, which should match the value passed into the
+.Fn scsi_hba_iportmap_add
+function.
+.Sh CONTEXT
+The
+.Fn scsi_hba_iportmap_create
+function is generally called during a driver's
+.Xr attach 9E
+entry point.
+.Pp
+The
+.Fn scsi_hba_iportmap_destroy
+function is generally called during a driver's
+.Xr detach 9E
+entry point.
+.Pp
+The
+.Fn scsi_hba_iportmap_iport_add
+and
+.Fn scsi_hba_iportmap_iport_remove
+functions should be called from
+.Sy kernel
+context.
+.Sh RETURN VALUES
+Upon successful completion, the
+.Fn scsi_hba_iportmap_create ,
+.Fn scsi_hba_iportmap_iport_add ,
+and
+.Fn scsi_hba_iportmap_iport_remove
+functions return
+.Dv DDI_SUCCESS.
+Otherwise,
+.Dv DDI_FAILURE
+is returned.
+.Sh SEE ALSO
+.Xr iport 9 ,
+.Xr iportmap 9 ,
+.Xr attach 9E ,
+.Xr detach 9E ,
+.Xr detach 9E
diff --git a/usr/src/man/man9f/scsi_hba_tgtmap_create.9f b/usr/src/man/man9f/scsi_hba_tgtmap_create.9f
new file mode 100644
index 0000000000..3f5a393cf1
--- /dev/null
+++ b/usr/src/man/man9f/scsi_hba_tgtmap_create.9f
@@ -0,0 +1,489 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright (c) 2017, Joyent, Inc.
+.\"
+.Dd Apr 18, 2017
+.Dt SCSI_HBA_TGTMAP_CREATE 9F
+.Os
+.Sh NAME
+.Nm scsi_hba_tgtmap_create ,
+.Nm scsi_hba_tgtmap_destroy ,
+.Nm scsi_hba_tgtmap_set_begin ,
+.Nm scsi_hba_tgtmap_set_add ,
+.Nm scsi_hba_tgtmap_set_end ,
+.Nm scsi_hba_tgtmap_set_flush ,
+.Nm scsi_hba_tgtmap_tgt_add ,
+.Nm scsi_hba_tgtmap_tgt_remove
+.Nd SCSI target map functions
+.Sh SYNOPSIS
+.In sys/scsi/scsi.h
+.Ft int
+.Fo scsi_hba_tgtmap_create
+.Fa "dev_info_t *dip"
+.Fa "scsi_tgtmap_mode_t mode"
+.Fa "int csync_usec"
+.Fa "int settle_usec"
+.Fa "void *tgtmap_priv"
+.Fa "scsi_tgt_activate_cb_t activate_cb"
+.Fa "scsi_tgt_deactivate_cb_t deactivate_cb"
+.Fa "scsi_hba_tgtmap_t *tgtmapout"
+.Fc
+.Ft void
+.Fo scsi_hba_tgtmap_destroy
+.Fa "scsi_hba_tgtmap_t *tgtmap"
+.Fc
+.Ft void
+.Fo (*scsi_tgt_activate_cb_t)
+.Fa "void *tgtmap_priv"
+.Fa "char *tgt_addr"
+.Fa "scsi_tgtmap_tgt_type_t type"
+.Fa "void **tgt_privp"
+.Fc
+.Ft boolean_t
+.Fo (*scsi_tgt_deactivate_cb_t)
+.Fa "void *tgtmap_priv"
+.Fa "char *tgt_addr"
+.Fa "scsi_tgtmap_tgt_type_t type"
+.Fa "void *tgt_priv"
+.Fa "scsi_tgtmap_deact_rsn_t deact"
+.Fc
+.Ft int
+.Fo scsi_hba_tgtmap_set_begin
+.Fa "scsi_hba_tgtmap_t *map"
+.Fc
+.Ft int
+.Fo scsi_hba_tgtmap_set_add
+.Fa "scsi_hba_tgtmap_t *tgtmap"
+.Fa "scsi_tgtmap_tgt_type_t type"
+.Fa "char *tgt_addr"
+.Fa "void *tgt_priv"
+.Fc
+.Ft int
+.Fo scsi_hba_tgtmap_set_end
+.Fa "scsi_hba_tgtmap_t *map"
+.Fc
+.Ft int
+.Fo scsi_hba_tgtmap_set_flush
+.Fa "scsi_hba_tgtmap_t *map"
+.Fc
+.Ft int
+.Fo scsi_hba_tgtmap_tgt_add
+.Fa "scsi_hba_tgtmap_t *tgtmap"
+.Fa "scsi_tgtmap_tgt_type_t type"
+.Fa "char *tgt_addr"
+.Fa "void *tgt_priv"
+.Fc
+.Ft int
+.Fo scsi_hba_tgtmap_tgt_remove
+.Fa "scsi_hba_tgtmap_t *tgtmap"
+.Fa "scsi_tgtmap_tgt_type_t type"
+.Fa "char *tgt_addr"
+.Fc
+.Sh INTERFACE LEVEL
+.Sy Evolving -
+This interface is still evolving in illumos.
+API and ABI stability is
+not guaranteed.
+.Sh PARAMETERS
+.Bl -tag -width Fa
+.It Fa dip
+Pointer to
+.Vt dev_info
+structure.
+.It Fa mode
+One of the following values:
+.Bl -tag -width Dv
+.It Dv SCSI_TM_FULLSET
+The target map operates by full-set reporting.
+.It Dv SCSI_TM_PERADDR
+The target map operates by per-address reporting.
+.El
+.It Fa csync_usec
+A time in microseconds.
+.It Fa settle_usec
+A time in microseconds.
+.It Fa tgtmap_priv
+A private value to be passed to callback functions.
+.It Fa activate_cb
+An optional callback that will be called when a new device is being
+added to the system.
+.It Fa deactivate_cb
+An optional callback that will be called when an existing devices is
+removed from the system.
+.It Fa tgtmapout
+Pointer where the target map is stored.
+.It Fa tgtmap
+Pointer to an allocated target map.
+.It Fa tgt_addr
+The address of the target map entry the callback is acting upon.
+.It Fa type
+One of the following values, indicating the type of the target:
+.Bl -tag -width Dv
+.It Dv SCSI_TGT_SCSI_DEVICE
+The target is some form of SCSI device such as a parallel SCSI, SATA,
+SAS, SES, etc.
+.It Dv SCSI_TGT_SMP_DEVICE
+The target is a SCSI Management Protocol device.
+.El
+.It Fa deact
+One of the following values, indicating why the target is being removed:
+.Bl -tag -width Dv
+.It Dv SCSI_TGT_DEACT_RSN_GONE
+The device is being deactivated because it is gone.
+.It Dv SCSI_TGT_DEACT_RSN_CFG_FAIL
+The device is being deactivated because the configuration callback
+failed.
+.It Dv SCSI_TGT_DEACT_RSN_UNSTBL
+The device is being deactivated because it was added and removed during
+the stabilization period and therefore is considered unstable.
+.El
+.El
+.Sh DESCRIPTION
+The
+.Fn scsi_hba_tgtmap_create
+and
+.Fn scsi_hba_tgtmap_destroy
+functions are used to create and destroy target maps.
+A target map is used to manage SCSI and SMP (SCSI Management Protocol)
+devices.
+For more background on target maps, see
+.Xr tgtmap 9 .
+.Pp
+To create a target map, the driver should call the
+.Fn scsi_hba_tgtmap_create
+function.
+Upon successful completion, a pointer to the target map will be placed
+in the
+.Fa tgtmapout
+argument.
+.Pp
+The
+.Fa dip
+argument should correspond to the HBA driver's device node or one of its
+iports.
+.Pp
+The
+.Fa mode
+argument describes how addresses are reported into the target map and
+the functions used to add and remove devices.
+If
+.Fa mode
+is
+.Dv SCSI_TM_FULLSET
+then the driver must always report all the devices that are in the set
+and will be told when the corresponding devices have been removed.
+See
+the section
+.Sx Full-Set Reporting
+for more information.
+.Pp
+Otherwise, the driver should set the
+.Fa mode
+argument to
+.Dv SCSI_TM_PERADDR
+and use the
+.Fn scsi_hba_tgtmap_tgt_add
+and
+.Fn scsi_hba_tgtmap_tgt_destroy
+functions.
+See the section
+.Sx Per-Address Reporting
+for more information.
+.Pp
+The
+.Fa csync_usec
+and
+.Fa settle_usec
+are both times measured in microseconds that control two different
+properties of the target map and how it behaves.
+The value in
+.Fa settle_usec
+indicates the amount of time that the system should wait to quiesce all
+changes and consider the resulting system stable.
+Changes will not be reported until after
+.Fa settle_usec
+have passed.
+.Fa csync_usec
+indicates how much time needs to elapse after creation before an initial
+enumeration has been completed.
+.Pp
+The
+.Fa activate_cb
+and
+.Fa deactivate_cb
+arguments are optional function pointers that will be run in the context
+of devices being added and removed from the system.
+This allows the HBA driver to perform any required operations prior to
+the system attaching a target driver such as
+.Xr sd 7D
+or
+.Xr ses 7D
+in the activate case and after the system has detached the driver, in
+the removal case.
+.Pp
+To destroy a target map, a caller should use the
+.Fn scsi_hba_tgtmap_destroy
+function.
+Destroying a target map causes all currently present devices
+to be deactivated, as though they were removed, prior to the
+final destruction of the target map.
+.Ss Callbacks
+Target maps allow for callbacks to be registered and called when
+devices are being added and removed from the system.
+A driver specifies these when the target map is created by passing in
+function pointers to
+the
+.Fn activate_cb
+and
+.Fn deactivate_cb
+arguments.
+.Pp
+When a new address is registered in a target map and the driver has
+specified a function in the
+.Fa activate_cb
+argument, the driver will eventually have their activation function
+called.
+This call will be asynchronous with respect to the adding and
+removing of entries, regardless of whether the target map is using
+per-address or full-set reporting.
+This call will occur before any driver is bound to the discovered
+address.
+.Pp
+The
+.Fa tgtmap_priv
+argument will point to the optional, private argument that was passed
+to the
+.Fn scsi_hba_tgtmap_create
+function when the target map was created.
+The
+.Fa tgt_addr
+and
+.Fa tgt_type
+will describe the address and type of the new device and will correspond
+with the values passed into either the
+.Fn scsi_hba_tgtmap_set_add
+or
+.Fn scsi_hba_tgtmap_tgt_add
+functions.
+.Pp
+The
+.Fa tgt_privp
+argument is a modifiable private value.
+Initially,
+.Fa tgt_privp
+points to the value passed in as
+.Fa tgt_priv
+to either the
+.Fn scsi_hba_tgtmap_set_add
+or
+.Fn scsi_hba_tgtmap_tgt_add
+functions.
+The driver may change the value as needed.
+It will receive the value stored in
+.Fa tgt_privp
+during the deactivate callback.
+.Pp
+When a target map has been updated to indicate that a device has been
+removed, then the driver will receive a deactivation callback if it
+registered one.
+The deactivate callback will occur after a driver has
+been detached from the corresponding device.
+.Pp
+The
+.Fa tgtmap_priv ,
+.Fa tgt_addr ,
+and
+.Fa type
+arguments to the callback function are the same as for the activate
+case.
+The
+.Fa tgt_priv
+pointer will be set to the value that was passed when the device was
+added and will reflect any updates made during an activate callback, if
+present.
+.Pp
+The
+.Fa deact
+argument gives the driver some amount of information as to why device
+was being removed.
+The deactivation reason provides the driver
+more information about why the address was being removed from the target
+map which can be useful in the cases that it itself did not issue it.
+.Pp
+The return value indicates whether or not some amount of rediscovery of
+the address is desired or not.
+This is only meaningful in the case where the
+.Fa deact
+argument was
+.Dv SCSI_TGT_DEACT_RSN_CFG_FAIL .
+If the driver does wish to attempt rediscovery, then it should return
+.Dv B_TRUE .
+Otherwise, the driver should return
+.Dv B_FALSE .
+If in doubt, use the return value
+.Dv B_FALSE .
+Note, even if the driver returns
+.Dv B_TRUE ,
+no action may be taken by the system.
+.Ss Full-Set Reporting
+Full-Set reporting is one way of managing a target map.
+In full-set reporting, whenever an update is being made, the entire data
+set is reported to the target map.
+The target map then determines which
+addresses are new, which have been removed, and which have stayed the
+same and updates the system state appropriately.
+If devices have been added or removed from the system, then any activate
+and deactivate endpoints will be called.
+.Pp
+To begin a new report, the driver should call the
+.Fn scsi_hba_tgtmap_set_begin
+function.
+Once the report has begun, the driver should add devices by calling the
+.Fn scsi_hba_tgtmap_set_add
+function.
+Once all devices have been added, the driver should call the
+.Fn scsi_hba_tgtmap_set_end
+function to indicate that the target map processing has ended.
+If driver wishes to discard a report that has begun, but not yet
+terminated, then the driver should call the
+.Fn scsi_hba_tgtmap_set_flush
+function.
+.Pp
+When adding entries, the driver should indicate the address of the
+device in
+.Fa tgt_addr .
+This will generally be a world wide number (WWN) in a unit-addressable
+form.
+However, the driver may use its own synthetic numbering.
+This address will be passed to the activate callbacks and will also be
+used as the address of the
+.Xr scsi_device 9S
+in the
+.Xr tran_start 9E
+entry point.
+.Pp
+The
+.Fa type
+argument indicates how the kernel will interpret the type of device.
+At this time, devices are broken into two broad categories.
+Things which are some kind of SCSI device, whether parallel, SCSI, SATA
+behind a SATL, SES, etc. should use the type
+.Dv SCSI_TGT_SCSI_DEVICE .
+The other group,
+.Dv SCSI_TGT_SMP_DEVICE ,
+is for SCSI Management Protocol (SMP) devices.
+.Pp
+The
+.Fa tgt_priv
+argument will be passed to the activate and deactivate callbacks,
+allowing the driver to pass around data corresponding to this address.
+.Ss Per-Address Reporting
+When using a target map with per-address reporting, the driver is
+responsible for indicating what devices have been added and removed.
+This is useful for various hardware configurations where all entries and
+removals are processes in a highly-reliable fashion where hardware
+cannot drop entries.
+.Pp
+To add a new device, the driver should call the
+.Fa scsi_hba_tgtmap_tgt_add
+function.
+The
+.Fa tgt_addr
+and
+.Fa type
+arguments describe the address and what kind of device the address
+corresponds to.
+For more information, see the previous section,
+.Sx Full-Address Reporting .
+The
+.Fa tgt_priv
+argument will be passed along to the activate and deactivate functions,
+allowing the driver to associate a value with the address in question.
+.Pp
+When a device has been removed, the driver should call the
+.Fn scsi_hba_tgtmap_tgt_remove
+function, ensuring that both the
+.Fa tgt_addr
+and
+.Fa type
+arguments match those that were used when calling the
+.Fn scsi_hba_tgtmap_tgt_add
+function.
+.Sh CONTEXT
+The
+.Fn scsi_hba_tgtmap_create
+and
+.Fn scsi_hba_tgtmap_destroy
+functions are generally called from the context of the
+.Xr attach 9E
+and
+.Xr detach 9E
+entry points of HBA drivers and their iports, though may also be called
+from
+.Sy user
+or
+.Sy kernel
+context.
+.Pp
+The optional
+.Fn activate_cb
+and
+.Fn deactivate_cb
+functions for a target map will be called into the driver from
+.Sy kernel
+context.
+.Pp
+The
+.Fn scsi_hba_tgtmap_set_begin ,
+.Fn scsi_hba_tgtmap_set_add ,
+.Fn scsi_hba_tgtmap_set_end ,
+.Fn scsi_hba_tgtmap_set_flush ,
+.Fn scsi_hba_tgtmap_tgt_add ,
+and
+.Fn scsi_hba_tgtmap_tgt_remove
+functions may be called from
+.Sy user
+or
+.Sy kernel
+context.
+It is recommended that device drivers do not call these functions from
+.Sy interrupt
+context and instead should schedule deferred work with a task queue
+or with
+.Xr timeout 9F
+if they receive notifications during an interrupt that causes them to
+need to call these functions.
+.Sh RETURN VALUES
+Upon successful completion, the
+.Fn scsi_hba_tgtmap_create ,
+.Fn scsi_hba_tgtmap_destroy ,
+.Fn scsi_hba_tgtmap_set_begin ,
+.Fn scsi_hba_tgtmap_set_add ,
+.Fn scsi_hba_tgtmap_set_end ,
+.Fn scsi_hba_tgtmap_set_flush ,
+.Fn scsi_hba_tgtmap_tgt_add ,
+and
+.Fn scsi_hba_tgtmap_tgt_remove
+functions return
+.Dv DDI_SUCCESS .
+Otherwise,
+.Dv DDI_FAILURE
+is returned.
+.Sh SEE ALSO
+.Xr sd 7D ,
+.Xr ses 7D ,
+.Xr tgtmap 9 ,
+.Xr attach 9E ,
+.Xr detach 9E ,
+.Xr tran_start 9E ,
+.Xr timeout 9F ,
+.Xr scsi_device 9S
diff --git a/usr/src/man/man9f/scsi_wwnstr_to_wwn.9f b/usr/src/man/man9f/scsi_wwnstr_to_wwn.9f
new file mode 100644
index 0000000000..3ff8694050
--- /dev/null
+++ b/usr/src/man/man9f/scsi_wwnstr_to_wwn.9f
@@ -0,0 +1,169 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright (c) 2017, Joyent, Inc.
+.\"
+.Dd Feb 28, 2017
+.Dt SCSI_WWNSTR_TO_WWN 9F
+.Os
+.Sh NAME
+.Nm scsi_wwnstr_to_wwn ,
+.Nm scsi_wwn_to_wwnstr ,
+.Nm scsi_free_wwnstr
+.Nd SCSI World Wide Name string conversion functions
+.Sh SYNOPSIS
+.In sys/scsi/scsi.h
+.Ft int
+.Fo scsi_wwnstr_to_wwn
+.Fa "const char *wwwnstr"
+.Fa "uint64_t *wwnp"
+.Fc
+.Ft "char *"
+.Fo scsi_wwn_to_wwnstr
+.Fa "uint64_t wwn"
+.Fa "int ua_form"
+.Fa "char *wwnstr"
+.Fc
+.Ft void
+.Fo scsi_free_wwnstr
+.Fa "char *wwnstr"
+.Fc
+.Sh INTERFACE LEVEL
+.Sy Evolving -
+This interface is still evolving in illumos.
+API and ABI stability is not guaranteed.
+.Sh PARAMETERS
+.Bl -tag -width Fa
+.It Fa wwn
+A 64-bit world wide number.
+.It Fa wwnstr
+A string representation of a world wide number.
+.It Fa wwnp
+A pointer to a 64-bit value that will store a world wide number.
+.It Fa ua_form
+An integer indicating whether or not the unit address form should be
+used.
+.El
+.Sh DESCRIPTION
+The
+.Fn scsi_wwnstr_to_wwn
+and
+.Fn scsi_wwn_to_wwnstr
+functions convert an 8-byte world wide number to and from a string
+representation.
+.Pp
+World wide numbers are unique identifiers that are used in storage
+technologies, particularly ATA, SAS, and FC.
+The format of a WWN is defined by the IEEE and generally come in 8 and
+16 byte forms.
+These interfaces only operate on the 8 byte forms.
+.Pp
+When the WWN is represented as a string, it is represented as a 16
+character hexadecimal string.
+This character string may either use uppercase or lowercase hexadecimal
+characters.
+The character string may be preceded by a
+.Sq w
+character.
+When this is present, this is called the
+.Em unit-address form .
+If the string is not 16 ASCII character long or 17, when using the
+unit-address form, the string is considered invalid.
+The following macros are provided to help deal with these lengths:
+.Bl -tag -width Dv
+.It Dv SCSI_WWN_STRLEN
+The number of bytes, excluding a terminating nul character, for a world
+wide number to be represented when not in the unit-address form.
+.It Dv SCSI_WWN_UA_STRLEN
+The number of bytes, excluding a terminating nul character, for a world
+wide number to be represented in the unit-address form.
+.It Dv SCSI_WWN_BUFLEN
+A number of bytes that is guaranteed to be sufficient to hold any form
+of a world wide number and a nul terminator.
+.El
+.Pp
+The
+.Fn scsi_wwnstr_to_wwn
+function parses the string form of the WWN
+.Fa wwnstr
+and converts it to a 64-bit representation.
+The string form may either be in unit-address form or not.
+The string must have a nul terminator.
+If the string is successfully parsed, the world wide number is stored in
+.Fa wwnp .
+.Pp
+The
+.Fn scsi_wwn_to_wwnstr
+converts the world wide number in
+.Fa wwn
+into a human-readable string as described above.
+If the
+.Fa ua_form
+is non-zero then the unit-address form is used and a leading
+.Sq w
+is placed.
+.Pp
+If the
+.Fa wwnstr
+argument is supplied by the user, then it must be large enough to
+contain both the string form of the world wide number and a nul
+character.
+The
+.Dv SCSI_WWN_BUFLEN
+macro is recommended.
+It will always ensure that a buffer is large
+enough to hold any supported string representation of a world wide
+number.
+.Pp
+If the
+.Fa wwnstr
+argument is instead
+.Dv NULL ,
+then a character string of sufficient size will be allocated by the
+system.
+Note, this allocation will block until memory is available.
+If memory is allocated in this way, then the caller should free this
+memory with the
+.Fn scsi_free_wwnstr
+function.
+.Sh CONTEXT
+The
+.Fn scsi_wwnstr_to_wwn ,
+.Fn scsi_wwn_to_wwnstr ,
+and
+.Fn scsi_free_wwnstr
+functions may be used in
+.Sy user ,
+.Sy kernel ,
+and
+.Sy interrupt
+context.
+.Sh RETURN VALUES
+Upon successful completion, the
+.Fn scsi_wwnstr_to_wwn
+function returns
+.Dv DDI_SUCCESS
+and fills in
+.Fa wwnp
+with the WWN.
+Otherwise,
+.Dv DDI_FAILURE
+is returned, indicating an invalid argument or a malformed string in
+.Fa wwnstr .
+.Pp
+Upon successful completion, the
+.Fn scsi_wwn_to_wwnstr
+function returns a pointer to the start of the world wide number.
+Otherwise
+.Dv NULL
+is returned to indicate that the conversion failed.
+.Sh SEE ALSO
+.Xr scsi_hba_iport_unit_address 9F
diff --git a/usr/src/man/man9s/scsi_address.9s b/usr/src/man/man9s/scsi_address.9s
index 48b19e85f1..65fc9a017f 100644
--- a/usr/src/man/man9s/scsi_address.9s
+++ b/usr/src/man/man9s/scsi_address.9s
@@ -1,70 +1,111 @@
-'\" te
.\" Copyright (c) 2000, Sun Microsystems, Inc., All Rights Reserved
+.\" Copyright (c) 2017, Joyent, Inc.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH SCSI_ADDRESS 9S "Aug 30, 1995"
-.SH NAME
-scsi_address \- SCSI address structure
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/scsi/scsi.h>
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris architecture specific (Solaris DDI)
-.SH DESCRIPTION
-.sp
-.LP
-A \fBscsi_address\fR structure defines the addressing components for a
-\fBSCSI\fR target device. The address of the target device is separated into
-two components: target number and logical unit number. The two addressing
-components are used to uniquely identify any type of \fBSCSI\fR device;
-however, most devices can be addressed with the target component of the
+.Dd Apr 23, 2017
+.Dt SCSI_ADDRESS 9S
+.Os
+.Sh NAME
+.Nm scsi_address
+.Nd SCSI address structure
+.Sh SYNOPSIS
+.In sys/scsi/scsi.h
+.Sh INTERFACE LEVEL
+illumos architecture specific (illumos DDI)
+.Sh DESCRIPTION
+A
+.Vt scsi_address
+structure defines the addressing components for a
+.Sy SCSI
+target device.
+The address of the target device is separated into two components:
+target number and logical unit number.
+The two addressing components are used to uniquely identify any type of
+.Sy SCSI
+device; however, most devices can be addressed with the target component of the
address.
-.sp
-.LP
+.Pp
In the case where only the target component is used to address the device, the
-logical unit should be set to \fB0\fR. If the \fBSCSI\fR target device
-supports logical units, then the \fBHBA\fR must interpret the logical units
-field of the data structure.
-.sp
-.LP
-The \fBpkt_address\fR member of a \fBscsi_pkt\fR(9S) is initialized by
-\fBscsi_init_pkt\fR(9F).
-.SH STRUCTURE MEMBERS
-.sp
-.in +2
-.nf
+logical unit should be set to
+.Sy 0 . If the
+.Sy SCSI
+target device supports logical units, then the HBA must interpret the
+logical units field of the data structure.
+.Pp
+The
+.Sy pkt_address
+member of a
+.Xr scsi_pkt 9S
+is initialized by
+.Xr scsi_init_pkt 9F .
+.Ss Complex Addressing
+Drivers may set the flag
+.Dv SCSI_HBA_ADDR_COMPLEX
+in the
+.Fa hba_flags
+argument to
+.Xr scsi_hba_attach_setup 9F .
+When the flag is set, this structure must be treated as opaque.
+Instead of storing a traditional target and LUN, the address is treated
+as the string form of a unit address.
+In addition, rather than storing a pointer to the
+.Xr scsi_hba_tran 9S
+structure, the address structure can store any arbitrary pointer through
+the
+.Xr scsi_device_hba_private_get 9F
+and
+.Xr scsi_device_hba_private_set 9F
+functions.
+.Sh STRUCTURE MEMBERS
+.Bd -literal
scsi_hba_tran_t *a_hba_tran; /* Transport vectors for the SCSI bus */
ushort_t a_target; /* SCSI target id */
uchar_t a_lun; /* SCSI logical unit */
-.fi
-.in -2
-
-.sp
-.LP
-\fBa_hba_tran\fR is a pointer to the controlling \fBHBA\fR's transport vector
-structure. The \fBSCSA\fR interface uses this field to pass any transport
-requests from the \fBSCSI\fR target device drivers to the \fBHBA\fR driver.
-.sp
-.LP
-\fBa_target\fR is the target component of the \fBSCSI\fR address.
-.sp
-.LP
-\fBa_lun\fR is the logical unit component of the \fBSCSI\fR address. The
-logical unit is used to further distinguish a \fBSCSI\fR target device that
-supports multiple logical units from one that does not. The \fBmakecom\fR(9F)
-family of functions use the \fBa_lun\fR field to set the logical unit field in
-the \fBSCSI\fR \fBCDB\fR, for compatibility with \fBSCSI-1\fR.
-.SH SEE ALSO
-.sp
-.LP
-\fBmakecom\fR(9F), \fBscsi_init_pkt\fR(9F), \fBscsi_hba_tran\fR(9S),
-\fBscsi_pkt\fR(9S)
-.sp
-.LP
-\fIWriting Device Drivers\fR
+.Ed
+.Pp
+.Fa a_hba_tran
+is a pointer to the controlling
+.Sy HBA 's
+transport vector
+structure.
+The
+.Sy SCSA
+interface uses this field to pass any transport
+requests from the
+.Sy SCSI
+target device drivers to the
+.Sy HBA
+driver.
+.Pp
+.Fa a_target
+is the target component of the
+.Sy SCSI
+address
+.Pp
+.Fa a_lun
+is the logical unit component of the
+.Sy SCSI
+address.
+The logical unit is used to further distinguish a
+.Sy SCSI
+target device that
+supports multiple logical units from one that does not.
+.Pp
+If the flag,
+.Dv SCSI_HBA_ADDR_COMPLEX
+was set, then the driver
+.Em must not
+dereference any of these fields, the structure contents will have
+changed and should be considered opaque.
+.Sh SEE ALSO
+.Xr scsi_device_hba_private_get 9F ,
+.Xr scsi_device_hba_private_set 9F ,
+.Xr scsi_hba_attach_setup 9F ,
+.Xr scsi_init_pkt 9F ,
+.Xr scsi_hba_tran 9S ,
+.Xr scsi_pkt 9S
+.Pp
+.Rs
+.%T Writing Device Drivers
+.Re