diff options
Diffstat (limited to 'usr/src/man')
76 files changed, 6336 insertions, 397 deletions
diff --git a/usr/src/man/Makefile b/usr/src/man/Makefile index fe86625dfd..0927a6ea6b 100644 --- a/usr/src/man/Makefile +++ b/usr/src/man/Makefile @@ -85,6 +85,7 @@ SUBDIRS= man1 \ man3utempter \ man3uuid \ man3volmgt \ + man3vnd \ man3xcurses \ man3xnet \ man4 \ diff --git a/usr/src/man/man1/Makefile b/usr/src/man/man1/Makefile index 60cc6a6ecf..943989d4db 100644 --- a/usr/src/man/man1/Makefile +++ b/usr/src/man/man1/Makefile @@ -74,6 +74,7 @@ MANFILES= acctcom.1 \ clear.1 \ cmp.1 \ col.1 \ + column.1 \ comm.1 \ command.1 \ compress.1 \ @@ -220,6 +221,7 @@ MANFILES= acctcom.1 \ m4.1 \ mac.1 \ mach.1 \ + machid.1 \ madv.so.1.1 \ mail.1 \ mailcompat.1 \ @@ -473,6 +475,9 @@ MANLINKS= batch.1 \ helpuid.1 \ helpyorn.1 \ hist.1 \ + i286.1 \ + i386.1 \ + i486.1 \ if.1 \ intro.1 \ jsh.1 \ @@ -521,9 +526,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 \ @@ -662,6 +669,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 @@ -719,7 +732,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 5017199ae9..4a5d196e7c 100644 --- a/usr/src/man/man1/crontab.1 +++ b/usr/src/man/man1/crontab.1 @@ -41,6 +41,8 @@ .\" .\" .\" 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 .\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved .\" Copyright 2020 OmniOS Community Edition (OmniOSce) Association. @@ -62,7 +64,7 @@ crontab \- user crontab file .LP .nf -\fB/usr/bin/crontab\fR \fB-u\fR \fIusername\fR \fB{ -e | -l | -r }\fR +\fB/usr/bin/crontab\fR \fB-u\fR \fIusername\fR \fB{ -e | -g | -l | -r }\fR .fi .LP @@ -72,7 +74,7 @@ crontab \- user crontab file .LP .nf -\fB/usr/xpg4/bin/crontab\fR \fB{ -e | -l | -r }\fR [\fIusername\fR] +\fB/usr/xpg4/bin/crontab\fR \fB{ -e | -g | -l | -r }\fR [\fIusername\fR] .fi .LP @@ -87,7 +89,7 @@ crontab \- user crontab file .LP .nf -\fB/usr/xpg6/bin/crontab\fR \fB{ -e | -l | -r }\fR [\fIusername\fR] +\fB/usr/xpg6/bin/crontab\fR \fB{ -e | -g | -l | -r }\fR [\fIusername\fR] .fi .LP @@ -106,6 +108,19 @@ users' crontabs. If \fBcrontab\fR is invoked with \fIfilename\fR, this overwrites an existing \fBcrontab\fR entry for the user that invokes it, or for the user specified with the \fB-u\fR option. +.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. +.sp +.LP .SS "\fBcrontab\fR Access Control" Users: Access to \fBcrontab\fR is allowed: .RS +4 @@ -382,6 +397,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 @@ -393,6 +411,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 @@ -651,6 +685,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/var/cron/log\fR .ad .RS 28n diff --git a/usr/src/man/man1/diff.1 b/usr/src/man/man1/diff.1 index 3069149285..11be316331 100644 --- a/usr/src/man/man1/diff.1 +++ b/usr/src/man/man1/diff.1 @@ -473,6 +473,7 @@ or options are na\(:ive about creating lines consisting of a single dot .Sq \&. . .Pp +>>>>>>> master Missing NEWLINE at end of file indicates that the last line of the file in question did not have a NEWLINE. If the lines are different, they will be flagged and output, although the diff --git a/usr/src/man/man1/hostname.1 b/usr/src/man/man1/hostname.1 index 3d44d816fb..661ca1c048 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 5 +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 5 , .Xr attributes 7 diff --git a/usr/src/man/man1/ld.so.1.1 b/usr/src/man/man1/ld.so.1.1 index 76e7262919..a36df012d6 100644 --- a/usr/src/man/man1/ld.so.1.1 +++ b/usr/src/man/man1/ld.so.1.1 @@ -1,5 +1,6 @@ '\" .\" 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] @@ -567,6 +568,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/pgrep.1 b/usr/src/man/man1/pgrep.1 index a5482fc992..6a02aeff3e 100644 --- a/usr/src/man/man1/pgrep.1 +++ b/usr/src/man/man1/pgrep.1 @@ -1,13 +1,13 @@ '\" te -.\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved +.\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved +.\" Copyright 2019 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 PGREP 1 "Jan 17, 2014" +.TH PGREP 1 "Aug 13, 2019" .SH NAME pgrep, pkill \- find or signal processes by name and other attributes .SH SYNOPSIS -.LP .nf \fBpgrep\fR [\fB-flvx\fR] [\fB-n\fR | \fB-o\fR] [\fB-d\fR \fIdelim\fR] [\fB-P\fR \fIppidlist\fR] [\fB-g\fR \fIpgrplist\fR] [\fB-s\fR \fIsidlist\fR] [\fB-u\fR \fIeuidlist\fR] [\fB-U\fR \fIuidlist\fR] @@ -26,8 +26,6 @@ pgrep, pkill \- find or signal processes by name and other attributes .fi .SH DESCRIPTION -.sp -.LP The \fBpgrep\fR utility examines the active processes on the system and reports the process \fBID\fRs of the processes whose attributes match the criteria specified on the command line. Each process \fBID\fR is printed as a decimal @@ -74,8 +72,6 @@ process is signaled as if by \fBkill\fR(1) instead of having its process \fBID\fR printed. A signal name or number may be specified as the first command line option to \fBpkill\fR. .SH OPTIONS -.sp -.LP The following options are supported: .sp .ne 2 @@ -104,11 +100,11 @@ character. The \fB-d\fR option is only valid when specified as an option to \fB\fB-f\fR\fR .ad .RS 17n -The regular expression \fIpattern\fR should be matched against the full process -argument string (obtained from the \fBpr_psargs\fR field of the -\fB/proc/\fInnnnn\fR/psinfo\fR file). If no \fB-f\fR option is specified, the -expression is matched only against the name of the executable file (obtained -from the \fBpr_fname\fR field of the \fB/proc/\fInnnnn\fR/psinfo\fR file). +The regular expression \fIpattern\fR should be matched against all the process +arguments, not just the executable file name. +The process arguments are read from \fB\fB/proc/\fInnnnn\fR\fB/cmdline\fR: this +does not truncate the arguments, but reflects the current value, which may have +been changed. .RE .sp @@ -150,11 +146,9 @@ project \fBID\fR. \fB\fB-l\fR\fR .ad .RS 17n -Long output format. Prints the process name along with the process \fBID\fR of -each matching process. The process name is obtained from the \fBpr_psargs\fR or -\fBpr_fname\fR field, depending on whether the \fB-f\fR option was specified -(see above). The \fB-l\fR option is only valid when specified as an option to -\fBpgrep\fR. +Long output format. Prints the process arguments along with the process \fBID\fR of +each matching process, depending on how the \fB-f\fR option was specified. +The \fB-l\fR option is only valid when specified as an option to \fBpgrep\fR. .RE .sp @@ -258,8 +252,8 @@ which meet the specified matching criteria. .RS 17n Matches only processes whose executable file name (ignoring any path) \fBexactly\fR matches the specified \fIpattern\fR. However, when used with -f, -the \fIpattern\fR should be matched against the full process argument -string. For example if there exists a process `/bin/ls /home' then: +the \fIpattern\fR is matched against the full process argument +string. For example, if there exists a process `/bin/ls /home' then: .sp .in +2 .nf @@ -308,8 +302,6 @@ one of the symbolic names defined in \fBsignal.h\fR(3HEAD) without the .RE .SH OPERANDS -.sp -.LP The following operand is supported: .sp .ne 2 @@ -323,7 +315,6 @@ either the executable file name or full process argument string. See .RE .SH EXAMPLES -.LP \fBExample 1 \fRObtaining a Process ID .sp .LP @@ -352,9 +343,20 @@ example% \fBpkill -n xterm\fR .in -2 .sp -.SH EXIT STATUS +.LP +\fBExample 3 \fRMatching against all process arguments .sp .LP +Match against any process argument and report the arguments: + +.sp +.in +2 +.nf +example% \fBpgrep -fl myfile.txt\fR +.fi +.in -2 +.sp +.SH EXIT STATUS The following exit values are returned: .sp .ne 2 @@ -393,17 +395,22 @@ A fatal error occurred. .RE .SH FILES -.sp .ne 2 .na -\fB\fB/proc/\fInnnnn\fR/psinfo\fR\fR +\fB\fB/proc/\fInnnnn\fR\fB/psinfo\fR\fR .ad .RS 22n Process information files .RE -.SH SEE ALSO .sp +.ne 2 +.na +\fB\fB/proc/\fInnnnn\fR\fB/cmdline\fR\fR +.ad +.RS 22n +Process arguments. +.RE .LP .BR kill (1), .BR proc (1), @@ -417,14 +424,11 @@ Process information files .BR regex (7), .BR zones (7) .SH NOTES -.sp -.LP Both utilities match the \fBERE\fR \fIpattern\fR argument against either the -\fBpr_fname\fR or \fBpr_psargs\fR fields of the -\fB/proc/\fR\fInnnnn\fR\fB/psinfo\fR files. The lengths of these strings are -limited according to definitions in \fB<sys/procfs.h>\fR\&. Patterns which can -match strings longer than the current limits may fail to match the intended set -of processes. +\fBpr_fname\fR field of the \fB/proc/\fR\fInnnnn\fR\fB/psinfo\fR file, or +\fB/proc/\fR\fInnnnn\fR\fB/cmdline\fR, and may be truncated. +Patterns which can match strings longer than the current limits may fail to +match the intended set of processes. .sp .LP If the \fIpattern\fR argument contains \fBERE\fR meta-characters which are also diff --git a/usr/src/man/man1/ps.1 b/usr/src/man/man1/ps.1 index 5eb0b70f3b..43a8b5b0a4 100644 --- a/usr/src/man/man1/ps.1 +++ b/usr/src/man/man1/ps.1 @@ -44,13 +44,12 @@ .\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved .\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved .\" Copyright (c) 2013 Gary Mills -.\" Copyright (c) 2018, Joyent, Inc. +.\" Copyright 2019 Joyent, Inc. .\" -.TH PS 1 "August 22, 2018" +.TH PS 1 "August 28, 2019" .SH NAME ps \- report process status .SH SYNOPSIS -.LP .nf \fBps\fR [\fB-aAcdefjHlLPWyZ\fR] [\fB-g\fR \fIgrplist\fR] [\fB-h\fR \fIlgrplist\fR] [\fB-n\fR \fInamelist\fR] [\fB-o\fR \fIformat\fR]... [\fB-p\fR \fIproclist\fR] @@ -59,7 +58,6 @@ ps \- report process status .fi .SH DESCRIPTION -.LP The \fBps\fR command prints information about active processes. Without options, \fBps\fR prints information about processes that have the same effective user \fBID\fR and the same controlling terminal as the invoker. The @@ -71,8 +69,10 @@ 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. -.SH OPTIONS +.sp .LP +The \fBps\fR command also accepts BSD-style options. See \fBps\fR(1b). +.SH OPTIONS The following options are supported: .sp .ne 2 @@ -372,9 +372,9 @@ Many of the options shown are used to select processes to list. If any are specified, the default list is ignored and \fBps\fR selects the processes represented by the inclusive OR of all the selection-criteria options. .SH DISPLAY FORMATS -.LP -Under the \fB-f\fR option, \fBps\fR tries to determine the command name and -arguments given when the process was created by examining the user block. +Under the \fB-f\fR option, \fBps\fR uses the \fB\fB/proc/\fInnnnn\fR\fB/cmdline\fR\fR +file to read the full process arguments. The process may have changed these +since it was started. Failing this, the command name is printed, as it would have appeared without the \fB-f\fR option, in square brackets. .sp @@ -605,8 +605,8 @@ The execution time for the lwp being reported. \fB\fBCMD\fR(all)\fR .ad .RS 14n -The command name (the full command name and its arguments, up to a limit of 80 -characters, are printed under the \fB-f\fR option). +The command name (or, with the \fB-f\fR option, the full current process +arguments). .RE .sp @@ -664,7 +664,6 @@ lwp. A process that has exited and has a parent, but has not yet been waited for by the parent, is marked \fB<defunct>\fR\&. .SS "\fB-o\fR format" -.LP The \fB-o\fR option allows the output format to be specified under user control. .sp @@ -882,9 +881,9 @@ is a version of the argument list as it was passed to the command when it started, or is a version of the arguments as they might have been modified by the application. Applications cannot depend on being able to modify their argument list and having that modification be reflected in the output of -\fBps\fR. The illumos implementation limits the string to 80 bytes; the string -is the version of the argument list as it was passed to the command when it -started. +\fBps\fR. However, the current implementation will display the full modified +process arguments when given the \fB-f\fR argument; otherwise this is the +initial process arguments, but limited to 80 bytes. .RE .sp @@ -1241,7 +1240,6 @@ ctid CTID .TE .SH EXAMPLES -.LP \fBExample 1 \fRUsing \fBps\fR Command .sp .LP @@ -1289,7 +1287,6 @@ number of text columns to display. .RE .SH EXIT STATUS -.LP The following exit values are returned: .sp .ne 2 @@ -1382,7 +1379,6 @@ Standard See \fBstandards\fR(7). .BR zones (7), .BR getty (8) .SH NOTES -.LP Things can change while \fBps\fR is running. The snapshot it gives is true only for a split-second, and it might not be accurate by the time you see it. Some data printed for defunct processes is irrelevant. diff --git a/usr/src/man/man1/sed.1 b/usr/src/man/man1/sed.1 index 4261c2df83..3eca2b5418 100644 --- a/usr/src/man/man1/sed.1 +++ b/usr/src/man/man1/sed.1 @@ -45,7 +45,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 @@ -98,11 +99,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 @@ -120,7 +126,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 0b7c9d2cc1..8d12560b96 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(8) 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(8) 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(7) for descriptions of the following attributes: .sp @@ -284,7 +319,6 @@ Interface Stability Evolving .TE .SH SEE ALSO -.sp .LP .BR login (1), .BR rsh (1), @@ -295,7 +329,6 @@ Interface Stability Evolving .BR zoneadm (8), .BR zonecfg (8) .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/man1b/ps.1b b/usr/src/man/man1b/ps.1b index afedd42f79..db60e40828 100644 --- a/usr/src/man/man1b/ps.1b +++ b/usr/src/man/man1b/ps.1b @@ -1,17 +1,16 @@ '\" te .\" Copyright (c) 2002, Sun Microsystems, Inc. - All Rights Reserved. .\" Copyright (c), 1980 Regents of the University of California. All rights reserved. The Berkeley software License Agreement specifies the terms and conditions for redistribution. -.TH PS 1B "May 13, 2017" +.\" Copyright 2019 Joyent, Inc. +.TH PS 1B "Aug 13, 2019" .SH NAME ps \- display the status of current processes .SH SYNOPSIS -.LP .nf \fB/usr/ucb/ps\fR [\fB-aceglnrSuUvwx\fR] [\fB-t\fR \fIterm\fR] [\fInum\fR] .fi .SH DESCRIPTION -.LP The \fBps\fR command displays information about processes. Normally, only those processes that are running with your effective user \fBID\fR and are attached to a controlling terminal (see \fBtermio\fR(4I)) are shown. Additional @@ -78,7 +77,6 @@ Traced. Process stopped by a signal because parent is tracing it. .RE .SH OPTIONS -.LP The following options must all be combined to form the first argument: .sp .ne 2 @@ -206,11 +204,10 @@ fields \fBSIZE\fR, \fB%CPU\fR, \fB%MEM\fR, and \fBRSS\fR, described below. \fB\fB-w\fR\fR .ad .RS 11n -Uses a wide output format, that is, 132 columns rather than 80. If the option +Uses a wide output format, that is, truncate process arguments at 132 columns +rather than 80. If the option letter is repeated, that is, \fB-ww\fR, this option uses arbitrarily wide output. This information is used to decide how much of long commands to print. -\fBNote:\fR The wide output option can be viewed only by a superuser or the -user who owns the process. .RE .sp @@ -233,7 +230,6 @@ process. This option must be supplied last. .RE .SH DISPLAY FORMATS -.LP Fields that are not common to all output formats: .sp .ne 2 @@ -376,7 +372,6 @@ the parent, is marked <\fBdefunct\fR>\|; otherwise, \fBps\fR tries to determine the command name and arguments given when the process was created by examining the user block. .SH FILES -.LP \fB/dev/tty*\fR .sp .ne 2 @@ -398,7 +393,6 @@ the user block. .BR attributes (7), .BR whodo (8) .SH NOTES -.LP Things can change while \fBps\fR is running. The picture \fBps\fR gives is only a close approximation to the current state. Some data printed for defunct processes is irrelevant. diff --git a/usr/src/man/man3c/Makefile b/usr/src/man/man3c/Makefile index 1c76564c56..f6de231e9f 100644 --- a/usr/src/man/man3c/Makefile +++ b/usr/src/man/man3c/Makefile @@ -219,6 +219,9 @@ MANFILES= __fbufsize.3c \ index.3c \ inet.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 5078225b5c..cf647521dc 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/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 546cedd5da..28bc7f66cf 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(7) 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 e1ff6e7c7e..8df73bde6b 100644 --- a/usr/src/man/man3lib/Makefile +++ b/usr/src/man/man3lib/Makefile @@ -106,6 +106,7 @@ MANFILES= libMPAPI.3lib \ libtsol.3lib \ libumem.3lib \ libuuid.3lib \ + libvnd.3lib \ libvolmgt.3lib \ libw.3lib \ libxnet.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/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 ad927ec91d..dac5df1dd6 100644 --- a/usr/src/man/man3xnet/htonl.3xnet +++ b/usr/src/man/man3xnet/htonl.3xnet @@ -58,6 +58,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 @@ -68,18 +73,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 @@ -92,12 +102,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 ae3db792b6..c367547dff 100644 --- a/usr/src/man/man4/Makefile +++ b/usr/src/man/man4/Makefile @@ -21,7 +21,8 @@ MANSECT= 4 MANFILES= FSS.4 \ Intro.4 \ cpr.4 \ - ibmf.4 + ibmf.4 \ + swap.4 MANLINKS= intro.4 diff --git a/usr/src/man/man4/swap.4 b/usr/src/man/man4/swap.4 new file mode 100644 index 0000000000..0d2faddf6d --- /dev/null +++ b/usr/src/man/man4/swap.4 @@ -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 4 +.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 8 +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 8 +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 8 +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 sbrk 2 , +.Xr resource_controls 7 , +.Xr kstat 8 , +.Xr swap 8 , +.Xr vmstat 8 , +.Xr zonecfg 8 diff --git a/usr/src/man/man4d/Makefile b/usr/src/man/man4d/Makefile index 9e86f330a7..4a6402de9c 100644 --- a/usr/src/man/man4d/Makefile +++ b/usr/src/man/man4d/Makefile @@ -146,11 +146,13 @@ _MANFILES= aac.4d \ virtualkm.4d \ vni.4d \ vr.4d \ + vnd.4d \ wscons.4d \ xge.4d \ yge.4d \ zcons.4d \ - zero.4d + zero.4d \ + zfd.4d sparc_MANFILES= audiocs.4d \ bbc_beep.4d \ diff --git a/usr/src/man/man4d/cpuid.4d b/usr/src/man/man4d/cpuid.4d index 95b19bc834..7e70907ee3 100644 --- a/usr/src/man/man4d/cpuid.4d +++ b/usr/src/man/man4d/cpuid.4d @@ -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/man4d/vnd.4d b/usr/src/man/man4d/vnd.4d new file mode 100644 index 0000000000..e80a991d5c --- /dev/null +++ b/usr/src/man/man4d/vnd.4d @@ -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 4D "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(4P) 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(7), +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 +libvnd(3LIB), ipfilter(7), vndstat(8), dladm(8), vndadm(8), + diff --git a/usr/src/man/man4d/zfd.4d b/usr/src/man/man4d/zfd.4d new file mode 100644 index 0000000000..556fd8e371 --- /dev/null +++ b/usr/src/man/man4d/zfd.4d @@ -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 4D +.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(4D) +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 zcons 4D , +.Xr zoneadmd 8 , +.Xr zonecfg 8 diff --git a/usr/src/man/man4fs/Makefile b/usr/src/man/man4fs/Makefile index 92d22cc776..7f6b480297 100644 --- a/usr/src/man/man4fs/Makefile +++ b/usr/src/man/man4fs/Makefile @@ -17,23 +17,25 @@ include $(SRC)/Makefile.master -MANSECT= 4fs +MANSECT= 4fs -MANFILES= bootfs.4fs \ +MANFILES= bootfs.4fs \ ctfs.4fs \ - dcfs.4fs \ - dev.4fs \ - devfs.4fs \ + dcfs.4fs \ + dev.4fs \ + devfs.4fs \ fd.4fs \ - hsfs.4fs \ - lofs.4fs \ - objfs.4fs \ - pcfs.4fs \ - sharefs.4fs \ - smbfs.4fs \ - tmpfs.4fs \ - udfs.4fs \ - ufs.4fs + hsfs.4fs \ + hyprlofs.4fs \ + lofs.4fs \ + lxproc.4fs \ + objfs.4fs \ + pcfs.4fs \ + sharefs.4fs \ + smbfs.4fs \ + tmpfs.4fs \ + udfs.4fs \ + ufs.4fs MANLINKS= stderr.4fs \ stdin.4fs \ diff --git a/usr/src/man/man4fs/hyprlofs.4fs b/usr/src/man/man4fs/hyprlofs.4fs new file mode 100644 index 0000000000..6d0849cfe5 --- /dev/null +++ b/usr/src/man/man4fs/hyprlofs.4fs @@ -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 4FS "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(4FS)\fR and \fBlofs(4FS)\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 +\fBmount\fR(2), \fBumount\fR(2), +\fBdf\fR(8), \fBmount\fR(8), \fBswap\fR(8) +.sp +.LP +\fISystem Administration Guide: Basic Administration\fR +.SH DIAGNOSTICS +.sp +.LP +\fBdf\fR(8) 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/man4fs/lxproc.4fs b/usr/src/man/man4fs/lxproc.4fs new file mode 100644 index 0000000000..25e5a3d9fc --- /dev/null +++ b/usr/src/man/man4fs/lxproc.4fs @@ -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 4FS "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(5) 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(5), \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(5) 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(5)-based tools like +\fBprstat\fR(8), +\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(8), +\fBmpstat\fR(8), +\fBiostat\fR(8), +\fBnetstat\fR(8) or +\fBpsrinfo\fR(8). +.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(8), +\fBiostat\fR(8), +\fBkstat\fR(8), +\fBmpstat\fR(8), +\fBmount\fR(8), +\fBnetstat\fR(8), +\fBpargs\fR(1), +\fBpcred\fR(1), +\fBpfiles\fR(1), +\fBpflags\fR(1), +\fBpldd\fR(1), +\fBplimit\fR(1), +\fBpmap\fR(1), +\fBprstat\fR(8), +\fBpsig\fR(1), +\fBpsrinfo\fR(8), +\fBpstack\fR(1), +\fBptree\fR(1), +\fBpwdx\fR(1), +\fBmount\fR(2), \fBumount\fR(2), \fBkstat\fR(3KSTAT), \fBproc\fR(5), +\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/man4i/Makefile b/usr/src/man/man4i/Makefile index 4c149ea3ac..4c8d7406af 100644 --- a/usr/src/man/man4i/Makefile +++ b/usr/src/man/man4i/Makefile @@ -41,6 +41,10 @@ MANFILES= audio.4i \ visual_io.4i \ vt.4i +MANLINKS= uccid.4i + +uccid.7i := LINKSRC = ../man4d/ccid.4d + .KEEP_STATE: include $(SRC)/man/Makefile.man diff --git a/usr/src/man/man4m/Makefile b/usr/src/man/man4m/Makefile index 4fc26d5bb9..a32665e699 100644 --- a/usr/src/man/man4m/Makefile +++ b/usr/src/man/man4m/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= 4m _MANFILES = bufmod.4m \ connld.4m \ + datafilt.4m \ ldterm.4m \ pckt.4m \ pfmod.4m \ diff --git a/usr/src/man/man4m/datafilt.4m b/usr/src/man/man4m/datafilt.4m new file mode 100644 index 0000000000..ab35965eeb --- /dev/null +++ b/usr/src/man/man4m/datafilt.4m @@ -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 4M +.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/man4p/vxlan.4p b/usr/src/man/man4p/vxlan.4p index dbace910b4..d3b70b80da 100644 --- a/usr/src/man/man4p/vxlan.4p +++ b/usr/src/man/man4p/vxlan.4p @@ -9,9 +9,9 @@ .\" http://www.illumos.org/license/CDDL. .\" .\" -.\" Copyright 2015 Joyent, Inc. +.\" Copyright 2018 Joyent, Inc. .\" -.Dd Apr 10, 2015 +.Dd December 20, 2018 .Dt VXLAN 4P .Os .Sh NAME @@ -96,11 +96,18 @@ validate_vxlan(void *buf, int len, uint32_t *vidp) vxlan_hdr_t *hdr; if (len < sizeof (vxlan_hdr_t)) - return (EINAVL); + return (EINVAL); hdr = buf; - if ((ntohl(hdr->vxlan_flags) & VXLAN_MAGIC) == 0) - return (EINAVL); + + /* + * This verifies that the required flag is set; however, it does + * not look at any of the other bist that are reserved in the + * header. Software needs to evaluate how it should handle other + * bits being set in the vxlan_flags member. + */ + if ((ntohl(hdr->vxlan_flags) & VXLAN_F_VDI) == 0) + return (EINVAL); *vidp = ntohl(vxlan->vxlan_id) >> VXLAN_ID_SHIFT; diff --git a/usr/src/man/man5/proc.5 b/usr/src/man/man5/proc.5 index 55fa331d08..80adab2f4b 100644 --- a/usr/src/man/man5/proc.5 +++ b/usr/src/man/man5/proc.5 @@ -712,6 +712,17 @@ indicates that the lwp stopped due to internal synchronization of lwps within 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 @@ -1023,6 +1034,20 @@ 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 @@ -1177,6 +1202,15 @@ 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 @@ -2916,6 +2950,8 @@ process privileges process signal actions .It Pa /proc/ Ns Em pid Ns Pa /auxv process aux vector +.It Pa /proc/ Ns Em pid Ns Pa /argv +process argument vector .It Pa /proc/ Ns Em pid Ns Pa /ldt process .Sy LDT diff --git a/usr/src/man/man5/process.5 b/usr/src/man/man5/process.5 index 8cab5f5e0d..15ebea98c2 100644 --- a/usr/src/man/man5/process.5 +++ b/usr/src/man/man5/process.5 @@ -1,5 +1,6 @@ '\" 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] @@ -196,6 +197,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/man7/Makefile b/usr/src/man/man7/Makefile index 2527fc1008..6ce3008a0c 100644 --- a/usr/src/man/man7/Makefile +++ b/usr/src/man/man7/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 2017 Joyent, Inc. # Copyright 2018 Gary Mills # Copyright 2019 OmniOS Community Edition (OmniOSce) Association. # Copyright 2019 Peter Tribble @@ -62,6 +62,7 @@ _MANFILES= Intro.7 \ iconv_unicode.7 \ ieee802.3.7 \ ieee802.11.7 \ + inotify.7 \ ipfilter.7 \ isalist.7 \ kerberos.7 \ @@ -72,6 +73,7 @@ _MANFILES= Intro.7 \ lfcompile.7 \ lfcompile64.7 \ locale.7 \ + lx.7 \ man.7 \ mandoc_char.7 \ mandoc_roff.7 \ @@ -135,8 +137,6 @@ _MANFILES= Intro.7 \ zones.7 \ zpool-features.7 -sparc_MANFILES= - i386_MANFILES= beastie.4th.7 \ brand.4th.7 \ check-password.4th.7 \ diff --git a/usr/src/man/man7/inotify.7 b/usr/src/man/man7/inotify.7 new file mode 100644 index 0000000000..13ea10cf2b --- /dev/null +++ b/usr/src/man/man7/inotify.7 @@ -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 7 "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(7), 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(7) diff --git a/usr/src/man/man7/lx.7 b/usr/src/man/man7/lx.7 new file mode 100644 index 0000000000..a45ead418c --- /dev/null +++ b/usr/src/man/man7/lx.7 @@ -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 7 +.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 7 +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 8 +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 8 , +.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 8 +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 brands 7 , +.Xr privileges 7 , +.Xr resource_controls 7 , +.Xr zones 7 , +.Xr dtrace 8 , +.Xr zfs 8 , +.Xr zoneadm 8 , +.Xr zonecfg 8 diff --git a/usr/src/man/man7/privileges.7 b/usr/src/man/man7/privileges.7 index aade5c020c..b2d51cccf8 100644 --- a/usr/src/man/man7/privileges.7 +++ b/usr/src/man/man7/privileges.7 @@ -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 @@ -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/man7/resource_controls.7 b/usr/src/man/man7/resource_controls.7 index e9928399aa..34392538bc 100644 --- a/usr/src/man/man7/resource_controls.7 +++ b/usr/src/man/man7/resource_controls.7 @@ -1,12 +1,13 @@ '\" te .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved. +.\" Copyright 2017, Joyent, Inc. .\" Copyright 2021 OmniOS Community Edition (OmniOSce) Association. .\" 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 7 "Jan 23, 2021" .SH NAME -resource_controls \- resource controls available through project database +resource_controls \- resource controls available through projects and zones .SH DESCRIPTION The resource controls facility is configured through the project database. See \fBproject\fR(5). You can set and modify resource controls through the @@ -35,6 +36,12 @@ following utilities: .el o .BR rctladm (8) .RE +.RS +4 +.TP +.ie t \(bu +.el o +\fBzonecfg\fR(8) +.RE .sp .LP In a program, you use \fBsetrctl\fR(2) to set resource control values. @@ -407,6 +414,33 @@ The following zone-wide resource controls are available: .sp .ne 2 .na +\fBzone.cpu-baseline\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 +\fBzone.cpu-burst-time\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 \fBzone.cpu-cap\fR .ad .sp .6 @@ -425,7 +459,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 @@ -445,6 +479,15 @@ Total amount of physical locked memory available to a zone. .sp .ne 2 .na +\fBzone.max-lofi\fR +.ad +.sp .6 +.RS 4n +Sets a limit on the number of \fBLOFI\fR(4D) devices that can be created in a +zone. Expressed as an integer. This resource control does not support the +\fBsyslog\fR action. +.RE + \fBzone.max-lwps\fR .ad .sp .6 @@ -469,6 +512,14 @@ integer. .sp .ne 2 .na +\fBzone.max-physical-memory\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. \fBzone.max-processes\fR .ad .sp .6 @@ -482,6 +533,11 @@ Expressed as an integer. .sp .ne 2 .na +.RE + +.sp +.ne 2 +.na \fBzone.max-sem-ids\fR .ad .sp .6 @@ -523,6 +579,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(8) 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(7). .SS "Units Used in Resource Controls" @@ -1032,6 +1100,8 @@ Interface Stability Evolving .BR FSS (4), .BR project (5), .BR attributes (7), +.BR privileges (7), +.BR zones (7), .BR pooladm (8), .BR poolcfg (8), .BR projadd (8), diff --git a/usr/src/man/man8/Makefile b/usr/src/man/man8/Makefile index ab33d3c4c8..bad2e9d2d7 100644 --- a/usr/src/man/man8/Makefile +++ b/usr/src/man/man8/Makefile @@ -510,7 +510,10 @@ _MANFILES= 6to4relay.8 \ uucleanup.8 \ uusched.8 \ uuxqt.8 \ + vfsstat.8 \ vmstat.8 \ + vndadm.8 \ + vndstat.8 \ volcopy.8 \ volcopy_ufs.8 \ vscanadm.8 \ diff --git a/usr/src/man/man8/connstat.8 b/usr/src/man/man8/connstat.8 index 686f3c4648..cffc654e02 100644 --- a/usr/src/man/man8/connstat.8 +++ b/usr/src/man/man8/connstat.8 @@ -14,8 +14,9 @@ .\" .\" .\" Copyright (c) 2016 by Delphix. All rights reserved. +.\" Copyright 2019 Joyent, Inc. .\" -.Dd July 5, 2016 +.Dd August 15, 2019 .Dt CONNSTAT 8 .Os .Sh NAME @@ -165,6 +166,9 @@ The current retransmission timeout in milliseconds. .It Sy rtt The current smoothed round-trip time to the peer in microseconds. The smoothed RTT average algorithm used is as described in RFC 6298. +.It Sy rttvar +The current smoothed variation of the round-trip time to the peer in +microseconds. .It Sy rttc The number of times that a round-trip sample was added to .Sy rtts . diff --git a/usr/src/man/man8/dladm.8 b/usr/src/man/man8/dladm.8 index b18a9d7f50..f6ecd15b82 100644 --- a/usr/src/man/man8/dladm.8 +++ b/usr/src/man/man8/dladm.8 @@ -41,7 +41,7 @@ .\" .\" .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved -.\" Copyright 2016 Joyent, Inc. +.\" Copyright 2017 Joyent, Inc. .\" Copyright 2020 RackTop Systems, Inc. .\" Copyright 2022 OmniOS Community Edition (OmniOSce) Association. .\" @@ -54,7 +54,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 @@ -137,9 +137,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 @@ -154,9 +156,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 @@ -471,6 +473,19 @@ A virtual network interface. The \fBshow-vnic\fR subcommand displays more detail for this class of datalink. .RE +.sp +.ne 2 +.na +\fB\fBoverlay\fR\fR +.ad +.sp .6 +.RS 4n +A virtual device that is used to create or join a software defined +network. The \fBshow-overlay\fR subcommand displays more detail for this +class of datalink. +.RE + + .RE .sp @@ -640,8 +655,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 @@ -659,6 +673,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 @@ -3264,8 +3288,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 @@ -3297,6 +3320,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 @@ -3316,8 +3349,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 @@ -3349,6 +3381,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 @@ -3363,8 +3405,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 @@ -3482,6 +3523,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 @@ -3799,8 +3850,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 @@ -3826,13 +3876,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 @@ -3975,6 +4034,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 @@ -4844,6 +4913,43 @@ The following general link properties are supported: .sp .ne 2 .na +\fB\fBallow-all-dhcp-cids\fR\fR +.ad +.sp .6 +.RS 4n +One of \fBtrue\fR or \fBfalse\fR, to indicate whether or not all DHCP Client +Identifiers should be permitted on this interface when DHCP spoofing protection +is being used. This can be useful in cases where a DHCP client is using RFC +4361-style Client Identifiers, which are based on a value that is opaque to the +Global Zone, but enforcement of MAC addresses in DHCP packets is still desired. +.RE + +.sp +.ne 2 +.na +\fB\fBallowed-dhcp-cids\fR\fR +.ad +.sp .6 +.RS 4n +A comma-separated list of DHCP Client Identifiers that are allowed on the +interface. +.sp +Client identifiers can be written in three different formats: a string of +hexadecimal characters prefixed by \fB0x\fR, indicating the exact bytes used in +the Client Identifier; an RFC 3315 DUID of the form +"1.<hardware\ type>.<time>.<link-layer\ address>" (DUID-LLT), +"2.<enterprise\ number>.<hex\ string>" (DUID-EN), or +"3.<hardware\ type>.<link-layer\ address>" (DUID-LL); or a string of characters +whose byte values should be used as the Client Identifier. +.sp +When specifying a string of hexadecimal characters prefixed by \fB0x\fR or as +part of a DUID-EN string, an even number of hexadecimal characters must be +provided in order to fully specify each byte. +.RE + +.sp +.ne 2 +.na \fB\fBallowed-ips\fR\fR .ad .sp .6 @@ -4905,6 +5011,24 @@ is not bound to any specific processor or processor set. .sp .ne 2 .na +\fB\fBdynamic-methods\fR\fR +.ad +.sp .6 +.RS 4n +When using IP spoofing protection (see \fBprotection\fR), addresses can be +learned dynamically by monitoring certain network traffic, like DHCP +transactions or IPv6 Stateless Address Autoconfiguration (SLAAC). By default, +all learning methods are permitted, but if \fBallowed-ips\fR contains any +addresses, then all methods are disabled, and any packets sent from addresses +previously learned will be dropped. This property allows selecting which ones +are re-enabled, where valid options are \fBdhcpv4\fR, \fBdhcpv6\fR, and +\fBslaac\fR. \fBaddrconf\fR is available as an alias for enabling both +\fBdhcpv6\fR and \fBslaac\fR. +.RE + +.sp +.ne 2 +.na \fB\fBlearn_limit\fR\fR .ad .sp .6 @@ -4957,6 +5081,67 @@ tokens \fBhigh\fR, \fBmedium\fR, or \fBlow\fR. The default is \fBhigh\fR. .sp .ne 2 .na +\fB\fBprotection\fR\fR +.ad +.sp .6 +.RS 4n +This property enables various forms of link protections, which prevent sending +applicable traffic out of this link. Note that since this enforcement happens +late in the networking stack, some observability tools like \fBsnoop\fR(1M) may +still see dropped outbound packets. + +This property should be set to a comma-separated list of protections to enable +on this link, where available protections are: +.sp +.ne 2 +.na +\fBip-nospoof\fR +.ad +.sp .6 +.RS 4n +Prevents sending from IPv4 and IPv6 addresses that have not been permitted +over the NIC. Addresses can be learned dynamically (see \fBdynamic-methods\fR) +or specified explicitly (see \fBallowed-ips\fR). +.RE +.sp +.ne 2 +.na +\fBdhcp-nospoof\fR +.ad +.sp .6 +.RS 4n +Prevents sending DHCP packets whose client hardware address +(CHADDR) field differs from the link-layer address, or from using a Client +Identifier whose value cannot be confirmed to be derived from the link-layer +address. Additional Client Identifiers can be permitted through the +\fBallowed-dhcp-cids\fR and \fBallow-all-dhcp-cids\fR link properties. +.RE +.sp +.ne 2 +.na +\fBmac-nospoof\fR +.ad +.sp .6 +.RS 4n +Prevents sending packets with a link-layer address that differs from the one +associated with the NIC. Additional addresses to allow can be added using the +\fBseconday-macs\fR property. +.RE +.sp +.ne 2 +.na +\fBrestricted\fR +.ad +.sp .6 +.RS 4n +Prevents using a VLAN ID not associated with the NIC and sending packets that +are not IPv4, IPv6 or ARP. +.RE +.RE + +.sp +.ne 2 +.na \fB\fBstp\fR\fR .ad .sp .6 @@ -5988,6 +6173,16 @@ Interface Stability Committed .BR psrset (8), .BR wpad (8), .BR zonecfg (8) +.sp +.LP +R. Droms, Ed., J. Bound, B. Volz, T. Lemon, C. Perkins, M. Carney. \fIRFC 3315: +Dynamic Host Configuration Protocol for IPv6 (DHCPv6)\fR. The Internet Society. +July 2003. +.sp +.LP +T. Lemon, B. Sommerfeld. February 2006. \fIRFC 4361: Node-specific Client +Identifiers for Dynamic Host Configuration Protocol Version Four (DHCPv4)\fR. +The Internet Society. January 2006. .SH NOTES The preferred method of referring to an aggregation in the aggregation subcommands is by its link name. Referring to an aggregation by its integer diff --git a/usr/src/man/man8/dumpadm.8 b/usr/src/man/man8/dumpadm.8 index e05fe800e9..52270045bd 100644 --- a/usr/src/man/man8/dumpadm.8 +++ b/usr/src/man/man8/dumpadm.8 @@ -2,17 +2,18 @@ .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved .\" Copyright 2015 Nexenta Systems, Inc. All Rights Reserved. .\" Copyright (c) 2013 by Delphix. All rights reserved. +.\" Copyright 2019 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 DUMPADM 8 "Apr 09, 2015" +.TH DUMPADM 8 "Jun 15, 2019" .SH NAME dumpadm \- configure operating system crash dump .SH SYNOPSIS .LP .nf \fB/usr/sbin/dumpadm\fR [\fB-enuy\fR] [\fB-c\fR \fIcontent-type\fR] [\fB-d\fR \fIdump-device\fR] - [\fB-m\fR \fImin\fRk | \fImin\fRm | \fImin\fR%] [\fB-s\fR \fIsavecore-dir\fR] + [\fB-k\fR \fIkey-file\fR] [\fB-m\fR \fImin\fRk | \fImin\fRm | \fImin\fR%] [\fB-s\fR \fIsavecore-dir\fR] [\fB-r\fR \fIroot-dir\fR] [\fB-z\fR on | off] .fi @@ -41,8 +42,10 @@ write it to the file system. The directory in which the crash dump is saved on reboot can also be configured using \fBdumpadm\fR. .sp .LP -When the operating system takes a crash dump the default behavior is to -compress the crash dump. This behavior is controlled by the \fB-z\fR option. +A crash dump is always compressed on the dump device. The dump is decompressed +by the \fBsavecore\fR(8) utility, which can optionally store the dump in its +compressed state, thereby deferring decompression to a subsequent invocation +of \fBsavecore\fR. This behavior is controlled by the \fB-z\fR option. When compression is turned on, the \fBsavecore\fR(8) utility writes one file to the file system named \fIvmdump.X\fR. If compression is disabled, it instead writes two files named \fIunix.X\fR and \fIvmcore.X\fR. In the uncompressed @@ -50,6 +53,21 @@ case, both data files form the \fIsaved crash dump\fR. In both cases X is an integer identifying the dump. .sp .LP +Crash dump encryption may be optionally enabled via the \fB-k\fR option, which +specifies a file that contains an encryption key. When crash dump encryption +is enabled, the contents of kernel memory as stored in the dump device will be +encrypted. Decryption of a kernel crash dump must occur when the dump is +extracted via \fBsavecore\fR (to which the encryption key must be separately +provided). Decompression can only occur on a decrypted dump; when dump +encryption is enabled, \fBsavecore\fR must store the dump in its compressed +state. Note that \fBsavecore\fR cannot extract an encrypted dump without also +decrypting it; when dump encryption is enabled, the operator should be sure +to only operate \fBsavecore\fR on a directory that is separately encrypted +or otherwise secured. Finally, note that \fBdumpadm\fR does not store the +crash dump encryption key persistently: upon system reset, crash dump +encryption is always disabled. +.sp +.LP For systems with a UFS root file system, the default dump device is configured to be an appropriate swap partition. Swap partitions are disk partitions reserved as virtual memory backing store for the operating system. Thus, no @@ -68,6 +86,7 @@ example# \fBdumpadm\fR Savecore directory: /var/crash/saturn Savecore enabled: yes Save compressed: on + Dump encrypted: no .fi .in -2 .sp @@ -199,6 +218,18 @@ Estimates the size of the dump for the current running system. .sp .ne 2 .na +\fB\fB-k\fR \fIkey-file\fR\fR +.ad +.sp .6 +.RS 4n +Specifies that the dump should be encrypted based on the key found in +\fIkey-file\fR. Note that any invocations of \fBsavecore\fR will need to +specify the same key to be able to correctly retrieve the dump. +.RE + +.sp +.ne 2 +.na \fB\fB-m\fR \fImin\fR\fBk\fR | \fImin\fR\fBm\fR | \fImin\fR\fB%\fR\fR .ad .sp .6 @@ -346,6 +377,7 @@ example# dumpadm -d /dev/dsk/c0t2d0s2 Savecore directory: /var/crash/saturn Savecore enabled: yes Save compressed: on + Dump encrypted: no .fi .in -2 .sp diff --git a/usr/src/man/man8/flowadm.8 b/usr/src/man/man8/flowadm.8 index 420835b7aa..561a24b17a 100644 --- a/usr/src/man/man8/flowadm.8 +++ b/usr/src/man/man8/flowadm.8 @@ -1,19 +1,20 @@ '\" te .\" Copyright 2020 Peter Tribble +.\" Copyright 2022 Joyent, Inc. .\" Copyright (c) 2009, Sun Microsystems, 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 FLOWADM 8 "February 5, 2022" +.TH FLOWADM 8 "March 15, 2022" .SH NAME flowadm \- administer bandwidth resource control and priority for protocols, services, containers, and virtual machines .SH SYNOPSIS .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 show-flow\fR [\fB-p\fR] [\fB-l\fR \fIlink\fR] [\fB-o\fR \fIfield\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} +\fBflowadm show-flow\fR [\fB-p\fR] [\fB-l\fR \fIlink\fR] [\fB-o\fR \fIfield\fR[,...]] [\fB-z\fR \fIzonename\fR] [\fIflow\fR] .fi .LP @@ -63,8 +64,8 @@ The following subcommands are supported: .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-z\fR \fIzonename\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 @@ -102,6 +103,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 @@ -136,8 +147,8 @@ values. Flow properties are documented in the "Flow Properties" section, below. .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 @@ -175,13 +186,23 @@ If a link is specified, remove all flows from that link. If a single flow is specified, remove only that 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 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-o\fR \fIfield\fR[,...]] [\fB-l\fR \fIlink\fR] [\fB-z\fR \fIzonename\fR] [\fIflow\fR]\fR .ad .sp .6 .RS 4n @@ -220,6 +241,16 @@ The name of the link the flow is on. .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\fBipaddr\fR\fR .ad .sp .6 diff --git a/usr/src/man/man8/prstat.8 b/usr/src/man/man8/prstat.8 index bb1875f144..9eecb2febd 100644 --- a/usr/src/man/man8/prstat.8 +++ b/usr/src/man/man8/prstat.8 @@ -14,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 @@ -446,9 +446,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(5) 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(5) 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/man8/reboot.8 b/usr/src/man/man8/reboot.8 index 8115fe5adc..88f46c2db8 100644 --- a/usr/src/man/man8/reboot.8 +++ b/usr/src/man/man8/reboot.8 @@ -139,8 +139,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/man8/route.8 b/usr/src/man/man8/route.8 index 3c60c4a0d6..41c0595c0d 100644 --- a/usr/src/man/man8/route.8 +++ b/usr/src/man/man8/route.8 @@ -9,34 +9,34 @@ route \- manually manipulate the routing tables .SH SYNOPSIS .nf -\fBroute\fR [\fB-fnvq\fR] \fIsub-command\fR [ [\fImodifiers\fR] \fIargs\fR] +\fBroute\fR [\fB-fnvq\fR] [\fB-z\fR \fIzone\fR] \fIsub-command\fR [ [\fImodifiers\fR] \fIargs\fR] .fi .LP .nf -\fBroute\fR [\fB-fnvq\fR] [\fB-p\fR [\fB-R\fR \fIroot-dir\fR]] add | delete [\fImodifiers\fR] \fIdestination\fR \fIgateway\fR +\fBroute\fR [\fB-fnvq\fR] [\fB-z\fR \fIzone\fR] [\fB-p\fR [\fB-R\fR \fIroot-dir\fR]] add | delete [\fImodifiers\fR] \fIdestination\fR \fIgateway\fR [\fIargs\fR] .fi .LP .nf -\fBroute\fR [\fB-fnvq\fR] change | get [\fImodifiers\fR] \fIdestination\fR +\fBroute\fR [\fB-fnvq\fR] [\fB-z\fR \fIzone\fR] change | get [\fImodifiers\fR] \fIdestination\fR [\fIgateway\fR [\fIargs\fR]] .fi .LP .nf -\fBroute\fR [\fB-fn\fR] monitor [\fImodifiers\fR] +\fBroute\fR [\fB-fn\fR] [\fB-z\fR \fIzone\fR] monitor [\fImodifiers\fR] .fi .LP .nf -\fBroute\fR [\fB-fnvq\fR] flush [\fImodifiers\fR] +\fBroute\fR [\fB-fnvq\fR] [\fB-z\fR \fIzone\fR] flush [\fImodifiers\fR] .fi .LP .nf -\fBroute\fR \fB-p\fR [\fB-R\fR \fIroot-dir\fR] show +\fBroute\fR \fB-p\fR [\fB-R\fR \fIroot-dir\fR] [\fB-z\fR \fIzone\fR] show .fi .SH DESCRIPTION @@ -127,6 +127,16 @@ addition, certain checks, such as the existence of network interfaces used with Print additional details in verbose mode. .RE +.sp +.ne 2 +.na +\fB\fB-z\fR \fIzone\fR\fR +.ad +.RS 15n +Apply commands to the zone \fIzone\fR. The zone must be running and must not +be a shared-\fBIP\fR zone. +.RE + .SS "Subcommands" The following subcommands are supported: .sp diff --git a/usr/src/man/man8/savecore.8 b/usr/src/man/man8/savecore.8 index a8ce5071e5..099d3671e4 100644 --- a/usr/src/man/man8/savecore.8 +++ b/usr/src/man/man8/savecore.8 @@ -3,13 +3,13 @@ .\" Copyright (c) 1983 Regents of the University of California. All rights reserved. The Berkeley software License Agreement specifies the terms and conditions for redistribution. .\" Copyright 2013 Nexenta Systems, Inc. All Rights Reserved. .\" Copyright 2019 Joyent, Inc. -.TH SAVECORE 8 "February 22, 2019" +.TH SAVECORE 8 "Jun 15, 2019" .SH NAME savecore \- save a crash dump of the operating system .SH SYNOPSIS .LP .nf -\fB/usr/bin/savecore\fR [\fB-L\fR | \fB-r\fR] [\fB-vd\fR] [\fB-f\fR \fIdumpfile\fR] [\fIdirectory\fR] +\fB/usr/bin/savecore\fR [\fB-L\fR | \fB-r\fR] [\fB-vd\fR] [\fB-k\fR \fIkeyfile\fR] [\fB-f\fR \fIdumpfile\fR] [\fIdirectory\fR] .fi .SH DESCRIPTION @@ -61,10 +61,21 @@ the dump has already been saved. \fB\fB-f\fR \fIdumpfile\fR\fR .ad .RS 15n -Attempt to save a crash dump from the specified file instead of from the -system's current dump device. This option may be useful if the information -stored on the dump device has been copied to an on-disk file by means of the -\fBdd\fR(8) command. +Uncompress and save a crash dump and kernel namelist data from the specified +compressed dump file. +.RE + +.sp +.ne 2 +.na +\fB\fB-k\fR \fIkeyfile\fR\fR +.ad +.RS 15n +Specifies that the dump should be decrypted based on the key found +in \fIkeyfile\fR. Encrypted dumps are always decrypted before being stored +in the file system, and must always be stored compressed. (That is, +decompression can only occur on a decrypted dump.) The key must match the +key specified when dump encryption is enabled via \fBdumpadm\fR. .RE .sp @@ -73,7 +84,7 @@ stored on the dump device has been copied to an on-disk file by means of the \fB\fB-L\fR\fR .ad .RS 15n -Save a crash dump of the live running Solaris system, without actually +Save a crash dump of the live running system, without actually rebooting or altering the system in any way. This option forces \fBsavecore\fR to save a live snapshot of the system to the dump device, and then immediately to retrieve the data and to write it out to a new set of crash dump files in @@ -183,7 +194,6 @@ default crash dump directory .BR syslog (3C), .BR attributes (7), .BR smf (7), -.BR dd (8), .BR dumpadm (8), .BR svcadm (8) .SH NOTES diff --git a/usr/src/man/man8/smbios.8 b/usr/src/man/man8/smbios.8 index 565a12018a..122527bc35 100644 --- a/usr/src/man/man8/smbios.8 +++ b/usr/src/man/man8/smbios.8 @@ -1,9 +1,10 @@ '\" te .\" Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved. +.\" Copyright 2018 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 SMBIOS 8 "Aug 31, 2005" +.TH SMBIOS 8 "March 29, 2018" .SH NAME smbios \- display the contents of a System Management BIOS image .SH SYNOPSIS @@ -13,7 +14,6 @@ smbios \- display the contents of a System Management BIOS image .fi .SH DESCRIPTION -.sp .LP The \fBsmbios\fR utility displays the contents of the System Management BIOS (SMBIOS) image exported by the current system or stored in a file. SMBIOS is an @@ -37,7 +37,6 @@ applied to the resulting file to display its content. readable fashion. If \fBsmbios\fR does not recognize a structure's type or content, the raw hexadecimal data for the structure is displayed. .SH OPTIONS -.sp .LP The following options are supported: .sp @@ -131,7 +130,6 @@ human-readable output for the selected structures. .RE .SH OPERANDS -.sp .LP The following operands are supported: .sp @@ -145,7 +143,6 @@ SMBIOS image. .RE .SH EXIT STATUS -.sp .LP The following exit values are returned: .sp @@ -178,7 +175,6 @@ Invalid command-line options were specified. .RE .SH FILES -.sp .ne 2 .na \fB\fB/dev/smbios\fR \fR @@ -189,7 +185,6 @@ snapshot of the current system SMBIOS image. .RE .SH ATTRIBUTES -.sp .LP See \fBattributes\fR(7) for descriptions of the following attributes: .sp @@ -208,7 +203,6 @@ Interface Stability See below. .LP The command-line options are Evolving. The human-readable output is Unstable. .SH SEE ALSO -.sp .LP .BR smbios (4D), .BR attributes (7), @@ -217,7 +211,6 @@ The command-line options are Evolving. The human-readable output is Unstable. .LP \fISystem Management BIOS Reference Specification\fR (see http://www.dmtf.org) .SH NOTES -.sp .LP The implementation of a System Management BIOS image is entirely at the discretion of the system and BIOS vendors. Not all systems export an SMBIOS. @@ -225,3 +218,8 @@ The SMBIOS structure content varies widely between systems and BIOS vendors and frequently does not comply with the guidelines included in the specification. Some structure fields might not be filled in by the BIOS at all, and others might be filled inwith non-conforming values. +.sp +.LP +This utility incorrectly interprets the first three fields of the system +information UUID field as network-endian; the SMBIOS specification defines them +as little-endian. The "UUID (Endian-corrected)" field has the correct value. diff --git a/usr/src/man/man8/snoop.8 b/usr/src/man/man8/snoop.8 index 433353a3fc..5593bcc480 100644 --- a/usr/src/man/man8/snoop.8 +++ b/usr/src/man/man8/snoop.8 @@ -1,6 +1,7 @@ '\" te .\" Copyright 2021 Joyent, Inc. .\" 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-afqrCDINPSvV\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 @@ -307,6 +308,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/man8/svc.startd.8 b/usr/src/man/man8/svc.startd.8 index 7467e05035..2fcf917fde 100644 --- a/usr/src/man/man8/svc.startd.8 +++ b/usr/src/man/man8/svc.startd.8 @@ -361,10 +361,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/man8/tunefs.8 b/usr/src/man/man8/tunefs.8 index ea24a86629..16b04b85fa 100644 --- a/usr/src/man/man8/tunefs.8 +++ b/usr/src/man/man8/tunefs.8 @@ -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 8 "Dec 5, 2003" +.TH TUNEFS 8 "Sep 19, 2013" .SH NAME tunefs \- tune an existing UFS file system .SH SYNOPSIS @@ -123,3 +123,8 @@ encountering files greater than or equal to 2 Gbyte ( 2^31 bytes). .BR largefile (7), .BR mkfs_ufs (8), .BR newfs (8) +.\" 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/man8/vfsstat.8 b/usr/src/man/man8/vfsstat.8 new file mode 100644 index 0000000000..0a4c3a1a9e --- /dev/null +++ b/usr/src/man/man8/vfsstat.8 @@ -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" "8" "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(8) +as closely as possible\. When only one zone is actively performing +disk I/O, the results from iostat(8) 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(8) will be similar only when most +operations require a disk access\. +. +.P +As with iostat(8), 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(8), ziostat(8), mpstat(8) +. +.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/man8/vndadm.8 b/usr/src/man/man8/vndadm.8 new file mode 100644 index 0000000000..8bb79bb81a --- /dev/null +++ b/usr/src/man/man8/vndadm.8 @@ -0,0 +1,650 @@ +'\" 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 8 "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(8)) +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 + +fcntl(2), fcntl.h(3HEAD), libvnd(3LIB), vnd(7D), dladm(8), ipadm(8), vndstat(8) diff --git a/usr/src/man/man8/vndstat.8 b/usr/src/man/man8/vndstat.8 new file mode 100644 index 0000000000..826ab8cd97 --- /dev/null +++ b/usr/src/man/man8/vndstat.8 @@ -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 8 "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(7) 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 + +vnd(4M), dlstat(8), nicstat(8), vndadm(8) diff --git a/usr/src/man/man8/zfs.8 b/usr/src/man/man8/zfs.8 index 316082a0cd..dd357ee5ac 100644 --- a/usr/src/man/man8/zfs.8 +++ b/usr/src/man/man8/zfs.8 @@ -29,7 +29,7 @@ .\" Copyright 2019 Joyent, Inc. .\" Copyright (c) 2018 Datto Inc. .\" -.Dd February 26, 2019 +.Dd Jul 22, 2019 .Dt ZFS 8 .Os .Sh NAME @@ -40,12 +40,12 @@ .Op Fl \&? .Nm .Cm create -.Op Fl p +.Op Fl Pnpv .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ... .Ar filesystem .Nm .Cm create -.Op Fl ps +.Op Fl Pnpsv .Op Fl b Ar blocksize .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ... .Fl V Ar size Ar volume @@ -2225,7 +2225,7 @@ Displays a help message. .It Xo .Nm .Cm create -.Op Fl p +.Op Fl Pnpv .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ... .Ar filesystem .Xc @@ -2254,6 +2254,48 @@ Any property specified on the command line using the .Fl o option is ignored. If the target filesystem already exists, the operation completes successfully. +.It Fl n +Do a dry-run +.Pq Qq No-op +creation. +No datasets will be created. +This is useful in conjunction with the +.Fl v +or +.Fl P +flags to validate properties that are passed via +.Fl o +options and those implied by other options. +The actual dataset creation can still fail due to insufficient privileges or +available capacity. +.It Fl P +Print machine-parsable verbose information about the created dataset. +Each line of output contains a key and one or two values, all separated by tabs. +The +.Sy create_ancestors +and +.Sy create +keys have +.Em filesystem +as their only value. +The +.Sy create_ancestors +key only appears if the +.Fl p +option is used. +The +.Sy property +key has two values, a property name and that property's value. +The +.Sy property +key may appear zero or more times, once for each property that will be set local +to +.Em filesystem +due to the use of the +.Fl o +option. +.It Fl v +Print verbose information about the created dataset. .El .It Xo .Nm @@ -2310,6 +2352,52 @@ See in the .Sx Native Properties section for more information about sparse volumes. +.It Fl n +Do a dry-run +.Pq Qq No-op +creation. +No datasets will be created. +This is useful in conjunction with the +.Fl v +or +.Fl P +flags to validate properties that are passed via +.Fl o +options and those implied by other options. +The actual dataset creation can still fail due to insufficient privileges or +available capacity. +.It Fl P +Print machine-parsable verbose information about the created dataset. +Each line of output contains a key and one or two values, all separated by tabs. +The +.Sy create_ancestors +and +.Sy create +keys have +.Em volume +as their only value. +The +.Sy create_ancestors +key only appears if the +.Fl p +option is used. +The +.Sy property +key has two values, a property name and that property's value. +The +.Sy property +key may appear zero or more times, once for each property that will be set local +to +.Em volume +due to the use of the +.Fl b +or +.Fl o +options, as well as +.Sy refreservation +if the volume is not sparse. +.It Fl v +Print verbose information about the created dataset. .El .It Xo .Nm diff --git a/usr/src/man/man8/zoneadm.8 b/usr/src/man/man8/zoneadm.8 index 645da71e4d..92feec2693 100644 --- a/usr/src/man/man8/zoneadm.8 +++ b/usr/src/man/man8/zoneadm.8 @@ -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 @@ -413,24 +429,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/man8/zonecfg.8 b/usr/src/man/man8/zonecfg.8 index 13f5a47b68..f5c245b77a 100644 --- a/usr/src/man/man8/zonecfg.8 +++ b/usr/src/man/man8/zonecfg.8 @@ -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 .\" Copyright 2021 OmniOS Community Edition (OmniOSce) Association. .\" 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. @@ -11,17 +11,17 @@ zonecfg \- set up zone configuration .SH SYNOPSIS .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 @@ -42,7 +42,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 @@ -362,6 +363,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 @@ -376,7 +387,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 @@ -659,7 +670,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 @@ -698,6 +719,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 @@ -851,7 +876,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 @@ -867,10 +892,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 @@ -980,6 +1010,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 @@ -1003,13 +1043,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 @@ -1223,6 +1272,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 You can use the \fBadd\fR and \fBselect\fR subcommands to select a specific resource, at which point the scope changes to that resource. The \fBend\fR and @@ -1311,8 +1370,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 @@ -1334,6 +1392,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 @@ -1413,18 +1473,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/man9e/ddi_ufm.9e b/usr/src/man/man9e/ddi_ufm.9e index 4b26534f63..57ca747048 100644 --- a/usr/src/man/man9e/ddi_ufm.9e +++ b/usr/src/man/man9e/ddi_ufm.9e @@ -19,6 +19,7 @@ .Nm ddi_ufm , .Nm ddi_ufm_op_nimages , .Nm ddi_ufm_op_fill_image , +.Nm ddi_ufm_op_nslots , .Nm ddi_ufm_op_fill_slot , .Nm ddi_ufm_op_getcaps .Nd DDI upgradable firmware module entry points diff --git a/usr/src/man/man9f/Makefile b/usr/src/man/man9f/Makefile index 267d9f4253..bcefcfe990 100644 --- a/usr/src/man/man9f/Makefile +++ b/usr/src/man/man9f/Makefile @@ -768,7 +768,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 \ @@ -1534,7 +1536,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 diff --git a/usr/src/man/man9f/bzero.9f b/usr/src/man/man9f/bzero.9f index 94ffbaeb40..365362a76d 100644 --- a/usr/src/man/man9f/bzero.9f +++ b/usr/src/man/man9f/bzero.9f @@ -10,20 +10,15 @@ bzero \- clear memory for a given number of bytes .SH SYNOPSIS .LP .nf -#include <sys/types.h> -#include <sys/ddi.h> - - +#include <sys/sunddi.h> \fBvoid\fR \fBbzero\fR(\fBvoid *\fR\fIaddr\fR, \fBsize_t\fR \fIbytes\fR); .fi .SH INTERFACE LEVEL -.sp .LP Architecture independent level 1 (DDI/DKI). .SH PARAMETERS -.sp .ne 2 .na \fB\fIaddr\fR\fR @@ -42,17 +37,14 @@ The number of bytes to clear starting at \fIaddr\fR. .RE .SH DESCRIPTION -.sp .LP The \fBbzero()\fR function clears a contiguous portion of memory by filling it with zeros. .SH CONTEXT -.sp .LP The \fBbzero()\fR function can be called from user, interrupt, or kernel context. .SH SEE ALSO -.sp .LP .BR bcopy (9F), .BR clrbuf (9F), @@ -61,7 +53,6 @@ context. .LP \fIWriting Device Drivers\fR .SH WARNINGS -.sp .LP The address range specified must be within the kernel space. No range checking is done. If an address outside of the kernel space is selected, the driver may diff --git a/usr/src/man/man9f/ddi_fm_init.9f b/usr/src/man/man9f/ddi_fm_init.9f index f9dd4ba223..459ff4e8fd 100644 --- a/usr/src/man/man9f/ddi_fm_init.9f +++ b/usr/src/man/man9f/ddi_fm_init.9f @@ -1,175 +1,164 @@ -'\" te +.\" .\" Copyright (c) 2007, Sun Microsystems, 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 DDI_FM_INIT 9F "May 14, 2007" -.SH NAME -ddi_fm_init, ddi_fm_fini, ddi_fm_capable \- initialize and get the FM +.\" 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] +.\" +.\" Copyright (c) 2018, Joyent, INc. +.\" +.Dd September 13, 2018 +.Dt DDI_FM_INIT 9F +.Os +.Sh NAME +.Nm ddi_fm_init , +.Nm ddi_fm_fini , +.Nm ddi_fm_capable +.Nd initialize and get the FM capabilities for a device instance capabilities for a device instance -.SH SYNOPSIS -.nf -#include <sys/ddifm.h> - -\fBvoid\fR \fBddi_fm_init\fR(\fBdev_info_t\fR *\fIdip\fR, \fBint\fR *\fIfm_capability\fR, - \fBddi_iblock_cookie_t\fR *\fIibcp\fR); -.fi - -.LP -.nf -\fBvoid\fR \fBddi_fm_fini\fR(\fBdev_info_t\fR *\fIdip\fR); -.fi - -.LP -.nf -\fBint\fR \fBddi_fm_capable\fR(\fBdev_info_t\fR *\fIdip\fR, \fBint\fR *\fIfm_capability\fR); -.fi - -.SH INTERFACE LEVEL -illumos DDI specific (illumos DDI) -.SH PARAMETERS -\fBddi_fm_init()\fR -.sp -.ne 2 -.na -\fB\fIdip\fR\fR -.ad -.RS 17n -Pointer to the \fBdev_info\fR structure -.RE - -.sp -.ne 2 -.na -\fB\fIfm_capability\fR\fR -.ad -.RS 17n +.Sh SYNOPSIS +.In sys/ddifm.h +.Ft void +.Fo ddi_fm_init +.Fa "dev_info_t *dip" +.Fa "int *fm_capability" +.Fa "ddi_iblock_cookie_t *ibcp" +.Fc +.Ft void +.Fo ddi_fm_fini +.Fa "dev_info_t *dip" +.Fc +.Ft int +.Fo ddi_fm_capable +.Fa "dev_info_t *dip" +.Fc +.Sh INTERFACE LEVEL +.Sy Committed - +illumos DDI specific +.Sh Parameters +.Bl -tag -width Fa +.It Fa dip +Pointer to the driver's +.Sy dev_info +structure. +.It Fa fm_capability Fault Management capability bit mask -.RE - -.sp -.ne 2 -.na -\fB\fIibcp\fR\fR -.ad -.RS 17n +.It Fa ibcp Pointer to where the interrupt block cookie should be returned. -.RE - -.SH DESCRIPTION -A device driver can declare its fault management capabilities to the \fBI/O\fR -Fault Management framework by calling \fBddi_fm_init()\fR. The -\fBddi_fm_init()\fR function allocates and initializes resources according to +.El +.Sh DESCRIPTION +A device driver can declare its fault management capabilities to the I/O +Fault Management framework by calling the +.Fn ddi_fm_init +function. +The +.Fn ddi_fm_init +function allocates and initializes resources according to the bitwise-inclusive-OR of the fault management capabilities, described in the following and supported by the driver's immediate nexus parent. -.sp -.ne 2 -.na -\fB\fBDDI_FM_NOT_CAPABLE\fR\fR -.ad -.RS 26n -The driver does not support any \fBFMA\fR features. This is the default value -assigned to device drivers. -.RE - -.sp -.ne 2 -.na -\fB\fBDDI_FM_EREPORT_CAPABLE\fR\fR -.ad -.RS 26n -The driver generates \fBFMA\fR protocol error events (\fBereports\fR) upon the -detection of an error condition. -.RE - -.sp -.ne 2 -.na -\fB\fBDDI_FM_ACCCHK_CAPABLE\fR\fR -.ad -.RS 26n +.Bl -tag -width Vt +.It Vt DDI_FM_NOT_CAPABLE +The driver does not support any FMA features. +This is the default value assigned to device drivers. +.Pp +If the value of the capability bits is equal to +.Vt DDI_FM_NOT_CAPABLE , +then no capability bits will be set. +Conversely, if a capability bit is set, then the capability value will +not be equal to +.Vt DDI_FM_NOT_CAPABLE . +.It Vt DDI_FM_EREPORT_CAPABLE +The driver generates FMA protocol error events +.Pq Sy ereports +upon the detection of an error condition. +.It Vt DDI_FM_ACCCHK_CAPABLE The driver checks for errors upon the completion of one or more access -\fBI/O\fR transactions. -.RE - -.sp -.ne 2 -.na -\fB\fBDDI_FM_DMACHK_CAPABLE\fR\fR -.ad -.RS 26n -The driver checks for errors upon the completion of one or more \fBDMA\fR -\fBI/O\fR transactions. -.RE - -.sp -.ne 2 -.na -\fB\fBDDI_FM_ERRCB_CAPABLE\fR\fR -.ad -.RS 26n +I/O transactions. +.It Vt DDI_FM_DMACHK_CAPABLE +The driver checks for errors upon the completion of one or more DMA +I/O transactions. +.It Vt DDI_FM_ERRCB_CAPABLE The driver is capable of error handler callback registration. -.RE - -.sp -.LP +.El +.Pp If the parent nexus is not capable of supporting any one of the requested capabilities, the associated bit will not be set and returned as such to the -driver. Before returning from \fBddi_fm_init()\fR, the \fBI/O\fR Fault -Management framework creates a set of fault management capability properties: -\fBfm-ereport-capable\fR, \fBfm-errcb-capable\fR, \fBfm-accchk-capable\fR, and -\fBfm-dmachk-capable\fR. The current supported fault management capability -levels are observable via \fBprtconf\fR(8). -.sp -.LP +driver. +Before returning from +.Fn ddi_fm_init , +the I/O Fault Management framework creates a set of fault management capability +properties: +.Sy fm-ereport-capable , +.Sy fm-errcb-capable , +.Sy fm-accchk-capable , +and +.Sy fm-dmachk-capable . +The current supported fault management capability levels are observable via +.Xr prtconf 8 . +.Pp A driver can support the administrative selection of fault management capabilities by exporting and setting a fault management capability level -property in its \fBdriver.conf\fR(5) file to the values described above. The -\fBfm_capable\fR properties must be set and read prior to calling -\fBddi_fm_init()\fR with the desired capability list. -.sp -.ne 2 -.na -\fB\fBddi_fm_fini()\fR\fR -.ad -.RS 17n -This function cleans up resources allocated to support fault management for the -\fIdip\fR structure. -.RE - -.sp -.ne 2 -.na -\fB\fBddi_fm_capable()\fR\fR -.ad -.RS 20n -This function returns the capability bit mask currently set for the \fIdip\fR -structure. -.RE - -.SH CONTEXT -These functions can be called from kernel context in a driver \fBattach\fR(9E) -or \fBdetach\fR(9E) operation. -.SH ATTRIBUTES -See \fBattributes\fR(7) for descriptions of the following attributes: -.sp - -.sp -.TS -box; -c | c -l | l . -ATTRIBUTE TYPE ATTRIBUTE VALUE -_ -Interface Stability Committed -.TE - -.SH SEE ALSO -.BR driver.conf (5), -.BR attributes (7), -.BR prtconf (8), -.BR attach (9E), -.BR detach (9E) -.sp -.LP -\fIWriting Device Drivers\fR +property in its +.Xr driver.conf 5 +file to the values described above. +The +.Sy fm_capable +properties must be set and read prior to calling +.Fn ddi_fm_init +with the desired capability list. +.Pp +The +.Fn ddi_fm_fini +function cleans up the kernel infrastructure set up during a call to the +.Fn ddi_fm_init +function. +If the driver did not call +.Fn ddi_fm_init +or the capability returned in +.Fa fm_capability +was +.Vt DDI_FM_NOT_CAPABLE +then the driver must not call +.Fn ddi_fm_fini . +.Pp +The +.Fn ddi_fm_capable +function returns the capability bit mask currently set for the device +instance identified by +.Fa dip . +.Sh CONTEXT +The +.Fn ddi_fm_init +and +.Fn ddi_fm_fini +functions may only be called from kernel context during a driver's +.Xr attach 9E +and +.Xr detach 9E +entry points. +.Sh RETURN VALUES +Upon successful completion, the +.Fn ddi_fm_capable +function returns the FM capability bit mask currently in use. +If no capabilities are in use then +.Vt DDI_FM_NOT_CAPABLE +is returned. +.Sh SEE ALSO +.Xr driver.conf 5 , +.Xr prtconf 8 , +.Xr attach 9E , +.Xr detach 9E +.Pp +.Rs +.%B Writing Device Drivers +.Re |