xref: /openbsd-src/lib/libpthread/man/pthread_attr_init.3 (revision b2ea75c1b17e1a9a339660e7ed45cd24946b230e)
1.\" $OpenBSD: pthread_attr_init.3,v 1.2 2000/04/12 21:48:02 aaron 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. A single attributes
29object 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. The behaviour of using the attribute after it has
41been destroyed is undefined.
42.Sh RETURN VALUE
43Upon successful completion,
44.Fn pthread_attr_init
45and
46.Fn pthread_attr_destroy
47return a value of 0. Otherwise, an error
48number is returned to indicate the error.
49.Sh ERRORS
50The
51.Fn pthread_attr_init
52function will fail if:
53.Bl -tag -width Er
54.It Bq Er ENOMEM
55Insufficient memory exists to initialise the thread attributes
56object.
57.El
58.Pp
59These functions will not return an error code of
60.Bq Er EINTR .
61.Sh SEE ALSO
62.Xr pthread_attr_setstackaddr 3 ,
63.Xr pthread_attr_setstacksize 3 ,
64.Xr pthread_attr_setdetachstate 3 ,
65.Xr pthread_create 3 ,
66.Xr pthreads 3
67.Sh STANDARDS
68.Fn pthread_create
69conforms to ISO/IEC 9945-1 ANSI/IEEE
70.Pq Dq Tn POSIX
71Std 1003.1 Second Edition 1996-07-12.
72