From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v2] eal: fix compile error for old glibc caused by pthread_setname_np() Date: Wed, 25 Nov 2015 12:18:02 +0100 Message-ID: <1544258.6QNHahyajJ@xps13> References: <20151124184755.GA26521@sivlogin002.ir.intel.com> <1448450035-23991-1-git-send-email-ferruh.yigit@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: Ferruh Yigit Return-path: Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) by dpdk.org (Postfix) with ESMTP id 493238D85 for ; Wed, 25 Nov 2015 12:19:20 +0100 (CET) Received: by wmvv187 with SMTP id v187so251912251wmv.1 for ; Wed, 25 Nov 2015 03:19:20 -0800 (PST) In-Reply-To: <1448450035-23991-1-git-send-email-ferruh.yigit@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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.