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.\" 27df7d7638SFelix Johnson.Dd October 12, 2021 28318d8cfdSAlexey Zelkin.Dt PTHREAD_SET_NAME_NP 3 29318d8cfdSAlexey Zelkin.Os 30318d8cfdSAlexey Zelkin.Sh NAME 314627d47bSKonstantin Belousov.Nm pthread_get_name_np , 322ef84b7dSKonstantin Belousov.Nm pthread_getname_np , 33*32068667SChristian Brueffer.Nm pthread_set_name_np , 342ef84b7dSKonstantin 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" 422ef84b7dSKonstantin Belousov.Ft int 432ef84b7dSKonstantin 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" 462ef84b7dSKonstantin Belousov.Ft int 472ef84b7dSKonstantin Belousov.Fn pthread_setname_np "pthread_t thread" "const char *name" 48318d8cfdSAlexey Zelkin.Sh DESCRIPTION 49318d8cfdSAlexey ZelkinThe 50318d8cfdSAlexey Zelkin.Fn pthread_set_name_np 512ef84b7dSKonstantin Belousovand 522ef84b7dSKonstantin Belousov.Fn pthread_setname_np 532ef84b7dSKonstantin 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 602ef84b7dSKonstantin Belousovand 612ef84b7dSKonstantin Belousov.Fn pthread_getname_np 622ef84b7dSKonstantin 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 742ef84b7dSKonstantin BelousovThe 752ef84b7dSKonstantin Belousov.Nm pthread_getname_np 762ef84b7dSKonstantin Belousovand 772ef84b7dSKonstantin Belousov.Nm pthread_setname_np 782ef84b7dSKonstantin Belousovwill fail if 792ef84b7dSKonstantin Belousov.Bl -tag -width Er 802ef84b7dSKonstantin Belousov.It Bq Er ESRCH 812ef84b7dSKonstantin BelousovNo thread could be found in the current process corresponding to that 822ef84b7dSKonstantin Belousovspecified by the given thread ID 832ef84b7dSKonstantin Belousov.Fa thread . 842ef84b7dSKonstantin Belousov.El 852ef84b7dSKonstantin Belousov.Pp 862ef84b7dSKonstantin BelousovBecause of the debugging nature of 872ef84b7dSKonstantin Belousov.Nm pthread_get_name_np 882ef84b7dSKonstantin Belousovand 892ef84b7dSKonstantin Belousov.Nm pthread_set_name_np 902ef84b7dSKonstantin Belousovfunctions, all errors that may 91ace5be68SRuslan Ermilovappear inside are silently ignored. 92ff07dd91SEric van Gyzen.Sh SEE ALSO 93*32068667SChristian Brueffer.Xr thr_set_name 2 , 94*32068667SChristian Brueffer.Xr pthread_np 3 954627d47bSKonstantin Belousov.Sh STANDARDS 964627d47bSKonstantin Belousov.Fn pthread_set_name_np 974627d47bSKonstantin Belousovand 984627d47bSKonstantin Belousov.Fn pthread_get_name_np 994627d47bSKonstantin Belousovare non-standard extensions. 1002ef84b7dSKonstantin Belousov.Fn pthread_setname_np 1012ef84b7dSKonstantin Belousovand 1022ef84b7dSKonstantin Belousov.Fn pthread_getname_np 1032ef84b7dSKonstantin Belousovare also non-standard, but are implemented by larger number of operating 1042ef84b7dSKonstantin Belousovsystems so they are in fact more portable. 105318d8cfdSAlexey Zelkin.Sh AUTHORS 106ace5be68SRuslan ErmilovThis manual page was written by 1074627d47bSKonstantin Belousov.An Alexey Zelkin Aq Mt phantom@FreeBSD.org 1084627d47bSKonstantin Belousovand 10974b7f25eSKonstantin Belousov.An Yuri Pankov Aq Mt yuripv@yuripv.net . 110