]> git.saurik.com Git - apple/libpthread.git/blob - man/pthread_attr_set_getstacksize.3
libpthread-301.1.6.tar.gz
[apple/libpthread.git] / man / pthread_attr_set_getstacksize.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_getstacksize ,
7 .Nm pthread_attr_setstacksize
8 .Nd thread attribute operations
9 .Sh SYNOPSIS
10 .Fd #include <pthread.h>
11 .Ft int
12 .Fo pthread_attr_getstacksize
13 .Fa "const pthread_attr_t *restrict attr"
14 .Fa "size_t *restrict stacksize"
15 .Fc
16 .Ft int
17 .Fo pthread_attr_setstacksize
18 .Fa "pthread_attr_t *attr"
19 .Fa "size_t stacksize"
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_setstacksize
30 and
31 .Fn pthread_attr_getstacksize ,
32 respectively, set and get the size of the stack that is to be created for the new thread. The stack size attribute is set within the
33 .Fa attr
34 argument, which can subsequently be used as an argument to
35 .Fn pthread_create .
36 .Sh RETURN VALUES
37 If successful, these functions return 0.
38 Otherwise, an error number is returned to indicate the error.
39 .Fn pthread_attr_getstacksize
40 returns the stacksize attribute value in
41 .Fa stacksize
42 if successful.
43 .Sh ERRORS
44 .Fn pthread_attr_getstacksize
45 will fail if:
46 .Bl -tag -width Er
47 .\" ========
48 .It Bq Er EINVAL
49 Invalid value for
50 .Fa attr .
51 .El
52 .Pp
53 .Fn pthread_attr_setstacksize
54 will fail if:
55 .Bl -tag -width Er
56 .\" ========
57 .It Bq Er EINVAL
58 Invalid value for
59 .Fa attr .
60 .\" ========
61 .It Bq Er EINVAL
62 .Fa stacksize
63 is less than
64 .Dv PTHREAD_STACK_MIN .
65 .\" ========
66 .It Bq Er EINVAL
67 .Fa stacksize
68 is not a multiple of the system page size.
69 .El
70 .Sh SEE ALSO
71 .Xr pthread_create 3 ,
72 .Xr pthread_attr_init 3 ,
73 .Xr pthread_attr_setstackaddr 3
74 .Sh STANDARDS
75 .Fn pthread_attr_setstacksize ,
76 .Fn pthread_attr_getstacksize
77 conform to
78 .St -p1003.1-96