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