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 DD80D459D0; Wed, 18 Sep 2024 22:53:57 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0FEE743293; Wed, 18 Sep 2024 22:53:42 +0200 (CEST) Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by mails.dpdk.org (Postfix) with ESMTP id BA30B42F6D for ; Wed, 18 Sep 2024 22:53:38 +0200 (CEST) Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-20570b42f24so2286395ad.1 for ; Wed, 18 Sep 2024 13:53:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1726692818; x=1727297618; 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=eLupAowHHwHXnyyF8v9Iu7Vnf12mTxvGH76RoWsEzvY=; b=nCWAXB7eQQOYAXzgb9vcoo8DaIW0LNimdr9LmauE0xBhoMXgzFeWM8lAZDcWyjYhic +5fSVY122KeOv8/1HQYocTkBNq/GsOAlonU4o86gDGsR89GQ/KITVSzplV7qU6vBzJtM FEV0hGSybmCsKv+JTvuN775DOD0eBGTm77cYCE1zg8kImRoeNZoL8JvioPlKqpe49Fk4 5YnUzAVqL40ZXpiC7Zh3JSIqYdHgSy+hcP44Wot+cA6Vk83F9FPsVNsWboXKbV88rgH5 tazXP6RAds/u9RoMytzQOUizmKmnL0dpnVYoeRGMSu8By3Vd+N+GKeB0Q5Tky6YfbPnh IDyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726692818; x=1727297618; 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=eLupAowHHwHXnyyF8v9Iu7Vnf12mTxvGH76RoWsEzvY=; b=wuJ7e6ZtIhRD/9aOCYGDGjL0dYMGMDWHOAvJPcK36ZBCHaqspyZtH8J9DXq3xgGatX M4y018D0h/FPbJRUZuLFmZM0MYLux0GKX2xhXwzmE69Bk/ARnLAw/Dm83oIsd+xxnTlv hPyEwXtuBeWkFEh8OvQJx83B5ItkFuJITVEW6A2lhvEq432rYalQCx/VpSZvELWMQdPo q+Hz5eBSyrqlo/Q/IISD/EhfG7Pu6ANZlph4/ia09ZpfKLU3w1NZDiquZ+LApRatuVvp lHpM0VBEPEISaKK6Y6b1/ICBuU9zQ6GwieWtkz7e/stP9pIdCh1iHRUzYq5dTTyTQOql 8RSA== X-Gm-Message-State: AOJu0YxRbjCRRw2tnGUrooA4LcRcyMXPVM7BonaZkuQ+tHtFYN0HPc4U 9tQQkiUn3scDiHiQhjUC3pm+ZNNM9zQGmyfUnFLWqzNRFzL3vnY3CdNT/mL9DOP3YrhQ3DRGEwb x X-Google-Smtp-Source: AGHT+IF+719kJn/f//+u+hXvwYh9uWTyILAK4Wq7DiKnHZF8evtfQZ5DseMykFLEOjw1U3tvje3eMA== X-Received: by 2002:a17:902:e5c5:b0:1fc:6cf5:df4b with SMTP id d9443c01a7336-2076e428114mr430862715ad.49.1726692817805; Wed, 18 Sep 2024 13:53:37 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2079471a2e6sm69415775ad.240.2024.09.18.13.53.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Sep 2024 13:53:37 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Tyler Retzlaff , =?UTF-8?q?Morten=20Br=C3=B8rup?= , Bruce Richardson Subject: [PATCH v24 03/15] windows: add os shim for localtime_r Date: Wed, 18 Sep 2024 13:52:02 -0700 Message-ID: <20240918205324.35449-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240918205324.35449-1-stephen@networkplumber.org> References: <20200814173441.23086-1-stephen@networkplumber.org> <20240918205324.35449-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 Acked-by: Morten Brørup Acked-by: Bruce Richardson --- 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..665c9ac93b 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 *timep, struct tm *result) +{ + if (localtime_s(result, timep) == 0) + return result; + else + return NULL; +} +#define localtime_r(timep, result) rte_localtime_r(timep, result) + #endif /* _RTE_OS_SHIM_ */ -- 2.45.2