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 6A67C43CF0; Wed, 27 Mar 2024 18:30:39 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1916F40A84; Wed, 27 Mar 2024 18:30:39 +0100 (CET) Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by mails.dpdk.org (Postfix) with ESMTP id D7DC8402A3 for ; Wed, 27 Mar 2024 18:30:34 +0100 (CET) Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-1e0d654590bso595905ad.2 for ; Wed, 27 Mar 2024 10:30:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1711560634; x=1712165434; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=ivnHgJGkP/ZNYZrtwrKEtIfLjwJiT7coa5DL4ydTuG0=; b=trp12oxdXp9qr85SlJA5A8ptebc2w3hM5aFROqCwUDIWdvV4gSyWTq24OJMdgZ7Nkv noLpni7HfgMDQJA0VPZNd9f7CGslZP3GQFgi1LhmQbkAIYitNOtfZ0ySG+iru0AdVTYm GcEh0XmHr+gMpmpVK31EY8ODJNVEx4hgGYdpGNP8ADWpHh0WmOu7NjBdVuDPdsM2TZzs AAMkbcucUGn/frEh4c0RPqM7tpzoYy+Lb9gXs27IcLUhPG43g78NdBfFdzvYmo36xA1N V0V08VjevUnt0t6ShznyeleO9bdkaMl0pTu0y1m5UkqsLEBRxv3/v3jFsenogPajMqNh zDjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711560634; x=1712165434; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ivnHgJGkP/ZNYZrtwrKEtIfLjwJiT7coa5DL4ydTuG0=; b=f1THtggDKPGDnqqk3b6NBwAuIY/6zzYP7Lui46c7X99eV14ZHbycZJ9p0o9W+qN+t+ LMRNZ1ioZ7CNcjVVFAQin3vJPXt6xoCoqVkfTdyNd5cg5/r8ZLDrNqN5sfDErDI0ZT3x cA9OVsIIRfzhqXM6IhS/SpTH7HxduA99W/Af0Kjt7PF18/gPNe5hu6E30uFfYzLw7Rn0 KCCNN28dMl78RjT50Og/q3G/R7MdswNFDmzx9KDBfuGnAsPaDu0Mc3lJ9tio+IeK8YrA rRWb51ssjH1xo22Q0aEMIQ2urFnrbZ0Q7vijG2GDYyazZqY1xmmZJIJ8uObG15pOR4DW QF8g== X-Gm-Message-State: AOJu0Yx5t7Sk4SLHMCK3OP8oNPdVlCN7Hz3HuvIWiN/Wwe8qAIeHcdig IueVEQUMk4CvnJ8/H2fRZUMJ730zK7zJnzp6nh/ou8Kp9K3Azz5/2qS48gSU6a0= X-Google-Smtp-Source: AGHT+IEtllAQZh0ia+lh68Vc8pZnU4aH87CLcw15tpXfa8h9j7e/LPiQi4qeqr7dsPPRXHipz6jAUA== X-Received: by 2002:a17:902:ea0a:b0:1e0:a110:b23a with SMTP id s10-20020a170902ea0a00b001e0a110b23amr357199plg.27.1711560633943; Wed, 27 Mar 2024 10:30:33 -0700 (PDT) Received: from hermes.local (204-195-123-203.wavecable.com. [204.195.123.203]) by smtp.gmail.com with ESMTPSA id x19-20020a170902821300b001dffa622527sm9264058pln.225.2024.03.27.10.30.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 10:30:33 -0700 (PDT) Date: Wed, 27 Mar 2024 10:30:31 -0700 From: Stephen Hemminger To: Tyler Retzlaff Cc: dev@dpdk.org, Dmitry Kozlyuk , Pallavi Kadam Subject: Re: [PATCH v16 03/15] windows: add os shim for localtime_r Message-ID: <20240327103031.44df75c0@hermes.local> In-Reply-To: <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> <20240327165659.GB8905@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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, 27 Mar 2024 09:56:59 -0700 Tyler Retzlaff wrote: > 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 > I was just copying what clock_gettime was doing. But yes, should really do global update to rte_localtime()