]> git.saurik.com Git - apple/libc.git/blob - pthreads/pthread_attr_set_getstackaddr.3
Libc-763.13.tar.gz
[apple/libc.git] / pthreads / pthread_attr_set_getstackaddr.3
1 .\" Copyright (c) 2004-2007 Apple Inc. All rights reserved.
2 .Dd December 31, 2007
3 .Dt PTHREAD_ATTR 3
4 .Os
5 .Sh NAME
6 .Nm pthread_attr_getstackaddr ,
7 .Nm pthread_attr_setstackaddr
8 .Nd thread attribute operations
9 .Sh SYNOPSIS
10 .Fd #include <pthread.h>
11 .Ft int
12 .Fo pthread_attr_getstackaddr
13 .Fa "const pthread_attr_t *restrict attr"
14 .Fa "void **restrict stackaddr"
15 .Fc
16 .Ft int
17 .Fo pthread_attr_setstackaddr
18 .Fa "pthread_attr_t *attr"
19 .Fa "void *stackaddr"
20 .Fc
21 .Sh DESCRIPTION
22 Thread attributes are used to specify parameters to
23 .Fn pthread_create .
24 One attribute object can be used in multiple calls to
25 .Fn pthread_create ,
26 with or without modifications between calls.
27 .Pp
28 The functions
29 .Fn pthread_attr_setstackaddr
30 and
31 .Fn pthread_attr_getstackaddr
32 respectively, set and get the address at which the stack of the newly created thread should be located.
33 The stackaddr attribute is set within the
34 .Fa attr
35 argument, which can subsequently be used as an argument to
36 .Fn pthread_create .
37 .Sh RETURN VALUES
38 If successful, these functions return 0.
39 Otherwise, an error number is returned to indicate the error.
40 .Fn pthread_attr_getstackaddr
41 returns the stackaddr attribute value in
42 .Fa stackaddr
43 if successful.
44 .Sh ERRORS
45 .Fn pthread_attr_setstackaddr
46 will fail if:
47 .Bl -tag -width Er
48 .\" ========
49 .It Bq Er EINVAL
50 Invalid value for
51 .Fa attr .
52 .\" ========
53 .El
54 .Pp
55 .Fn pthread_attr_getstackaddr
56 will fail if:
57 .Bl -tag -width Er
58 .\" ========
59 .It Bq Er EINVAL
60 Invalid value for
61 .Fa attr .
62 .\" ========
63 .El
64 .Pp
65 .Sh SEE ALSO
66 .Xr pthread_create 3 ,
67 .Xr pthread_attr_init 3 ,
68 .Xr pthread_attr_setdetachstate 3 ,
69 .Xr pthread_attr_setstacksize 3
70 .Sh STANDARDS
71 .Fn pthread_attr_setstackaddr ,
72 .Fn pthread_attr_getstackaddr ,
73 conform to
74 .St -p1003.1-96