xref: /minix3/lib/libc/sys/_lwp_getprivate.2 (revision 84d9c625bfea59e274550651111ae9edfdc40fbd)
1*84d9c625SLionel Sambuc.\"	$NetBSD: _lwp_getprivate.2,v 1.6 2013/10/05 09:18:56 njoly Exp $
22fe8fb19SBen Gras.\"
32fe8fb19SBen Gras.\" Copyright (c) 2003 The NetBSD Foundation, Inc.
42fe8fb19SBen Gras.\" All rights reserved.
52fe8fb19SBen Gras.\"
62fe8fb19SBen Gras.\" This code is derived from software contributed to The NetBSD Foundation
72fe8fb19SBen Gras.\" by Jason R. Thorpe of Wasabi Systems, Inc.
82fe8fb19SBen Gras.\"
92fe8fb19SBen Gras.\" Redistribution and use in source and binary forms, with or without
102fe8fb19SBen Gras.\" modification, are permitted provided that the following conditions
112fe8fb19SBen Gras.\" are met:
122fe8fb19SBen Gras.\" 1. Redistributions of source code must retain the above copyright
132fe8fb19SBen Gras.\"    notice, this list of conditions and the following disclaimer.
142fe8fb19SBen Gras.\" 2. Redistributions in binary form must reproduce the above copyright
152fe8fb19SBen Gras.\"    notice, this list of conditions and the following disclaimer in the
162fe8fb19SBen Gras.\"    documentation and/or other materials provided with the distribution.
172fe8fb19SBen Gras.\"
182fe8fb19SBen Gras.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
192fe8fb19SBen Gras.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
202fe8fb19SBen Gras.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
212fe8fb19SBen Gras.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
222fe8fb19SBen Gras.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
232fe8fb19SBen Gras.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
242fe8fb19SBen Gras.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
252fe8fb19SBen Gras.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
262fe8fb19SBen Gras.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
272fe8fb19SBen Gras.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
282fe8fb19SBen Gras.\" POSSIBILITY OF SUCH DAMAGE.
292fe8fb19SBen Gras.\"
30*84d9c625SLionel Sambuc.Dd September 7, 2013
312fe8fb19SBen Gras.Dt _LWP_GETPRIVATE 2
322fe8fb19SBen Gras.Os
332fe8fb19SBen Gras.Sh NAME
342fe8fb19SBen Gras.Nm _lwp_getprivate ,
352fe8fb19SBen Gras.Nm _lwp_setprivate
362fe8fb19SBen Gras.Nd get and set light-weight process private data
372fe8fb19SBen Gras.Sh LIBRARY
382fe8fb19SBen Gras.Lb libc
392fe8fb19SBen Gras.Sh SYNOPSIS
402fe8fb19SBen Gras.In lwp.h
412fe8fb19SBen Gras.Ft void *
422fe8fb19SBen Gras.Fn _lwp_getprivate void
432fe8fb19SBen Gras.Ft void
442fe8fb19SBen Gras.Fn _lwp_setprivate "void *ptr"
452fe8fb19SBen Gras.Sh DESCRIPTION
462fe8fb19SBen Gras.Fn _lwp_setprivate
472fe8fb19SBen Grasstores the pointer to private data
482fe8fb19SBen Gras.Fa ptr
492fe8fb19SBen Grasin a location private to the LWP.
502fe8fb19SBen Gras.Pp
512fe8fb19SBen Gras.Fn _lwp_getprivate
522fe8fb19SBen Grasreturns the pointer to private data for the LWP.
53*84d9c625SLionel Sambuc.Pp
54*84d9c625SLionel SambucSome platforms provide alternative ways quicker than
55*84d9c625SLionel Sambuc.Fn _lwp_getprivate
56*84d9c625SLionel Sambucto use the pointer.
57*84d9c625SLionel Sambuc.Bl -tag -width amd64
58*84d9c625SLionel Sambuc.It alpha
59*84d9c625SLionel SambucThe pointer can be retrieved by call_pal PAL_rdunique.
60*84d9c625SLionel Sambuc.It amd64
61*84d9c625SLionel SambucThe base address of
62*84d9c625SLionel Sambuc.Dv %fs
63*84d9c625SLionel Sambucregister is set to the pointer so that the private data can be
64*84d9c625SLionel Sambucaccessed using the selector.
65*84d9c625SLionel Sambuc.It i386
66*84d9c625SLionel SambucThe base address of
67*84d9c625SLionel Sambuc.Dv %gs
68*84d9c625SLionel Sambucregister is set to the pointer so that the private data can be
69*84d9c625SLionel Sambucaccessed using the selector.
70*84d9c625SLionel Sambuc.It sparc
71*84d9c625SLionel Sambuc.Dv %g7
72*84d9c625SLionel Sambucregister is set to the pointer.
73*84d9c625SLionel Sambuc.El
742fe8fb19SBen Gras.Sh ERRORS
752fe8fb19SBen GrasThe
762fe8fb19SBen Gras.Fn _lwp_getprivate
772fe8fb19SBen Grasand
782fe8fb19SBen Gras.Fn _lwp_setprivate
792fe8fb19SBen Grasfunctions are always successful, and no return value is reserved to indicate
802fe8fb19SBen Grasan error.
812fe8fb19SBen Gras.Sh SEE ALSO
822fe8fb19SBen Gras.Xr _lwp_makecontext 3
832fe8fb19SBen Gras.Sh HISTORY
842fe8fb19SBen GrasThe
852fe8fb19SBen Gras.Fn _lwp_getprivate
862fe8fb19SBen Grasand
872fe8fb19SBen Gras.Fn _lwp_setprivate
882fe8fb19SBen Grassystem calls first appeared in
892fe8fb19SBen Gras.Nx 2.0 .
90