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.\" 25318d8cfdSAlexey Zelkin.\" $FreeBSD$ 26318d8cfdSAlexey Zelkin.\" 27*2ef84b7dSKonstantin Belousov.Dd June 3, 2020 28318d8cfdSAlexey Zelkin.Dt PTHREAD_SET_NAME_NP 3 29318d8cfdSAlexey Zelkin.Os 30318d8cfdSAlexey Zelkin.Sh NAME 314627d47bSKonstantin Belousov.Nm pthread_get_name_np , 32*2ef84b7dSKonstantin Belousov.Nm pthread_getname_np , 33318d8cfdSAlexey Zelkin.Nm pthread_set_name_np 34*2ef84b7dSKonstantin Belousov.Nm pthread_setname_np 354627d47bSKonstantin Belousov.Nd set and retrieve the thread name 36318d8cfdSAlexey Zelkin.Sh LIBRARY 37ec7452f1SRuslan Ermilov.Lb libpthread 38318d8cfdSAlexey Zelkin.Sh SYNOPSIS 39318d8cfdSAlexey Zelkin.In pthread_np.h 40318d8cfdSAlexey Zelkin.Ft void 414627d47bSKonstantin Belousov.Fn pthread_get_name_np "pthread_t thread" "char *name" "size_t len" 42*2ef84b7dSKonstantin Belousov.Ft int 43*2ef84b7dSKonstantin Belousov.Fn pthread_getname_np "pthread_t thread" "char *name" "size_t len" 444627d47bSKonstantin Belousov.Ft void 45ff07dd91SEric van Gyzen.Fn pthread_set_name_np "pthread_t thread" "const char *name" 46*2ef84b7dSKonstantin Belousov.Ft int 47*2ef84b7dSKonstantin Belousov.Fn pthread_setname_np "pthread_t thread" "const char *name" 48318d8cfdSAlexey Zelkin.Sh DESCRIPTION 49318d8cfdSAlexey ZelkinThe 50318d8cfdSAlexey Zelkin.Fn pthread_set_name_np 51*2ef84b7dSKonstantin Belousovand 52*2ef84b7dSKonstantin Belousov.Fn pthread_setname_np 53*2ef84b7dSKonstantin Belousovfunctions apply a copy of the given 54318d8cfdSAlexey Zelkin.Fa name 55ff07dd91SEric van Gyzento the given 56ff07dd91SEric van Gyzen.Fa thread . 574627d47bSKonstantin Belousov.Pp 584627d47bSKonstantin BelousovThe 594627d47bSKonstantin Belousov.Fn pthread_get_name_np 60*2ef84b7dSKonstantin Belousovand 61*2ef84b7dSKonstantin Belousov.Fn pthread_getname_np 62*2ef84b7dSKonstantin Belousovfunctions retrieve the 634627d47bSKonstantin Belousov.Fa name 644627d47bSKonstantin Belousovassociated with 654627d47bSKonstantin Belousov.Fa thread . 664627d47bSKonstantin BelousovIf 674627d47bSKonstantin Belousov.Fn pthread_set_name_np 684627d47bSKonstantin Belousovwas not previously called for 694627d47bSKonstantin Belousov.Fa thread , 704627d47bSKonstantin Belousovthe buffer pointed to by 714627d47bSKonstantin Belousov.Fa name 724627d47bSKonstantin Belousovwill be empty. 73318d8cfdSAlexey Zelkin.Sh ERRORS 74*2ef84b7dSKonstantin BelousovThe 75*2ef84b7dSKonstantin Belousov.Nm pthread_getname_np 76*2ef84b7dSKonstantin Belousovand 77*2ef84b7dSKonstantin Belousov.Nm pthread_setname_np 78*2ef84b7dSKonstantin Belousovwill fail if 79*2ef84b7dSKonstantin Belousov.Bl -tag -width Er 80*2ef84b7dSKonstantin Belousov.It Bq Er ESRCH 81*2ef84b7dSKonstantin BelousovNo thread could be found in the current process corresponding to that 82*2ef84b7dSKonstantin Belousovspecified by the given thread ID 83*2ef84b7dSKonstantin Belousov.Fa thread . 84*2ef84b7dSKonstantin Belousov.El 85*2ef84b7dSKonstantin Belousov.Pp 86*2ef84b7dSKonstantin BelousovBecause of the debugging nature of 87*2ef84b7dSKonstantin Belousov.Nm pthread_get_name_np 88*2ef84b7dSKonstantin Belousovand 89*2ef84b7dSKonstantin Belousov.Nm pthread_set_name_np 90*2ef84b7dSKonstantin Belousovfunctions, all errors that may 91ace5be68SRuslan Ermilovappear inside are silently ignored. 92ff07dd91SEric van Gyzen.Sh SEE ALSO 93ff07dd91SEric van Gyzen.Xr thr_set_name 2 944627d47bSKonstantin Belousov.Sh STANDARDS 954627d47bSKonstantin Belousov.Fn pthread_set_name_np 964627d47bSKonstantin Belousovand 974627d47bSKonstantin Belousov.Fn pthread_get_name_np 984627d47bSKonstantin Belousovare non-standard extensions. 99*2ef84b7dSKonstantin Belousov.Fn pthread_setname_np 100*2ef84b7dSKonstantin Belousovand 101*2ef84b7dSKonstantin Belousov.Fn pthread_getname_np 102*2ef84b7dSKonstantin Belousovare also non-standard, but are implemented by larger number of operating 103*2ef84b7dSKonstantin Belousovsystems so they are in fact more portable. 104318d8cfdSAlexey Zelkin.Sh AUTHORS 105ace5be68SRuslan ErmilovThis manual page was written by 1064627d47bSKonstantin Belousov.An Alexey Zelkin Aq Mt phantom@FreeBSD.org 1074627d47bSKonstantin Belousovand 10874b7f25eSKonstantin Belousov.An Yuri Pankov Aq Mt yuripv@yuripv.net . 109