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 8AB5843D5B; Thu, 28 Mar 2024 00:30:31 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7F2CE410E3; Thu, 28 Mar 2024 00:30:18 +0100 (CET) Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by mails.dpdk.org (Postfix) with ESMTP id D2B2F406BC for ; Thu, 28 Mar 2024 00:30:13 +0100 (CET) Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1e0000cdf99so3655715ad.0 for ; Wed, 27 Mar 2024 16:30:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1711582213; x=1712187013; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Ml0gchs9dNogvSJKCUa91H765fGAaDYpR/DhR359d/Q=; b=OVWhBJGsTxaTbhiqgQVvk6yonzFiMxglLL4Rmnu1JPThdaAR4ACFKJFB325512RfSA W6Dq8cEcS51AUHHSDREPSvEKEf7VLob8JBYdSOKjRLlpWVYZq09LJYgEqBCEwAk0no4a kSMlSCfO0Ha0GechdLXi377WHN20H0C+kdpxjmkgTK6ACt69/xlp3pmFbk88AM2LVB6b 79OSfMny7/9kp142hITSzYJabv0bMYkGdYAFYLurd7vGkyYcXB3vGQpmDkyEdSud8GPZ aUaFzlazdTe88mU/znTzYCmQZUKw3P4eoAh1YemqxYqXsnhzM8mNy0L95r9WOxktjXDV VyFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711582213; x=1712187013; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ml0gchs9dNogvSJKCUa91H765fGAaDYpR/DhR359d/Q=; b=lrmewJ9qxRCqStfWYUAnDLHejJILUUoFa6Flf1CnOkhWri+stilx6vxad/k3k9DK6A EB5pRmn+o35dhv6jfYNYecBH/mQBLd1qWX42aug6DbcM57EzrM9PNLL6v6Nu/ybCW+lN fHMsjO2H23VXg5/85OrvJN5doP+kbInAdys5bLetKdcsVxfmsJklbV7lBKKwQL8mi3/9 s8PyyMiAV/qcQ6zVWwwrYw8D5r0sn2N7jP3KGM7d9133jxzZBJPOrJtbKgaOfQds59PV DzqYFk1UJJcNB9hNXu4ZHK2yj0vsDp2+nneS4lV+2R7mEhcML5+BfGYK6u0q21aMtHSf Ax3g== X-Gm-Message-State: AOJu0Yy5bCygCOKwz2fWrM+CPyIXl4H72a4ARET3jprzCt16Qx9J9EC8 By6YJFaMgVwJHGf4yf/GnY355TRvBOP+QCH6RA2/0/ESXP2QAkH/W4WaU82BfkGtsPbnQe2++DM 9 X-Google-Smtp-Source: AGHT+IH0XRURqSrfdljfxNXIHPhXgFCPwOzhF73gLyL/hdd2QfFX1JojB19r0/hE3/ew0qI7Sz6a4w== X-Received: by 2002:a17:903:249:b0:1e0:d636:4828 with SMTP id j9-20020a170903024900b001e0d6364828mr1366534plh.1.1711582213011; Wed, 27 Mar 2024 16:30:13 -0700 (PDT) Received: from hermes.local (204-195-123-203.wavecable.com. [204.195.123.203]) by smtp.gmail.com with ESMTPSA id n15-20020a170902e54f00b001e0fdc6e4ebsm80772plf.175.2024.03.27.16.30.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 16:30:12 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Dmitry Kozlyuk , Tyler Retzlaff , Pallavi Kadam Subject: [PATCH v17 03/15] windows: add os shim for localtime_r Date: Wed, 27 Mar 2024 16:28:26 -0700 Message-ID: <20240327233001.83505-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240327233001.83505-1-stephen@networkplumber.org> References: <20200814173441.23086-1-stephen@networkplumber.org> <20240327233001.83505-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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) + #endif /* _RTE_OS_SHIM_ */ -- 2.43.0