1*86f9d4cdStedu.\" $OpenBSD: pthread_attr_setstacksize.3,v 1.10 2013/06/05 03:44:50 tedu Exp $ 27682efa6Sd.\" Manual page derived from TOG's UNIX98 documentation. 3084a1742Sjmc.\" 4084a1742Sjmc.\" David Leonard, 2000. Public Domain. 5084a1742Sjmc.\" 6*86f9d4cdStedu.Dd $Mdocdate: June 5 2013 $ 77682efa6Sd.Dt PTHREAD_ATTR_SETSTACKSIZE 3 87682efa6Sd.Os 97682efa6Sd.Sh NAME 107682efa6Sd.Nm pthread_attr_setstacksize , 117682efa6Sd.Nm pthread_attr_getstacksize 127682efa6Sd.Nd set and get stacksize attribute 137682efa6Sd.Sh SYNOPSIS 14*86f9d4cdStedu.In pthread.h 157682efa6Sd.Ft int 167682efa6Sd.Fn pthread_attr_setstacksize "pthread_attr_t *attr" "size_t stacksize" 177682efa6Sd.Ft int 186ae9c702Sbrad.Fn pthread_attr_getstacksize "const pthread_attr_t *attr" "size_t *stacksize" 197682efa6Sd.Sh DESCRIPTION 207682efa6SdThe functions 217682efa6Sd.Fn pthread_attr_setstacksize 227682efa6Sdand 237682efa6Sd.Fn pthread_attr_getstacksize , 247682efa6Sdrespectively, set and get the thread 257682efa6Sdcreation 267682efa6Sd.Va stacksize 277682efa6Sdattribute in the 287682efa6Sd.Fa attr 297682efa6Sdobject. 307682efa6Sd.Pp 317682efa6SdThe 327682efa6Sd.Va stacksize 337682efa6Sdattribute defines the minimum stack size (in bytes) 347bfaf830Sjasoniallocated for the created thread's stack. 35ba0a4b2fSjmc.Sh RETURN VALUES 367682efa6SdUpon successful completion, 377682efa6Sd.Fn pthread_attr_setstacksize 387682efa6Sdand 397682efa6Sd.Fn pthread_attr_getstacksize 40ba0a4b2fSjmcreturn a value of 0. 41ba0a4b2fSjmcOtherwise, an error number is returned to indicate the error. 427682efa6Sd.Pp 437682efa6SdThe 447682efa6Sd.Fn pthread_attr_getstacksize 457682efa6Sdfunction stores the 467682efa6Sd.Va stacksize 477682efa6Sdattribute value in 487682efa6Sd.Fa stacksize 497682efa6Sdif successful. 507682efa6Sd.Sh ERRORS 517682efa6SdThe 527682efa6Sd.Fn pthread_attr_setstacksize 537682efa6Sdfunction will fail if: 547682efa6Sd.Bl -tag -width Er 557682efa6Sd.It Bq Er EINVAL 567682efa6SdThe value of 577682efa6Sd.Fa stacksize 587682efa6Sdis less than 597682efa6Sd.Dv PTHREAD_STACK_MIN 607682efa6Sdor exceeds a system-imposed limit. 617682efa6Sd.El 627682efa6Sd.Pp 637682efa6SdThese functions will not return an error code of 647682efa6Sd.Bq Er EINTR . 657682efa6Sd.Sh SEE ALSO 667682efa6Sd.Xr pthread_attr_init 3 , 677682efa6Sd.Xr pthread_attr_setdetachstate 3 , 6891063d07Sguenther.Xr pthread_attr_setguardsize 3 , 6911ddadc0Sguenther.Xr pthread_attr_setstack 3 , 707682efa6Sd.Xr pthread_attr_setstackaddr 3 , 717682efa6Sd.Xr pthread_create 3 , 727682efa6Sd.Xr pthreads 3 737682efa6Sd.Sh STANDARDS 7411ddadc0Sguenther.Fn pthread_attr_setstacksize 7511ddadc0Sguentherand 7611ddadc0Sguenther.Fn pthread_attr_getstacksize 7711ddadc0Sguentherconform to ISO/IEC 9945-1 ANSI/IEEE 787682efa6Sd.Pq Dq Tn POSIX 797682efa6SdStd 1003.1 Second Edition 1996-07-12. 80