From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4AC1943D55; Wed, 27 Mar 2024 17:57:02 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E58FC402B2; Wed, 27 Mar 2024 17:57:01 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 85BB7402A3 for ; Wed, 27 Mar 2024 17:57:00 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id D9EE0209599D; Wed, 27 Mar 2024 09:56:59 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com D9EE0209599D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1711558619; bh=kqeo2/oCcRRiORinRG4nwQXkJv6g5z4uHX5uUZfQOpo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Ht3hZbQCfwMEDfQQ+WYmL0j9woaYZfp36IG3LknVREQM7AIl+C4pRp9VE7tAnyBJl b+Ntzgic5GY930MxejwEBIIPvU/NuvyPhYgn+LzDY2l7uwEPqIsLK8c0m1TPY0XQCU PAu3nHxkXUFeaT3nQI4z3yfDe0RAe5lI6aymkpYs= Date: Wed, 27 Mar 2024 09:56:59 -0700 From: Tyler Retzlaff To: Stephen Hemminger Cc: dev@dpdk.org, Dmitry Kozlyuk , Pallavi Kadam Subject: Re: [PATCH v16 03/15] windows: add os shim for localtime_r Message-ID: <20240327165659.GB8905@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <20200814173441.23086-1-stephen@networkplumber.org> <20240327164726.68732-1-stephen@networkplumber.org> <20240327164726.68732-4-stephen@networkplumber.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240327164726.68732-4-stephen@networkplumber.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Wed, Mar 27, 2024 at 09:45:21AM -0700, Stephen Hemminger wrote: > Windows does not have localtime_r but it does have a similar > function that can be used instead. > > Signed-off-by: Stephen Hemminger > --- > lib/eal/windows/include/rte_os_shim.h | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/lib/eal/windows/include/rte_os_shim.h b/lib/eal/windows/include/rte_os_shim.h > index eda8113662..e9741a9df2 100644 > --- a/lib/eal/windows/include/rte_os_shim.h > +++ b/lib/eal/windows/include/rte_os_shim.h > @@ -110,4 +110,14 @@ rte_clock_gettime(clockid_t clock_id, struct timespec *tp) > } > #define clock_gettime(clock_id, tp) rte_clock_gettime(clock_id, tp) > > +static inline struct tm * > +rte_localtime_r(const time_t *timer, struct tm *buf) > +{ > + if (localtime_s(buf, timer) == 0) > + return buf; > + else > + return NULL; > +} > +#define localtime_r(timer, buf) rte_localtime_r(timer, buf) hm, i'm always a bit concerned about expressing platform standard names from dpdk api surface. i think we should just expose and use rte_localtime_r() and not present localtime_r. can be treated as a suggestion. Acked-by: Tyler Retzlaff