]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/pthread_attr_setstack.3
Many pages: Use correct letter case in page titles (TH)
[thirdparty/man-pages.git] / man3 / pthread_attr_setstack.3
CommitLineData
4008a5d5
MK
1.\" Copyright (c) 2008 Linux Foundation, written by Michael Kerrisk
2.\" <mtk.manpages@gmail.com>
3.\"
5fbde956 4.\" SPDX-License-Identifier: Linux-man-pages-copyleft
4008a5d5 5.\"
4c1c5274 6.TH pthread_attr_setstack 3 (date) "Linux man-pages (unreleased)"
4008a5d5
MK
7.SH NAME
8pthread_attr_setstack, pthread_attr_getstack \- set/get stack
9attributes in thread attributes object
637f4b53
AC
10.SH LIBRARY
11POSIX threads library
8fc3b2cf 12.RI ( libpthread ", " \-lpthread )
4008a5d5
MK
13.SH SYNOPSIS
14.nf
15.B #include <pthread.h>
dbfe9c70 16.PP
4008a5d5
MK
17.BI "int pthread_attr_setstack(pthread_attr_t *" attr ,
18.BI " void *" stackaddr ", size_t " stacksize );
5a00663a
AC
19.BI "int pthread_attr_getstack(const pthread_attr_t *restrict " attr ,
20.BI " void **restrict " stackaddr ,
21.BI " size_t *restrict " stacksize );
4008a5d5 22.fi
68e4db0a 23.PP
d39ad78f 24.RS -4
4008a5d5
MK
25Feature Test Macro Requirements for glibc (see
26.BR feature_test_macros (7)):
d39ad78f 27.RE
68e4db0a 28.PP
4008a5d5
MK
29.BR pthread_attr_getstack (),
30.BR pthread_attr_setstack ():
9d2adbae 31.nf
5c10d2c5 32 _POSIX_C_SOURCE >= 200112L
9d2adbae 33.fi
4008a5d5
MK
34.SH DESCRIPTION
35The
49c54dd8 36.BR pthread_attr_setstack ()
e0ea179f 37function sets the stack address and stack size attributes of the
4008a5d5
MK
38thread attributes object referred to by
39.I attr
40to the values specified in
1ae6b2c7 41.I stackaddr
4008a5d5
MK
42and
43.IR stacksize ,
44respectively.
45These attributes specify the location and size of the stack that should
46be used by a thread that is created using the thread attributes object
47.IR attr .
847e0d88 48.PP
4008a5d5
MK
49.I stackaddr
50should point to the lowest addressable byte of a buffer of
51.I stacksize
52bytes that was allocated by the caller.
53The pages of the allocated buffer should be both readable and writable.
847e0d88 54.PP
4008a5d5
MK
55The
56.BR pthread_attr_getstack ()
57function returns the stack address and stack size attributes of the
58thread attributes object referred to by
59.I attr
60in the buffers pointed to by
1ae6b2c7 61.I stackaddr
4008a5d5
MK
62and
63.IR stacksize ,
64respectively.
65.SH RETURN VALUE
66On success, these functions return 0;
c7094399 67on error, they return a nonzero error number.
4008a5d5 68.SH ERRORS