NetBSD/share/man/man9/LWP_CACHE_CREDS.9

76 lines
2.8 KiB
Groff

.\" $NetBSD: LWP_CACHE_CREDS.9,v 1.2 2007/12/09 08:53:57 yamt Exp $
.\"
.\" Copyright (c)2007 YAMAMOTO Takashi,
.\" 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 AUTHOR 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 AUTHOR 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.
.\"
.\" ------------------------------------------------------------
.Dd December 9, 2007
.Dt LWP_CACHE_CREDS 9
.Os
.\" ------------------------------------------------------------
.Sh NAME
.Nm LWP_CACHE_CREDS
.Nd synchronize LWP credential with process credential
.\" ------------------------------------------------------------
.Sh SYNOPSIS
.In sys/lwp.h
.\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
.Ft void
.Fn LWP_CACHE_CREDS \
"lwp_t *l" "struct proc *p"
.\" ------------------------------------------------------------
.Sh DESCRIPTION
.Fn LWP_CACHE_CREDS
updates the LWP's cached credential to match with the process' credential
if the latter has been changed after the last synchronization.
.Pp
Each LWPs have its cached credential so that it can be used without
worrying about potential of other LWP changing the process' credential.
.Fn kauth_cred_get
returns the cached credential.
.Pp
.Fn LWP_CACHE_CREDS
is called by MD entry code for system call and various traps.
LWPs which can live in kernel for long period should call
.Fn LWP_CACHE_CREDS
by itsself to refresh its credential.
.Pp
.Fn LWP_CACHE_CREDS
takes the following arguments.
.Bl -tag -width l
.It Fa l
The calling lwp.
.It Fa p
The process which the lwp
.Fa l
belongs to.
.El
.Pp
.Fn LWP_CACHE_CREDS
might be implemented as a macro.
.\" ------------------------------------------------------------
.Sh SEE ALSO
.Xr intro 9 ,
.Xr kauth 9