xref: /freebsd/share/man/man3/pthread_set_name_np.3 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
1318d8cfdSAlexey Zelkin.\" Copyright (c) 2003 Alexey Zelkin <phantom@FreeBSD.org>
2318d8cfdSAlexey Zelkin.\" All rights reserved.
3318d8cfdSAlexey Zelkin.\"
4318d8cfdSAlexey Zelkin.\" Redistribution and use in source and binary forms, with or without
5318d8cfdSAlexey Zelkin.\" modification, are permitted provided that the following conditions
6318d8cfdSAlexey Zelkin.\" are met:
7318d8cfdSAlexey Zelkin.\" 1. Redistributions of source code must retain the above copyright
8318d8cfdSAlexey Zelkin.\"    notice, this list of conditions and the following disclaimer.
9318d8cfdSAlexey Zelkin.\" 2. Redistributions in binary form must reproduce the above copyright
10318d8cfdSAlexey Zelkin.\"    notice, this list of conditions and the following disclaimer in the
11318d8cfdSAlexey Zelkin.\"    documentation and/or other materials provided with the distribution.
12318d8cfdSAlexey Zelkin.\"
13318d8cfdSAlexey Zelkin.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14318d8cfdSAlexey Zelkin.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15318d8cfdSAlexey Zelkin.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16318d8cfdSAlexey Zelkin.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17318d8cfdSAlexey Zelkin.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18318d8cfdSAlexey Zelkin.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19318d8cfdSAlexey Zelkin.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20318d8cfdSAlexey Zelkin.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21318d8cfdSAlexey Zelkin.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22318d8cfdSAlexey Zelkin.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23318d8cfdSAlexey Zelkin.\" SUCH DAMAGE.
24318d8cfdSAlexey Zelkin.\"
25df7d7638SFelix Johnson.Dd October 12, 2021
26318d8cfdSAlexey Zelkin.Dt PTHREAD_SET_NAME_NP 3
27318d8cfdSAlexey Zelkin.Os
28318d8cfdSAlexey Zelkin.Sh NAME
294627d47bSKonstantin Belousov.Nm pthread_get_name_np ,
302ef84b7dSKonstantin Belousov.Nm pthread_getname_np ,
31*32068667SChristian Brueffer.Nm pthread_set_name_np ,
322ef84b7dSKonstantin Belousov.Nm pthread_setname_np
334627d47bSKonstantin Belousov.Nd set and retrieve the thread name
34318d8cfdSAlexey Zelkin.Sh LIBRARY
35ec7452f1SRuslan Ermilov.Lb libpthread
36318d8cfdSAlexey Zelkin.Sh SYNOPSIS
37318d8cfdSAlexey Zelkin.In pthread_np.h
38318d8cfdSAlexey Zelkin.Ft void
394627d47bSKonstantin Belousov.Fn pthread_get_name_np "pthread_t thread" "char *name" "size_t len"
402ef84b7dSKonstantin Belousov.Ft int
412ef84b7dSKonstantin Belousov.Fn pthread_getname_np "pthread_t thread" "char *name" "size_t len"
424627d47bSKonstantin Belousov.Ft void
43ff07dd91SEric van Gyzen.Fn pthread_set_name_np "pthread_t thread" "const char *name"
442ef84b7dSKonstantin Belousov.Ft int
452ef84b7dSKonstantin Belousov.Fn pthread_setname_np "pthread_t thread" "const char *name"
46318d8cfdSAlexey Zelkin.Sh DESCRIPTION
47318d8cfdSAlexey ZelkinThe
48318d8cfdSAlexey Zelkin.Fn pthread_set_name_np
492ef84b7dSKonstantin Belousovand
502ef84b7dSKonstantin Belousov.Fn pthread_setname_np
512ef84b7dSKonstantin Belousovfunctions apply a copy of the given
52318d8cfdSAlexey Zelkin.Fa name
53ff07dd91SEric van Gyzento the given
54ff07dd91SEric van Gyzen.Fa thread .
554627d47bSKonstantin Belousov.Pp
564627d47bSKonstantin BelousovThe
574627d47bSKonstantin Belousov.Fn pthread_get_name_np
582ef84b7dSKonstantin Belousovand
592ef84b7dSKonstantin Belousov.Fn pthread_getname_np
602ef84b7dSKonstantin Belousovfunctions retrieve the
614627d47bSKonstantin Belousov.Fa name
624627d47bSKonstantin Belousovassociated with
634627d47bSKonstantin Belousov.Fa thread .
644627d47bSKonstantin BelousovIf
654627d47bSKonstantin Belousov.Fn pthread_set_name_np
664627d47bSKonstantin Belousovwas not previously called for
674627d47bSKonstantin Belousov.Fa thread ,
684627d47bSKonstantin Belousovthe buffer pointed to by
694627d47bSKonstantin Belousov.Fa name
704627d47bSKonstantin Belousovwill be empty.
71318d8cfdSAlexey Zelkin.Sh ERRORS
722ef84b7dSKonstantin BelousovThe
732ef84b7dSKonstantin Belousov.Nm pthread_getname_np
742ef84b7dSKonstantin Belousovand
752ef84b7dSKonstantin Belousov.Nm pthread_setname_np
762ef84b7dSKonstantin Belousovwill fail if
772ef84b7dSKonstantin Belousov.Bl -tag -width Er
782ef84b7dSKonstantin Belousov.It Bq Er ESRCH
792ef84b7dSKonstantin BelousovNo thread could be found in the current process corresponding to that
802ef84b7dSKonstantin Belousovspecified by the given thread ID
812ef84b7dSKonstantin Belousov.Fa thread .
822ef84b7dSKonstantin Belousov.El
832ef84b7dSKonstantin Belousov.Pp
842ef84b7dSKonstantin BelousovBecause of the debugging nature of
852ef84b7dSKonstantin Belousov.Nm pthread_get_name_np
862ef84b7dSKonstantin Belousovand
872ef84b7dSKonstantin Belousov.Nm pthread_set_name_np
882ef84b7dSKonstantin Belousovfunctions, all errors that may
89ace5be68SRuslan Ermilovappear inside are silently ignored.
90ff07dd91SEric van Gyzen.Sh SEE ALSO
91*32068667SChristian Brueffer.Xr thr_set_name 2 ,
92*32068667SChristian Brueffer.Xr pthread_np 3
934627d47bSKonstantin Belousov.Sh STANDARDS
944627d47bSKonstantin Belousov.Fn pthread_set_name_np
954627d47bSKonstantin Belousovand
964627d47bSKonstantin Belousov.Fn pthread_get_name_np
974627d47bSKonstantin Belousovare non-standard extensions.
982ef84b7dSKonstantin Belousov.Fn pthread_setname_np
992ef84b7dSKonstantin Belousovand
1002ef84b7dSKonstantin Belousov.Fn pthread_getname_np
1012ef84b7dSKonstantin Belousovare also non-standard, but are implemented by larger number of operating
1022ef84b7dSKonstantin Belousovsystems so they are in fact more portable.
103318d8cfdSAlexey Zelkin.Sh AUTHORS
104ace5be68SRuslan ErmilovThis manual page was written by
1054627d47bSKonstantin Belousov.An Alexey Zelkin Aq Mt phantom@FreeBSD.org
1064627d47bSKonstantin Belousovand
10774b7f25eSKonstantin Belousov.An Yuri Pankov Aq Mt yuripv@yuripv.net .
108