diff --git a/share/man/man9/at_exit.9 b/share/man/man9/at_exit.9 index a2a70f5a0f8f..d6cd47d2ac24 100644 --- a/share/man/man9/at_exit.9 +++ b/share/man/man9/at_exit.9 @@ -1,79 +1,80 @@ .\" .\" Copyright (c) 1996 Julian Elischer .\" .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``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 DEVELOPERS 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. .\" -.\" $Id: at_exit.9,v 1.1 1996/04/13 16:59:07 joerg Exp $ +.\" $Id: at_exit.9,v 1.1 1996/08/19 02:22:08 julian Exp $ .\" " .Dd August 15, 1996 .Os .Dt AT_EXIT 9 .Sh NAME .Nm at_exit , .Nm rm_at_exit .Nd ask that a function be run at exit. .Sh SYNOPSIS .Fd #include .Ft typedef void \*(lp*exitlist_fn\*(rp \*(lpstruct proc *\*(rp; .Ft int .Fn at_exit "exitlist_fn func" .Ft int .Fn rm_at_exit "exitlist_fn func" .Sh DESCRIPTION The .Nm at_exit facility allows a kernel module to ensure that it is notified at any process exit. The function .Ar func is called with the a pointer to the exiting process's proc structure. .Pp If the requirement for notification is removed, then the function .Nm rm_at_exit must be called with the exact .Ar func argument as the corresponding call to .Fn at_exit . .Pp .Sh RETURN VALUES .Nm at_exit returns an errno, 0 meaning success. .Nm rm_at_exit returns the number of items removed (should be 0 or 1). .Sh SEE ALSO .Xr exit 2 .Sh HISTORY The .Nm at_exit -appeared in FreeBSD 2.2 +appeared in +.Fx 2.2 . .Sh BUGS Since the exit queue is not sorted and items are added to the head, order of execution is reversed to that of insertion. .Sh AUTHORS The function was written by .ie Julian Elischer (julian@freebsd.org) .el Julian Elischer (julian@freebsd.org) diff --git a/share/man/man9/at_fork.9 b/share/man/man9/at_fork.9 index 1c13750afeb8..5aaf08fc71d4 100644 --- a/share/man/man9/at_fork.9 +++ b/share/man/man9/at_fork.9 @@ -1,83 +1,84 @@ .\" .\" Copyright (c) 1996 Julian Elischer .\" .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``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 DEVELOPERS 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. .\" -.\" $Id: at_fork.9,v 1.1 1996/04/13 16:59:07 joerg Exp $ +.\" $Id: at_fork.9,v 1.1 1996/08/19 02:22:11 julian Exp $ .\" " .Dd August 15, 1996 .Os .Dt AT_FORK 9 .Sh NAME .Nm at_fork , .Nm rm_at_fork .Nd ask that a function be run at fork. .Sh SYNOPSIS .Fd #include .Ft typedef void \*(lp*forklist_fn\*(rp \*(lpstruct proc*, struct proc*, int\*(rp; .Ft void .Fn at_fork "forklist_fn func" .Ft void .Fn rm_at_fork "forklist_fn func" .Sh DESCRIPTION The .Nm at_fork facility allows a kernel module to ensure that it is notified at any process fork. The function .Ar func is called with the a pointer to the forking process's proc structure, a pointer to the child's process structure and a flag word, as used in .Xr rfork 2 to indicate the type of fork. .Pp If the requirement for notification is removed, then the function .Nm rm_at_fork must be called with the exact .Ar func argument as the corresponding call to .Fn at_fork . .Pp .Sh RETURN VALUES .Nm at_fork returns an errno, 0 meaning success. .Nm rm_at_fork returns the number of items removed (should be 0 or 1). .Sh SEE ALSO .Xr fork 2 .Sh HISTORY The .Nm at_fork -appeared in FreeBSD 2.2 +appeared in +.Fx 2.2 . .Sh BUGS Since the fork queue is not sorted and items are added to the head, order of execution is reversed to that of insertion. .Sh AUTHORS The function was written by .ie Julian Elischer (julian@freebsd.org) .el Julian Elischer (julian@freebsd.org) diff --git a/share/man/man9/at_shutdown.9 b/share/man/man9/at_shutdown.9 index ee851386cf0c..73e3a1f0bced 100644 --- a/share/man/man9/at_shutdown.9 +++ b/share/man/man9/at_shutdown.9 @@ -1,84 +1,85 @@ .\" .\" Copyright (c) 1996 Julian Elischer .\" .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``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 DEVELOPERS 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. .\" -.\" $Id: at_shutdown.9,v 1.1 1996/04/13 16:59:07 joerg Exp $ +.\" $Id: at_shutdown.9,v 1.1 1996/08/19 02:22:15 julian Exp $ .\" " .Dd August 15, 1996 .Os .Dt AT_SHUTDOWN 9 .Sh NAME .Nm at_shutdown , .Nm rm_at_shutdown .Nd ask that a function be run at shutdown. .Sh SYNOPSIS .Fd #include .Fd #include .Ft typedef void \*(lp*bootlist_fn\*(rp \*(lpint, void *\*(rp; .Ft void .Fn at_shutdown "bootlist_fn func" "void *arg" .Ft void .Fn rm_at_shutdown "bootlist_fn func" "void *arg" .Sh DESCRIPTION The .Nm at_shutdown facility allows a kernel module to ensure that it is notified at system shutdown. The function .Ar func is called with the flags indicating boot type, and the opaque argument .Ar arg when the system is shut down .Pp If the requirement for notification is removed, then the function .Nm rm_at_shutdown must be called with the exact .Ar func and .Ar arg arguments as the corresponding call to .Fn at_shutdown . .Pp .Sh RETURN VALUES .Nm at_shutdown returns an errno, 0 meaning success. .Nm rm_at_shutdown returns the number of items removed (should be 0 or 1). .Sh SEE ALSO .Xr reboot 2 .Sh HISTORY The .Nm at_shutdown -appeared in FreeBSD 2.2 +appeared in +.Fx 2.2 . .Sh BUGS Since the shutdown queue is not sorted and items are added to the head, order of execution is reversed to that of insertion. .Sh AUTHORS The function was written by .ie t Julian Elischer (julian@freebsd.org) .el Julian Elischer (julian@freebsd.org) diff --git a/share/man/man9/devfs_add_devswf.9 b/share/man/man9/devfs_add_devswf.9 index ae25c5b06ba3..1d7c66efc0a5 100644 --- a/share/man/man9/devfs_add_devswf.9 +++ b/share/man/man9/devfs_add_devswf.9 @@ -1,76 +1,77 @@ .\" .\" Copyright (c) 1995 Joerg Wunsch .\" .\" All rights reserved. .\" .\" This program is free software. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``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 DEVELOPERS 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. .\" -.\" $Id: devfs_add_devsw.9,v 1.3 1996/02/12 04:56:57 mpp Exp $ +.\" $Id: devfs_add_devswf.9,v 1.1 1996/04/02 04:10:44 scrappy Exp $ .\" .Dd December 31, 1995 .Os FreeBSD .Dt DEVFS_ADD_DEVSWF 9 .Sh NAME .Nm devfs_add_devswf .Nd wire device into devswitch table .Sh SYNOPSIS .Fd #include .Ft void * .Fn devfs_add_devswf "void *devsw" "int minor" "int chrblk" "uid_t uid" "gid_t gid" "int perms" "char *fmt" "..." .Sh DESCRIPTION The call that adds an entry into devfs is .Nm devfs_add_devswf . .Pp It's arguments are: .Bl -tag -width 8X .It Ar devsw the address of the devsw entry the name should access .It Ar minor the minor number .It Ar chrblk whether the device is CHAR or BLK .It Ar uid Owner UID .It Ar gid Owner GID .It Ar perms Permissions (e.g. rwxr--r-- = 0744) .It Ar fmt Formatted string including name, and, if applicable, path to device within DEVFS .El .Sh RETURN VALUES It returns a token that can be used to link another name to the same device .Pq see Xr devfs_link 9 , or destroy the device. .Sh SEE ALSO .Xr devfs_link 9 .Sh HISTORY The function .Nm -appeared in FreeBSD 2.2. +appeared in +.Fx 2.2 . .Sh AUTHORS This man page has been written by .if t J\(:org Wunsch .if n Joerg Wunsch after a description from Julian Elischer. diff --git a/share/man/man9/devfs_link.9 b/share/man/man9/devfs_link.9 index 3b978acf1405..33436afad4da 100644 --- a/share/man/man9/devfs_link.9 +++ b/share/man/man9/devfs_link.9 @@ -1,61 +1,62 @@ .\" .\" Copyright (c) 1995 Joerg Wunsch .\" .\" All rights reserved. .\" .\" This program is free software. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``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 DEVELOPERS 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. .\" -.\" $Id: devfs_link.9,v 1.2 1996/02/12 04:56:58 mpp Exp $ +.\" $Id: devfs_link.9,v 1.3 1996/04/02 04:10:45 scrappy Exp $ .\" .Dd December 31, 1995 .Os FreeBSD .Dt DEVFS_LINK 9 .Sh NAME .Nm devfs_link .Nd make a hard link for a devfs entry .Sh SYNOPSIS .Fd #include .Ft void * .Fn devfs_link "void *original" "char *fmt" "..." .Sh DESCRIPTION The function .Nm takes a token from a previous call to .Fn devfs_add_devswf or .Fn devfs_link as argument, and links it to an alias location denoted by .Ar fmt string. .Sh RETURN VALUES It returns a token for the newly linked devfs entry. .Sh SEE ALSO .Xr devfs_add_devswf 9 .Sh HISTORY The function .Nm -appeared in FreeBSD 2.2. +appeared in +.Fx 2.2 . .Sh AUTHORS This man page has been written by .if t J\(:org Wunsch. .if n Joerg Wunsch. diff --git a/share/man/man9/intro.9 b/share/man/man9/intro.9 index 5876ef5e7542..a209499ea364 100644 --- a/share/man/man9/intro.9 +++ b/share/man/man9/intro.9 @@ -1,112 +1,110 @@ .\" Copyright (c) 1983, 1991, 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. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by the University of .\" California, Berkeley and its contributors. .\" 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. -.\" -.\" @(#)intro.8 8.2 (Berkeley) 12/11/93 -.\" .Dd December 13, 1995 .Dt INTRO 9 .Os FreeBSD 2.2 .Sh NAME .Nm intro .Nd "introduction to system kernel interfaces" .Sh DESCRIPTION This section contains information about the interfaces and subroutines in the kernel. .Sh PROTOTYPES ANSI-C AND ALL THAT Yes please. We would like all code to be fully prototyped. If your code compiles cleanly with .Nm cc .Ar -Wall we would feel happy about it. It is important to understand that this isn't a question of just shutting up .Nm cc , it is a question about avoiding the things it complains about. To put it bluntly, don't hide the problem by casting and other obfuscating practices, solve the problem. .Sh INDENTATION AND STYLE Belive it or not, there actually exists a guide for indentation and style. It isn't generally applied though. We would appreciate if people would pay attention to it, and at least not violate it blatantly. We don't mind it too badly if you have your own style, but please make sure we can read it too. Please take time to read .Xr style 9 for more information. .Sh NAMING THINGS Some general rules exist: .Bl -enum .It If a function is meant as a debugging aid in DDB, it should be enclosed in .Bd -literal -offset indent #ifdef DDB #endif /* DDB */ .Ed And the name of the procedure should start with the prefix .Li DDB_ to clearly identify the procedure as a debugger routine. .El .Sh SCOPE OF SYMBOLS It is important to carefully consider the scope of symbols in the kernel. The default is to make everything static, unless some reason requires the opposite. There are several reasons for this policy, the main one is that the kernel is one monolithic name-space, and pollution is not a good idea here either. For device drivers and other modules that don't add new internal interfaces to the kernel, the entire source should be in one file it possible. That way all symbols can be made static. If for some reason a module is split over multiple source files, then try to split the module along some major fault-line and consider using the number of global symbols as your guide. The fewer the better. .Sh HISTORY The .Nm intro -section manual page appeared in FreeBSD 2.2 +section manual page appeared in +.Fx 2.2 .