From owner-freebsd-hackers@freebsd.org Mon Apr 30 14:05:17 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 658A2FAC3F7 for ; Mon, 30 Apr 2018 14:05:17 +0000 (UTC) (envelope-from ryao@gentoo.org) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 04799863E6; Mon, 30 Apr 2018 14:05:16 +0000 (UTC) (envelope-from ryao@gentoo.org) Received: from [192.168.5.101] (pool-96-232-204-110.nycmny.fios.verizon.net [96.232.204.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: ryao) by smtp.gentoo.org (Postfix) with ESMTPSA id E2FC2335C60; Mon, 30 Apr 2018 14:05:15 +0000 (UTC) Mime-Version: 1.0 (1.0) Subject: Re: Getting pthread names From: Richard Yao X-Mailer: iPhone Mail (15E302) In-Reply-To: <20180430135711.GT6887@kib.kiev.ua> Date: Mon, 30 Apr 2018 10:05:13 -0400 Cc: Manuel St?hn , freebsd-hackers@freebsd.org Message-Id: <1B396EAB-CA2E-42C2-AEB0-AD89907EA6EF@gentoo.org> References: <20180430111434.GA18085@freebsd-t450.fritz.box> <20180430135711.GT6887@kib.kiev.ua> To: Konstantin Belousov Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Apr 2018 14:05:17 -0000 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 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. 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"=