1.\" $OpenBSD: pthread_set_name_np.3,v 1.8 2019/02/04 18:06:32 jmc Exp $
2.\" David Leonard <d@openbsd.org>, 1999. Public domain.
3.Dd $Mdocdate: February 4 2019 $
4.Dt PTHREAD_SET_NAME_NP 3
5.Os
6.Sh NAME
7.Nm pthread_set_name_np ,
8.Nm pthread_get_name_np
9.Nd set the name of a thread
10.Sh SYNOPSIS
11.In pthread.h
12.In pthread_np.h
13.Ft void
14.Fn pthread_set_name_np "pthread_t thread" "const char *name"
15.Ft void
16.Fn pthread_get_name_np "pthread_t thread" "char *name" "size_t len"
17.Sh DESCRIPTION
18The
19.Fn pthread_set_name_np
20function associates
21.Fa name
22with
23.Fa thread .
24This can be useful for debugging, as the name is displayed in
25the thread status as displayed when the process receives the
26.Dv SIGINFO
27signal.
28.Pp
29The string pointed to by
30.Fa name
31is copied, and so need not be valid for the life of the thread.
32.Pp
33The
34.Fn pthread_get_name_np
35function retrieves
36.Fa name
37associated with
38.Fa thread .
39.Sh SEE ALSO
40.Xr pthreads 3
41.Sh STANDARDS
42These functions are non-portable and may not be supported with the above
43semantics on other POSIX systems.
44