Getting pthread names
Richard Yao
ryao at gentoo.org
Mon Apr 30 14:05:17 UTC 2018
It sounds like someone could use that to implement pthread_getname_np(3).
https://www.freebsd.org/cgi/man.cgi?query=sysctl&sektion=3&apropos=0&manpath=FreeBSD+11.1-RELEASE+and+Ports
> On Apr 30, 2018, at 9:57 AM, Konstantin Belousov <kib at freebsd.org> wrote:
>
>> On Mon, Apr 30, 2018 at 01:14:34PM +0200, Manuel St?hn wrote:
>> Hi,
>>
>> for setting a name for pthreads i found pthread_set_name_np(3), but for
>> retrieving the name i found nothing. Is there any api like
>> pthread_getname_np for FreeBSD? Or is there another way to retrieve the
>> threads name within an application?
>
> 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 at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"
More information about the freebsd-hackers
mailing list