From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <thomas.monjalon@6wind.com>
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 <dev@dpdk.org>; Wed, 25 Nov 2015 12:19:20 +0100 (CET)
Received: by wmvv187 with SMTP id v187so251912251wmv.1
 for <dev@dpdk.org>; Wed, 25 Nov 2015 03:19:20 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=6wind-com.20150623.gappssmtp.com; s=20150623;
 h=from:to:cc:subject:date:message-id:organization:user-agent
 :in-reply-to:references:mime-version:content-transfer-encoding
 :content-type; bh=QhapFQmxn8h2dPReZKag9p4bjYOoccXg8Sa5Z9R/CrY=;
 b=T8T3QPwF0hta4wokvujTMzHpMK3Py/5SllV64KcrUnMqovSM8k33H1pYKTlBWcgIXt
 qEYg6uSFNUIIhmmzkQUp0jDX8V9uLiWbuJ3nQ+uEuQiXvJIoHC/tHEJ4JtW85IHzHmcn
 LdRZa7CfgYU7Osp8P7qzVh8vgJrCluMaAx88+xzyNwo7UrpayDi7QgD9CD5WwzZfLdWN
 kWQP4xhOn3386H2+XJLogpzPCYkQLcJTvOihZpoBXTMOzwVjXw2iqGucoeedEdZXL0NH
 oHJ9lpk+neNmwvxfF1XWETQeT0siYJIFrk3HEVQqerhXxkYBX4Ii3Cb1uInzE9fUvB0Z
 Z8jg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:organization
 :user-agent:in-reply-to:references:mime-version
 :content-transfer-encoding:content-type;
 bh=QhapFQmxn8h2dPReZKag9p4bjYOoccXg8Sa5Z9R/CrY=;
 b=c9HsTR+HMabp8E4DeYl4Mgoiwm/KzQ8cpjuiWupUHOt2uvFhsSSowqOXzkHNev0Acx
 c6MuFcniJJZai5l20NZBDwMBeoOVYrlUG60lk83h+W0PsArm5fD70/FWeQHc+Wl5I+JB
 yzAA44smWPTIDqsslSrgC2ojlTQVKIGXVmmiemPqI+cbjQOLmStbhPmg21Bi04JEZXJ5
 wUh+LPlUnafFrMFkAvi4XEusVodAVjkqLhKNyDBW3xeAFXF4KDacihP5xk/wEjt/HBdi
 8uYAdvje7atSCGdeTI5m0WgnI8VanfS4XJnSL9AopIdjHtBz8klQuPBpMi+4uyl9MKF8
 Vmng==
X-Gm-Message-State: ALoCoQnlyTBQs0oQMPYLDiH8BfQ1kMvAtLhCbJzJMvCOJsNjCbjsFWFl7ZnqIaDGeWWF6LXIeenL
X-Received: by 10.194.63.142 with SMTP id g14mr41631351wjs.161.1448450360061; 
 Wed, 25 Nov 2015 03:19:20 -0800 (PST)
Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136])
 by smtp.gmail.com with ESMTPSA id da10sm22590013wjb.22.2015.11.25.03.19.19
 (version=TLSv1/SSLv3 cipher=OTHER);
 Wed, 25 Nov 2015 03:19:19 -0800 (PST)
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Date: Wed, 25 Nov 2015 12:18:02 +0100
Message-ID: <1544258.6QNHahyajJ@xps13>
Organization: 6WIND
User-Agent: KMail/4.14.10 (Linux/4.1.6-1-ARCH; KDE/4.14.11; x86_64; ; )
In-Reply-To: <1448450035-23991-1-git-send-email-ferruh.yigit@intel.com>
References: <20151124184755.GA26521@sivlogin002.ir.intel.com>
 <1448450035-23991-1-git-send-email-ferruh.yigit@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
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 <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Wed, 25 Nov 2015 11:19:20 -0000

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.