xref: /illumos-gate/usr/src/man/man3c/pthread_attr_getname_np.3c (revision ab618543cc6fc4bc273c077ef5d247961cdb29d4)
1*ab618543SJohn Levon.\"
2*ab618543SJohn Levon.\" This file and its contents are supplied under the terms of the
3*ab618543SJohn Levon.\" Common Development and Distribution License ("CDDL"), version 1.0.
4*ab618543SJohn Levon.\" You may only use this file in accordance with the terms of version
5*ab618543SJohn Levon.\" 1.0 of the CDDL.
6*ab618543SJohn Levon.\"
7*ab618543SJohn Levon.\" A full copy of the text of the CDDL should have accompanied this
8*ab618543SJohn Levon.\" source.  A copy of the CDDL is also available via the Internet at
9*ab618543SJohn Levon.\" http://www.illumos.org/license/CDDL.
10*ab618543SJohn Levon.\"
11*ab618543SJohn Levon.\"
12*ab618543SJohn Levon.\" Copyright 2018 Joyent, Inc.
13*ab618543SJohn Levon.\"
14*ab618543SJohn Levon.Dd "August 22, 2018"
15*ab618543SJohn Levon.Dt PTHREAD_ATTR_GETNAME_NP 3C
16*ab618543SJohn Levon.Os
17*ab618543SJohn Levon.Sh NAME
18*ab618543SJohn Levon.Nm pthread_attr_getname_np ,
19*ab618543SJohn Levon.Nm pthread_attr_setname_np
20*ab618543SJohn Levon.Nd get or set thread name attribute
21*ab618543SJohn Levon.Sh SYNOPSIS
22*ab618543SJohn Levon.In pthread.h
23*ab618543SJohn Levon.
24*ab618543SJohn Levon.Ft int
25*ab618543SJohn Levon.Fo pthread_attr_getname_np
26*ab618543SJohn Levon.Fa "pthread_attr_t *restrict attr"
27*ab618543SJohn Levon.Fa "char *name"
28*ab618543SJohn Levon.Fa "size_t len"
29*ab618543SJohn Levon.Fc
30*ab618543SJohn Levon.
31*ab618543SJohn Levon.Ft int
32*ab618543SJohn Levon.Fo pthread_attr_setname_np
33*ab618543SJohn Levon.Fa "pthread_attr_t *restrict attr"
34*ab618543SJohn Levon.Fa "const char *name"
35*ab618543SJohn Levon.Fc
36*ab618543SJohn Levon.
37*ab618543SJohn Levon.Sh DESCRIPTION
38*ab618543SJohn LevonThe
39*ab618543SJohn Levon.Fn pthread_attr_setname_np
40*ab618543SJohn Levonand
41*ab618543SJohn Levon.Fn pthread_attr_getname_np
42*ab618543SJohn Levonfunctions, respectively, set and get the thread name attribute in
43*ab618543SJohn Levon.Fa attr
44*ab618543SJohn Levonto
45*ab618543SJohn Levon.Fa name .
46*ab618543SJohn LevonFor
47*ab618543SJohn Levon.Fn pthread_attr_getname_np ,
48*ab618543SJohn Levon.Fa len
49*ab618543SJohn Levonis the size of
50*ab618543SJohn Levon.Fa name .
51*ab618543SJohn LevonAny threads created with
52*ab618543SJohn Levon.Xr pthread_create 3c
53*ab618543SJohn Levonusing
54*ab618543SJohn Levon.Fa attr
55*ab618543SJohn Levonwill have their name set to
56*ab618543SJohn Levon.Fa name
57*ab618543SJohn Levonupon creation.
58*ab618543SJohn Levon.Pp
59*ab618543SJohn LevonThread names are limited to
60*ab618543SJohn Levon.Dv PTHREAD_MAX_NAMELEN_NP
61*ab618543SJohn Levonincluding the terminating NUL.
62*ab618543SJohn LevonThey may only contain printable ASCII characters.
63*ab618543SJohn Levon.Sh RETURN VALUES
64*ab618543SJohn LevonUpon successful completion, the
65*ab618543SJohn Levon.Fn pthread_attr_getname_np
66*ab618543SJohn Levonand
67*ab618543SJohn Levon.Fn pthread_attr_setname_np
68*ab618543SJohn Levonfunctions return
69*ab618543SJohn Levon.Sy 0 .
70*ab618543SJohn LevonOtherwise, an error number is returned to indicate the error.
71*ab618543SJohn Levon.Sh ERRORS
72*ab618543SJohn LevonThe
73*ab618543SJohn Levon.Fn pthread_attr_getname_np
74*ab618543SJohn Levonfunction may fail with:
75*ab618543SJohn Levon.Bl -tag -width Er
76*ab618543SJohn Levon.It Er EINVAL
77*ab618543SJohn LevonThe
78*ab618543SJohn Levon.Fa name
79*ab618543SJohn Levonargument is
80*ab618543SJohn Levon.Sy NULL .
81*ab618543SJohn Levon.It Er ERANGE
82*ab618543SJohn LevonThe size of
83*ab618543SJohn Levon.Fa name
84*ab618543SJohn Levonas indicated by
85*ab618543SJohn Levon.Fa len
86*ab618543SJohn Levonis too small to contain the thread name.
87*ab618543SJohn LevonThe buffer may be over-written with partial contents of the thread name.
88*ab618543SJohn Levon.El
89*ab618543SJohn Levon.Pp
90*ab618543SJohn LevonThe
91*ab618543SJohn Levon.Fn pthread_attr_setname_np
92*ab618543SJohn Levonfunction may fail with:
93*ab618543SJohn Levon.Bl -tag -width Er
94*ab618543SJohn Levon.It Er ERANGE
95*ab618543SJohn LevonThe length of name given in
96*ab618543SJohn Levon.Fa name
97*ab618543SJohn Levonexceeds the maximum size allowed.
98*ab618543SJohn Levon.El
99*ab618543SJohn Levon.Sh INTERFACE STABILITY
100*ab618543SJohn Levon.Sy Uncommitted
101*ab618543SJohn Levon.Sh MT-LEVEL
102*ab618543SJohn Levon.Sy MT-Safe
103*ab618543SJohn Levon.Sh SEE ALSO
104*ab618543SJohn Levon.Xr pthread_create 3c ,
105*ab618543SJohn Levon.Xr pthread_getname_np 3c
106