1.\" $OpenBSD: pthread_attr_init.3,v 1.11 2013/06/05 03:44:50 tedu Exp $ 2.\" Manual page derived from TOG's UNIX98 documentation. 3.\" 4.\" David Leonard, 2000. Public Domain. 5.\" 6.Dd $Mdocdate: June 5 2013 $ 7.Dt PTHREAD_ATTR_INIT 3 8.Os 9.Sh NAME 10.Nm pthread_attr_init , 11.Nm pthread_attr_destroy 12.Nd initialise and destroy threads attribute object 13.Sh SYNOPSIS 14.In pthread.h 15.Ft int 16.Fn pthread_attr_init "pthread_attr_t *attr" 17.Ft int 18.Fn pthread_attr_destroy "pthread_attr_t *attr" 19.Sh DESCRIPTION 20The function 21.Fn pthread_attr_init 22initialises a thread attributes 23object 24.Fa attr 25with the default value for all of the individual 26attributes used by a given implementation. 27.Pp 28The resulting attribute object (possibly modified by setting 29individual attribute values), when used by 30.Xr pthread_create 3 , 31defines the attributes of the thread created. 32A single attributes object can be used in multiple simultaneous calls to 33.Xr pthread_create 3 . 34.Pp 35The 36.Fn pthread_attr_destroy 37function is used to destroy a thread 38attributes object. 39An implementation may cause 40.Fn pthread_attr_destroy 41to set 42.Fa attr 43to an implementation-dependent 44invalid value. 45The behaviour of using the attribute after it has 46been destroyed is undefined. 47.Sh RETURN VALUES 48Upon successful completion, 49.Fn pthread_attr_init 50and 51.Fn pthread_attr_destroy 52return a value of 0. 53Otherwise, an error number is returned to indicate the error. 54.Sh ERRORS 55The 56.Fn pthread_attr_init 57function will fail if: 58.Bl -tag -width Er 59.It Bq Er ENOMEM 60Insufficient memory exists to initialise the thread attributes 61object. 62.El 63.Pp 64These functions will not return an error code of 65.Bq Er EINTR . 66.Sh SEE ALSO 67.Xr pthread_attr_setdetachstate 3 , 68.Xr pthread_attr_setguardsize 3 , 69.Xr pthread_attr_setstack 3 , 70.Xr pthread_attr_setstackaddr 3 , 71.Xr pthread_attr_setstacksize 3 , 72.Xr pthread_create 3 , 73.Xr pthreads 3 74.Sh STANDARDS 75.Fn pthread_attr_destroy 76and 77.Fn pthread_attr_init 78conform to ISO/IEC 9945-1 ANSI/IEEE 79.Pq Dq Tn POSIX 80Std 1003.1 Second Edition 1996-07-12. 81