From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C7825A052A; Fri, 10 Jul 2020 14:41:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A872D1DC4E; Fri, 10 Jul 2020 14:41:39 +0200 (CEST) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id D49351DC4E for ; Fri, 10 Jul 2020 14:41:37 +0200 (CEST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 4E5305C014E; Fri, 10 Jul 2020 08:41:37 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Fri, 10 Jul 2020 08:41:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm1; bh= whF71fYvFVnoQz/RblPRwKpi0iUqAFvmRA6rKqUqF8Q=; b=oA2UI9rpxBLG7vYH 2dYzeKBBk0/OqURqRmd27eC9HHb201hhrLdGvcVrnP/PP7xEhGRhmXq+n+Dku9NF 8+UjymU+vLLmZ1OBO5zZ5Vma2mTtkf/4qdFHPzEeu0MspJKx6s69dx0ZHxlBP1g8 QzDHV7ZKEEb60ZoWLDWmDin8ARcpXagMGf69rEd1uTz+zm1oVCw5t4Mm54KZ8GZ3 dSflXmdWIejQEuGFe/Ep7tYw+R2WGr/voT14WpXf77EdcwDS3fWDGN85FZKej8Cf bXvmON71JQIZDlwNa9LUixtIQtOyuDTgGx22sVmxI6dakEkXA1pTmeuTi5mI9t4Q pcAK9A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=whF71fYvFVnoQz/RblPRwKpi0iUqAFvmRA6rKqUqF 8Q=; b=emTTKZGtBriD6mTQPgv0oVpBnlJQFq1ypTNXlLQwbmp7gcP1qe/U2DLL5 P4cXY6aDKVgLBPNMQr1VxdFJaW9X7613Pm0/9gFmHoCgbfd9KBh/GDJ43A6UQj2L 7UE5GwExN46GAucG5oGZy9KSx9FJ5UaMX5uDnG1OqM8a7e12UfzhcmrMt67MPRlx waivNL4C2O1soTIU/Kbz6lZYemRUytn5K5xA20TVb+Ck58i/jUrE45MhI969fh5Y mdw2XaZ7OQnGBQWqc1K64TZhm4beEnOP6jJsUIzn0KKcz5OhTmjXnx3msJGdg+B0 LJINUiyZlsnPsafAco1MtJYCoG3bg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrvddugdehlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdejueei iedvffegheenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhho nhdrnhgvth X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id B0F38328005D; Fri, 10 Jul 2020 08:41:36 -0400 (EDT) From: Thomas Monjalon To: David Marchand Cc: dev@dpdk.org Date: Fri, 10 Jul 2020 14:41:35 +0200 Message-ID: <3387414.ACgpzotbJP@thomas> In-Reply-To: <20200710094551.3716-1-david.marchand@redhat.com> References: <20200710094551.3716-1-david.marchand@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] eal/linux: truncate thread name X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 10/07/2020 11:45, David Marchand: > pthread_setname_np refuses names larger than 16 bytes (\0 included). > Rather than return an error, truncate the name to this limit in the > rte_thread_setname helper. [...] > --- a/lib/librte_eal/linux/eal_thread.c > +++ b/lib/librte_eal/linux/eal_thread.c > @@ -153,7 +153,10 @@ int rte_thread_setname(pthread_t id, const char *name) > int ret = ENOSYS; > #if defined(__GLIBC__) && defined(__GLIBC_PREREQ) > #if __GLIBC_PREREQ(2, 12) > - ret = pthread_setname_np(id, name); > + char truncated[16]; That's a pity POSIX is not defining a constant for this limit. > + > + strlcpy(truncated, name, sizeof(truncated)); > + ret = pthread_setname_np(id, truncated); > #endif > #endif Acked-by: Thomas Monjalon