From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 5D4158D96 for ; Wed, 25 Nov 2015 12:24:43 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 25 Nov 2015 03:24:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,342,1444719600"; d="scan'208";a="606876241" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by FMSMGA003.fm.intel.com with ESMTP; 25 Nov 2015 03:24:41 -0800 Received: from sivlogin002.ir.intel.com (sivlogin002.ir.intel.com [10.237.217.37]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id tAPBOfYD015266; Wed, 25 Nov 2015 11:24:41 GMT Received: from sivlogin002.ir.intel.com (localhost [127.0.0.1]) by sivlogin002.ir.intel.com with ESMTP id tAPBOeqh015448; Wed, 25 Nov 2015 11:24:40 GMT Received: (from fyigit@localhost) by sivlogin002.ir.intel.com with œ id tAPBOeiF015444; Wed, 25 Nov 2015 11:24:40 GMT X-Authentication-Warning: sivlogin002.ir.intel.com: fyigit set sender to ferruh.yigit@intel.com using -f Date: Wed, 25 Nov 2015 11:24:40 +0000 From: Ferruh Yigit To: Thomas Monjalon Message-ID: <20151125112440.GA13407@sivlogin002.ir.intel.com> Mail-Followup-To: Thomas Monjalon , dev@dpdk.org References: <20151124184755.GA26521@sivlogin002.ir.intel.com> <1448450035-23991-1-git-send-email-ferruh.yigit@intel.com> <1544258.6QNHahyajJ@xps13> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1544258.6QNHahyajJ@xps13> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v2] eal: fix compile error for old glibc caused by pthread_setname_np() X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2015 11:24:43 -0000 On Wed, Nov 25, 2015 at 12:18:02PM +0100, Thomas Monjalon wrote: > 2015-11-25 11:13, Ferruh Yigit: > > +/** > > + * Set thread names. > > + * > > + * Macro to wrap `pthread_setname_np()` with a glibc version check. > > + * Only glibc >= 2.12 supports this feature. > > + * > > + * This macro only used for Linux, BSD does direct libc call. > > + * BSD libc version of function is `pthread_set_name_np()`. > > + */ > > +#if defined(__DOXYGEN__) > > +#define rte_thread_setname(...) pthread_setname_np(__VA_ARGS__) > > +#endif > > + > > +#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) > > +#if __GLIBC_PREREQ(2, 12) > > +#define rte_thread_setname(...) pthread_setname_np(__VA_ARGS__) > > +#else > > +#define rte_thread_setname(...) 0 > > +#endif > > +#endif > > OK it is a first (and important) fix. > EAL is an abstraction for Linux and FreeBSD, so ideally another patch would > make rte_thread_setname working for BSD too. I wasn't sure to do that update, since BSD has nothing with glibc versions. Do you want me amend this patch to update BSD usage to rte_thread_setname? thanks, ferruh