From owner-svn-src-head@freebsd.org Thu Jun 4 02:30:24 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B0CC82FD474; Thu, 4 Jun 2020 02:30:24 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49cqWN3zzVz4P7x; Thu, 4 Jun 2020 02:30:24 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from freefall.freebsd.org (static-71-168-218-4.cmdnnj.fios.verizon.net [71.168.218.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jkim/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 736CF2B95D; Thu, 4 Jun 2020 02:30:24 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Subject: Re: svn commit: r361770 - in head: include lib/libthr lib/libthr/thread share/man/man3 To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202006032054.053KsbSs081539@repo.freebsd.org> From: Jung-uk Kim Autocrypt: addr=jkim@FreeBSD.org; prefer-encrypt=mutual; keydata= mQENBFJBztUBCAChqNyGqmFuNo0U7MBzsD+q/G6Cv0l7LGVrOAsgh34M8wIWhD+tztDWMVfn AhxNDd0ceCj2bYOe67sTQxAScEcbt2FfvPOLp9MEXb9qohZj172Gwkk7dnhOhZZKhVGVZKM4 NcsuBDUzgf4f3Vdzj4wg6WlqplnTZo8lPE4hZ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IsTCxUEqY7W/pT84sMg5/QD3s6ufTRncvq14fEOxCNq1Rf4Q 9P+tOFa8GZfKDGB2BFGIrW7uT5mlmKdK1vO6ZIA930y5kUsnCmBUEBJkE2ciSQk01aB/1o62 Q3Gk/F6BwtNY9OXiqF7AcAo+K/BMIaqb26QKeh+IIgK1NN9dQiq3ByTbl4zpGZa6MmsnnRTu mzGKt2nkz7vBzH6+hZp1OzGZikgjjhYWVFoJo1dvf/rv4obs0ZJEqFPQs/1Qa1dbkKBv6odB XJpPH0ssOluTY24d1XxTiKTwmWvHeQkOKRAIfD7VTtF4TesoZYkf7hsh3e3VwXhptSLFnEOi WwYofg== Message-ID: Date: Wed, 3 Jun 2020 22:30:18 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.8.1 MIME-Version: 1.0 In-Reply-To: <202006032054.053KsbSs081539@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2020 02:30:24 -0000 On 20. 6. 3., Konstantin Belousov wrote: > Author: kib > Date: Wed Jun 3 20:54:36 2020 > New Revision: 361770 > URL: https://svnweb.freebsd.org/changeset/base/361770 > > Log: > Add pthread_getname_np() and pthread_setname_np() aliases > > for pthread_get_name_np() and pthread_set_name_np(), to be > compatible with Linux. > > PR: 238404 > Proposed and reviewed by: markj > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > Differential revision: https://reviews.freebsd.org/D25117 > > Modified: > head/include/pthread_np.h > head/lib/libthr/pthread.map > head/lib/libthr/thread/thr_info.c > head/share/man/man3/Makefile > head/share/man/man3/pthread_set_name_np.3 > > Modified: head/include/pthread_np.h > ============================================================================== > --- head/include/pthread_np.h Wed Jun 3 20:42:52 2020 (r361769) > +++ head/include/pthread_np.h Wed Jun 3 20:54:36 2020 (r361770) > @@ -50,6 +50,7 @@ int pthread_attr_get_np(pthread_t, pthread_attr_t *); > int pthread_attr_getaffinity_np(const pthread_attr_t *, size_t, cpuset_t *); > int pthread_attr_setaffinity_np(pthread_attr_t *, size_t, const cpuset_t *); > void pthread_get_name_np(pthread_t, char *, size_t); > +void pthread_getname_np(pthread_t, char *, size_t); > int pthread_getaffinity_np(pthread_t, size_t, cpuset_t *); > int pthread_getthreadid_np(void); > int pthread_main_np(void); > @@ -65,6 +66,7 @@ void pthread_resume_all_np(void); > int pthread_resume_np(pthread_t); > int pthread_peekjoin_np(pthread_t, void **); > void pthread_set_name_np(pthread_t, const char *); > +void pthread_setname_np(pthread_t, const char *); > int pthread_setaffinity_np(pthread_t, size_t, const cpuset_t *); > int pthread_single_np(void); > void pthread_suspend_all_np(void); > > Modified: head/lib/libthr/pthread.map > ============================================================================== > --- head/lib/libthr/pthread.map Wed Jun 3 20:42:52 2020 (r361769) > +++ head/lib/libthr/pthread.map Wed Jun 3 20:54:36 2020 (r361770) > @@ -328,5 +328,7 @@ FBSD_1.5 { > }; > > FBSD_1.6 { > + pthread_getname_np; > pthread_peekjoin_np; > + pthread_setname_np; > }; > > Modified: head/lib/libthr/thread/thr_info.c > ============================================================================== > --- head/lib/libthr/thread/thr_info.c Wed Jun 3 20:42:52 2020 (r361769) > +++ head/lib/libthr/thread/thr_info.c Wed Jun 3 20:54:36 2020 (r361770) > @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); > #include "thr_private.h" > > __weak_reference(_pthread_set_name_np, pthread_set_name_np); > +__weak_reference(_pthread_set_name_np, pthread_setname_np); > > static void > thr_set_name_np(struct pthread *thread, const char *name) > @@ -89,6 +90,7 @@ thr_get_name_np(struct pthread *thread, char *buf, siz > } > > __weak_reference(_pthread_get_name_np, pthread_get_name_np); > +__weak_reference(_pthread_get_name_np, pthread_getname_np); > > void > _pthread_get_name_np(pthread_t thread, char *buf, size_t len) > > Modified: head/share/man/man3/Makefile > ============================================================================== > --- head/share/man/man3/Makefile Wed Jun 3 20:42:52 2020 (r361769) > +++ head/share/man/man3/Makefile Wed Jun 3 20:54:36 2020 (r361770) > @@ -493,7 +493,9 @@ PTHREAD_MLINKS+=pthread_rwlock_rdlock.3 pthread_rwlock > PTHREAD_MLINKS+=pthread_rwlock_wrlock.3 pthread_rwlock_trywrlock.3 > PTHREAD_MLINKS+=pthread_schedparam.3 pthread_getschedparam.3 \ > pthread_schedparam.3 pthread_setschedparam.3 > -PTHREAD_MLINKS+=pthread_set_name_np.3 pthread_get_name_np.3 > +PTHREAD_MLINKS+=pthread_set_name_np.3 pthread_get_name_np.3 \ > + pthread_set_name_np.3 pthread_getname_np.3 \ > + pthread_set_name_np.3 pthread_setname_np.3 > PTHREAD_MLINKS+=pthread_spin_init.3 pthread_spin_destroy.3 \ > pthread_spin_lock.3 pthread_spin_trylock.3 \ > pthread_spin_lock.3 pthread_spin_unlock.3 > > Modified: head/share/man/man3/pthread_set_name_np.3 > ============================================================================== > --- head/share/man/man3/pthread_set_name_np.3 Wed Jun 3 20:42:52 2020 (r361769) > +++ head/share/man/man3/pthread_set_name_np.3 Wed Jun 3 20:54:36 2020 (r361770) > @@ -24,12 +24,14 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd August 12, 2018 > +.Dd June 3, 2020 > .Dt PTHREAD_SET_NAME_NP 3 > .Os > .Sh NAME > .Nm pthread_get_name_np , > +.Nm pthread_getname_np , > .Nm pthread_set_name_np > +.Nm pthread_setname_np > .Nd set and retrieve the thread name > .Sh LIBRARY > .Lb libpthread > @@ -38,18 +40,26 @@ > .Ft void > .Fn pthread_get_name_np "pthread_t thread" "char *name" "size_t len" > .Ft void > +.Fn pthread_getname_np "pthread_t thread" "char *name" "size_t len" > +.Ft void > .Fn pthread_set_name_np "pthread_t thread" "const char *name" > +.Ft void > +.Fn pthread_setname_np "pthread_t thread" "const char *name" > .Sh DESCRIPTION > The > .Fn pthread_set_name_np > -function applies a copy of the given > +and > +.Fn pthread_setname_np > +functions applies a copy of the given > .Fa name > to the given > .Fa thread . > .Pp > The > .Fn pthread_get_name_np > -function retrieves the > +and > +.Fn pthread_getname_np > +functions retrieves the > .Fa name > associated with > .Fa thread . > @@ -70,6 +80,11 @@ appear inside are silently ignored. > and > .Fn pthread_get_name_np > are non-standard extensions. > +.Fn pthread_setname_np > +and > +.Fn pthread_getname_np > +are also non-standard, but are implemented by larger number of operating > +systems so they are in fact more portable. > .Sh AUTHORS > This manual page was written by > .An Alexey Zelkin Aq Mt phantom@FreeBSD.org It broke Firefox build and I found Linux pthread_{get,set}name_np(3) returns int. https://linux.die.net/man/3/pthread_getname_np I guess you need to write a wrapper. Please revert this patch for now. Jung-uk Kim