1.\" $OpenBSD: pthread_stackseg_np.3,v 1.5 2007/05/31 19:19:37 jmc Exp $
2.\"
3.\" PUBLIC DOMAIN: No Rights Reserved. Marco S Hyman <marc@snafu.org>
4.\"
5.Dd $Mdocdate: May 31 2007 $
6.Dt PTHREAD_STACKSEG_NP 3
7.Os
8.Sh NAME
9.Nm pthread_stackseg_np
10.Nd return stack size and location
11.Sh SYNOPSIS
12.Fd #include <sys/signal.h>
13.Fd #include <pthread_np.h>
14.Ft int
15.Fn pthread_stackseg_np "pthread_t thread" "stack_t *sinfo"
16.Sh DESCRIPTION
17The
18.Fn pthread_stackseg_np
19function returns information about the given thread's stack.
20A
21.Fa stack_t
22is the same as a
23.Fa struct sigaltstack
24(see
25.Xr sigaltstack 2 )
26except the
27.Fa ss_sp
28variable points to the top of the stack instead of the base.
29.Sh RETURN VALUES
30If successful, the
31.Fn pthread_stackseg_np
32function will return 0.
33Otherwise an error number will be returned to indicate the error.
34.Sh ERRORS
35The
36.Fn pthread_stackseg_np
37function will fail if:
38.Bl -tag -width Er
39.It Bq Er EAGAIN
40Stack information for the given thread is not currently available.
41There is no guarantee that the given thread's stack information will ever
42become available.
43.El
44.Sh SEE ALSO
45.Xr sigaltstack 2 ,
46.Xr pthreads 3
47.Sh STANDARDS
48.Fn pthread_stackseg_np
49is a non-portable extension to
50.St -p1003.1-2001 .
51