Date: Mon, 30 Apr 2018 10:05:13 -0400 From: Richard Yao <ryao@gentoo.org> To: Konstantin Belousov <kib@freebsd.org> Cc: Manuel St?hn <freebsdnewbie@freenet.de>, freebsd-hackers@freebsd.org Subject: Re: Getting pthread names Message-ID: <1B396EAB-CA2E-42C2-AEB0-AD89907EA6EF@gentoo.org> In-Reply-To: <20180430135711.GT6887@kib.kiev.ua> References: <20180430111434.GA18085@freebsd-t450.fritz.box> <20180430135711.GT6887@kib.kiev.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
It sounds like someone could use that to implement pthread_getname_np(3). https://www.freebsd.org/cgi/man.cgi?query=3Dsysctl&sektion=3D3&apropos=3D0&m= anpath=3DFreeBSD+11.1-RELEASE+and+Ports > On Apr 30, 2018, at 9:57 AM, Konstantin Belousov <kib@freebsd.org> wrote: >=20 >> On Mon, Apr 30, 2018 at 01:14:34PM +0200, Manuel St?hn wrote: >> Hi, >>=20 >> for setting a name for pthreads i found pthread_set_name_np(3), but for=20= >> retrieving the name i found nothing. Is there any api like=20 >> pthread_getname_np for FreeBSD? Or is there another way to retrieve the=20= >> threads name within an application? >=20 > Not like pthread_getname_np(), but still something. You can use > (binary) sysctl kern.proc.pid.<pid> to get struct kinfo_proc for all > threads. In the structure, the ki_tdname() member contains the thread > name as set by pthread_set_name_np(3). > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1B396EAB-CA2E-42C2-AEB0-AD89907EA6EF>