70 lines
2.4 KiB
Groff
70 lines
2.4 KiB
Groff
.\" Copyright (c) 2000
|
|
.\" The Regents of the University of California. All rights reserved.
|
|
.\"
|
|
.\" 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.
|
|
.\"
|
|
.\" $FreeBSD$
|
|
.\"
|
|
.Dt KTHREAD 9
|
|
.Os FreeBSD
|
|
.Sh NAME
|
|
.Nm kthread_start ,
|
|
.Nm kthread_create ,
|
|
.Nm kthread_exit ,
|
|
.Nm suspend_kproc ,
|
|
.Nm resume_kproc
|
|
.Nd kernel threads
|
|
.Sh SYNOPSIS
|
|
.Fd #include <sys/kthread.h>
|
|
.Ft void
|
|
.Fn kproc_start "const void *udata"
|
|
.Ft int
|
|
.Fn kthread_create "void (*func)(void *)" "void *arg" "struct proc **newpp" "const char *fmt" "..."
|
|
.Ft void
|
|
.Fn kthread_exit "int ecode"
|
|
.Ft int
|
|
.Fn suspend_kproc "struct proc *p" "int timo"
|
|
.Ft int
|
|
.Fn resume_kproc "struct proc *p"
|
|
.Sh DESCRIPTION
|
|
.Pp
|
|
The function
|
|
.Fn kproc_start
|
|
is used to start "internal" daemons and intended to be called from
|
|
.Fn SYSINIT 9 .
|
|
The function
|
|
.Fn kthread_create
|
|
is used to create a kernel process/thread.
|
|
It shares its address space with proc0; kernel only.
|
|
The function
|
|
.Fn kthread_exit
|
|
is used to terminate kernel processes/threads.
|
|
To suspend and resume a kernel thread/process, the functions
|
|
.Fn suspend_kproc
|
|
and
|
|
.Fn resume_kproc
|
|
are used.
|
|
Participation in this scheme is voluntary.
|
|
.Sh SEE ALSO
|
|
.Xr SYSINIT 9
|