summaryrefslogtreecommitdiff
path: root/static/netbsd/man2/_lwp_ctl.2
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-25 19:55:15 -0400
committerJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-25 19:55:15 -0400
commit253e67c8b3a72b3a4757fdbc5845297628db0a4a (patch)
treeadf53b66087aa30dfbf8bf391a1dadb044c3bf4d /static/netbsd/man2/_lwp_ctl.2
parenta9157ce950dfe2fc30795d43b9d79b9d1bffc48b (diff)
docs: Added All NetBSD Manuals
Diffstat (limited to 'static/netbsd/man2/_lwp_ctl.2')
-rw-r--r--static/netbsd/man2/_lwp_ctl.2102
1 files changed, 102 insertions, 0 deletions
diff --git a/static/netbsd/man2/_lwp_ctl.2 b/static/netbsd/man2/_lwp_ctl.2
new file mode 100644
index 00000000..32f06f82
--- /dev/null
+++ b/static/netbsd/man2/_lwp_ctl.2
@@ -0,0 +1,102 @@
+.\" $NetBSD: _lwp_ctl.2,v 1.6 2022/12/04 16:17:50 uwe 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 April 13, 2012
+.Dt _LWP_CTL 2
+.Os
+.Sh NAME
+.Nm _lwp_ctl
+.Nd prepare per-LWP communication area between kernel and userland
+.\" ------------------------------------------------------------
+.Sh LIBRARY
+.Lb libc
+.\" ------------------------------------------------------------
+.Sh SYNOPSIS
+.In sys/lwpctl.h
+.In lwp.h
+.Ft int
+.Fn _lwp_ctl "int features" "struct lwpctl **address"
+.\" ------------------------------------------------------------
+.Sh DESCRIPTION
+.Fn _lwp_ctl
+prepares per-LWP communication area for the calling LWP,
+and maps it into the calling process' address space.
+It takes the following arguments.
+.Bl -tag -width features
+.It Fa features
+The bitwise-OR of the following flags.
+.Bl -tag -width Dv
+.It Dv LWPCTL_FEATURE_CURCPU
+Request
+.Vt lc_curcpu .
+.It Dv LWPCTL_FEATURE_PCTR
+Request
+.Vt lc_pctr .
+.El
+.It Fa address
+The address to store a pointer to
+.Vt lwpctl
+structure for the calling LWP.
+.El
+.Pp
+The per-LWP communication area is described by an
+.Vt lwpctl
+structure.
+It has following members, depending on
+.Fa features .
+.Bl -tag -width Fa
+.It Vt int Fa lc_curcpu
+The integral identifier of the CPU on which the LWP is running,
+or
+.Dv LWPCTL_CPU_NONE
+when the LWP is not running on any CPU.
+It's updated by the kernel and should be considered as read-only for
+userland.
+It's available only if requested with the
+.Dv LWPCTL_FEATURE_CURCPU
+flag.
+.It Vt int Fa lc_pctr
+The integer which is incremented on every context switches to the LWP.
+It can be used to detect preemption of the LWP
+.Po
+thus its name
+.Dq preemption counter .
+.Pc
+It's updated by the kernel and should be considered as read-only for
+userland.
+It's available only if requested with the
+.Dv LWPCTL_FEATURE_PCTR
+flag.
+.El
+.\" ------------------------------------------------------------
+.Sh RETURN VALUES
+.Rv -std _lwp_ctl
+.\" ------------------------------------------------------------
+.\".Sh ERRORS
+.\" ------------------------------------------------------------
+.Sh SEE ALSO
+.Xr errno 2