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 686B043D85; Sat, 30 Mar 2024 17:45:07 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 514D7402E4; Sat, 30 Mar 2024 17:44:52 +0100 (CET) Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) by mails.dpdk.org (Postfix) with ESMTP id 00736402C8 for ; Sat, 30 Mar 2024 17:44:46 +0100 (CET) Received: by mail-pj1-f52.google.com with SMTP id 98e67ed59e1d1-2a04ac98cf7so1939896a91.0 for ; Sat, 30 Mar 2024 09:44:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1711817086; x=1712421886; 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=ZlrKTSbTZG9U7EVa2nyOT/6+zSdva+byCe6SWEMtVSw=; b=XHp0kbyZZ68rPwPHhnzXqQqBKCNFwp2+2sjzdVoyzs41jfk1NhCRr0npOcfvjwbE5w OOTn0vTGKpByzInnCGoof5sISkvpoqWN1esYKNzw4nIskNBFUuXNdqp1fDRteTy+WMJa pp3BlFJrv3tZOOMjX3lS64pyFciLaAJzK8QnmdOq9rzT0ILTahFT0SDBc3M39nbMKOsC Kg98n0LIrp/VM0lvJXxz72TRofp7pee6iQlOwanwXIH0PjawNDISCiZegIUzffM7SBaH K9UEuPXjnvaaHqjE/jbCblRPccY/mA1F2bH9qS/n9oRF92K8mtb/7efKv1cxInVukM6a yBLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711817086; x=1712421886; 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=ZlrKTSbTZG9U7EVa2nyOT/6+zSdva+byCe6SWEMtVSw=; b=ogyTAGUvXtvDjK2m8VG3ylC89izVioUO3frmCzGlI0rddjA3Mp2TBmqlfoo3B4frMF ULwmULgzz/Vmt6VcBW5ywfV36oq9gpzuR8wfHkkSjx4+FekwtqgHlA7Uq2jUVG4pngUU a8myqPEpNjNz2VBww1eK58elQVevKXgNfsyi1HvMpySkyHAxqLYvQVTZKX+n2I/OKQE9 puZDsZeKkPHtRco0zwUXdgSY0bOmsr7oqTEZFRKD864X1Y3/4Md+Tk6FIXlveMjg1ULj ve6qrdlY36Yz0OpnRakK46a8vBrasVusITpvOl/1bSHZazklVwbn/Fuam6WmlR4uzKkd imzQ== X-Gm-Message-State: AOJu0Yz0yEEo65FnQnFlueVluDOSm6RNbcBPjZaHsGFj4miI17ZOGxW5 Jyz6xOoYWmNHp7EudzbJJBVv/sZqTudT/cl4Xw+P4vkTtZoH4lwBT0NgaJJ4GMXFSm6hvLiPykW G X-Google-Smtp-Source: AGHT+IEn4UgXSWcfHLJfqeX6ukko13mzwY27mpDjvT3VjX00SzVFj2Hh8Al+dClmiq+gudM5mUX6vw== X-Received: by 2002:a17:90b:3001:b0:2a0:78f4:2dc5 with SMTP id hg1-20020a17090b300100b002a078f42dc5mr11465531pjb.22.1711817086090; Sat, 30 Mar 2024 09:44:46 -0700 (PDT) Received: from hermes.local (204-195-123-203.wavecable.com. [204.195.123.203]) by smtp.gmail.com with ESMTPSA id by1-20020a056a02058100b005dc26144d96sm4192417pgb.75.2024.03.30.09.44.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Mar 2024 09:44:45 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Tyler Retzlaff , Dmitry Kozlyuk , Pallavi Kadam Subject: [PATCH v20 03/14] windows: add os shim for localtime_r Date: Sat, 30 Mar 2024 09:42:14 -0700 Message-ID: <20240330164433.50144-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240330164433.50144-1-stephen@networkplumber.org> References: <20200814173441.23086-1-stephen@networkplumber.org> <20240330164433.50144-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 Acked-by: Tyler Retzlaff --- 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