summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Foster <tim.foster@joyent.com>2020-05-14 09:21:30 +0000
committerTim Foster <tim.foster@joyent.com>2020-05-14 09:21:30 +0000
commit079d21092bf08f7d2b630a79d10a6e5b7e8230ca (patch)
tree1f37696d5f03f0e837b942da1b992d26cab9110a
parentc07ad899dd57a908a34e0d0f1ca6ddeb1b24af16 (diff)
parent91a7ed35601b9dac7c03b16025b401dc9f7a6bbd (diff)
downloadillumos-joyent-079d21092bf08f7d2b630a79d10a6e5b7e8230ca.tar.gz
[illumos-gate merge]
commit 91a7ed35601b9dac7c03b16025b401dc9f7a6bbd 12720 _fini(9E) could note it's not called when _init fails commit 57f6b2a25cc23b5c46f9c6de51402167ec6754cc 12719 ioctl(9E) should mention what to return for an unknown command commit 4c819f48a094cdf29d044bcea57733ebac5f688f 12675 want kthread worker interface
-rw-r--r--usr/src/man/man9e/_fini.9e23
-rw-r--r--usr/src/man/man9e/ioctl.9e21
-rw-r--r--usr/src/uts/common/fs/proc/prsubr.c4
3 files changed, 13 insertions, 35 deletions
diff --git a/usr/src/man/man9e/_fini.9e b/usr/src/man/man9e/_fini.9e
index 19cd7b665f..72bfbb8979 100644
--- a/usr/src/man/man9e/_fini.9e
+++ b/usr/src/man/man9e/_fini.9e
@@ -3,11 +3,10 @@
.\" 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 _FINI 9E "Jan 22, 2002"
+.TH _FINI 9E "May 06, 2020"
.SH NAME
_fini, _info, _init \- loadable module configuration entry points
.SH SYNOPSIS
-.LP
.nf
#include <sys/modctl.h>
@@ -27,13 +26,10 @@ _fini, _info, _init \- loadable module configuration entry points
.fi
.SH INTERFACE LEVEL
-.sp
-.LP
Solaris DDI specific (Solaris DDI). These entry points are required. You must
write them.
.SH PARAMETERS
.SS "_info(\|)"
-.sp
.ne 2
.na
\fB\fImodinfop\fR \fR
@@ -43,8 +39,6 @@ A pointer to an opaque \fBmodinfo\fR structure.
.RE
.SH DESCRIPTION
-.sp
-.LP
\fB_init()\fR initializes a loadable module. It is called before any other
routine in a loadable module. \fB_init()\fR returns the value returned by
\fBmod_install\fR(9F). The module may optionally perform some other work before
@@ -61,10 +55,10 @@ returns the value returned by \fBmod_info\fR(9F).
system wants to unload a module. If the module determines that it can be
unloaded, then \fB_fini()\fR returns the value returned by
\fBmod_remove\fR(9F). Upon successful return from \fB_fini()\fR no other
-routine in the module will be called before \fB_init()\fR is called.
+routine in the module will be called before \fB_init()\fR is called. If
+\fB_init()\fR did not successfully complete, \fB_fini()\fR will not be
+called.
.SH RETURN VALUES
-.sp
-.LP
\fB_init()\fR should return the appropriate error number if there is an error,
otherwise it should return the return value from \fBmod_install\fR(9F).
.sp
@@ -79,7 +73,6 @@ resources, such as mutexes and calls to \fBddi_soft_state_fini\fR(9F), should
only be destroyed in \fB_fini()\fR after \fBmod_remove()\fR returns
successfully.
.SH EXAMPLES
-.LP
\fBExample 1 \fRInitializing and Freeing a Mutex
.sp
.LP
@@ -158,8 +151,6 @@ _fini(void)
.in -2
.SH SEE ALSO
-.sp
-.LP
\fBadd_drv\fR(1M), \fBmod_info\fR(9F), \fBmod_install\fR(9F),
\fBmod_remove\fR(9F), \fBmutex\fR(9F), \fBmodldrv\fR(9S), \fBmodlinkage\fR(9S),
\fBmodlstrmod\fR(9S)
@@ -167,17 +158,11 @@ _fini(void)
.LP
\fIWriting Device Drivers\fR
.SH WARNINGS
-.sp
-.LP
Do not change the structures referred to by the \fBmodlinkage\fR structure
after the call to \fBmod_install()\fR, as the system may copy or change them.
.SH NOTES
-.sp
-.LP
Even though the identifiers \fB_fini()\fR, \fB_info()\fR, and \fB_init()\fR
appear to be declared as globals, their scope is restricted by the kernel to
the module that they are defined in.
.SH BUGS
-.sp
-.LP
On some implementations \fB_info()\fR may be called before \fB_init()\fR.
diff --git a/usr/src/man/man9e/ioctl.9e b/usr/src/man/man9e/ioctl.9e
index afb43407d0..796d92a37f 100644
--- a/usr/src/man/man9e/ioctl.9e
+++ b/usr/src/man/man9e/ioctl.9e
@@ -3,11 +3,10 @@
.\" 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 IOCTL 9E "Dec 3, 1996"
+.TH IOCTL 9E "May 6, 2020"
.SH NAME
ioctl \- control a character device
.SH SYNOPSIS
-.LP
.nf
#include <sys/cred.h>
#include <sys/file.h>
@@ -23,11 +22,8 @@ ioctl \- control a character device
.fi
.SH INTERFACE LEVEL
-.sp
-.LP
Architecture independent level 1 (DDI/DKI). This entry point is \fBoptional\fR.
.SH ARGUMENTS
-.sp
.ne 2
.na
\fB\fIdev\fR\fR
@@ -112,8 +108,6 @@ value which is valid only if the \fBioctl()\fR succeeds.
.RE
.SH DESCRIPTION
-.sp
-.LP
\fBioctl()\fR provides character-access drivers with an alternate entry point
that can be used for almost any operation other than a simple transfer of
characters in and out of buffers. Most often, \fBioctl()\fR is used to control
@@ -132,7 +126,10 @@ I/O control commands are used to implement the terminal settings passed from
\fBttymon\fR(1M) and \fBstty\fR(1), to format disk devices, to implement a
trace driver for debugging, and to clean up character queues. Since the kernel
does not interpret the command type that defines the operation, a driver is
-free to define its own commands.
+free to define its own commands. Drivers must be prepared to receive commands
+that they do not recognize or are in contexts that they do not expect. In the
+case where \fIcmd\fR is unknown, it is recommended that the driver return
+\fBENOTTY\fR.
.sp
.LP
Drivers that use an \fBioctl()\fR routine typically have a command to ``read''
@@ -205,13 +202,10 @@ action that should be taken. However, the command passed to the driver by the
user process is an integer value associated with the command name in the
header.
.SH RETURN VALUES
-.sp
-.LP
\fBioctl()\fR should return \fB0\fR on success, or the appropriate error
number. The driver may also set the value returned to the calling process
through \fIrval_p\fR.
.SH EXAMPLES
-.LP
\fBExample 1 \fR\fBioctl()\fR entry point
.sp
.LP
@@ -263,8 +257,6 @@ xxioctl(dev_t dev, int cmd, intptr_t arg, int mode,
.in -2
.SH SEE ALSO
-.sp
-.LP
\fBstty\fR(1), \fBttymon\fR(1M), \fBdkio\fR(7I), \fBfbio\fR(7I),
\fBtermio\fR(7I), \fBopen\fR(9E), \fBput\fR(9E), \fBsrv\fR(9E),
\fBcopyin\fR(9F), \fBcopyout\fR(9F), \fBddi_copyin\fR(9F),
@@ -273,7 +265,6 @@ xxioctl(dev_t dev, int cmd, intptr_t arg, int mode,
.LP
\fIWriting Device Drivers\fR
.SH WARNINGS
-.sp
.LP
Non-STREAMS driver \fBioctl()\fR routines must make sure that user data is
copied into or out of the kernel address space explicitly using
@@ -288,8 +279,6 @@ even when in user context.
Failure to use the appropriate copying routines can result in panics under load
on some platforms, and reproducible panics on others.
.SH NOTES
-.sp
-.LP
STREAMS drivers do not have \fBioctl()\fR routines. The stream head converts
I/O control commands to \fBM_IOCTL\fR messages, which are handled by the
driver's \fBput\fR(9E) or \fBsrv\fR(9E) routine.
diff --git a/usr/src/uts/common/fs/proc/prsubr.c b/usr/src/uts/common/fs/proc/prsubr.c
index 08aee63610..44ed9c4de3 100644
--- a/usr/src/uts/common/fs/proc/prsubr.c
+++ b/usr/src/uts/common/fs/proc/prsubr.c
@@ -21,7 +21,11 @@
/*
* Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
+<<<<<<< HEAD
* Copyright 2019 Joyent, Inc.
+=======
+ * Copyright 2017, Joyent, Inc.
+>>>>>>> 91a7ed35601b9dac7c03b16025b401dc9f7a6bbd
* Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
*/