From patchwork Thu Mar 28 23:49:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 138968 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DC9EB43D73; Fri, 29 Mar 2024 00:52:29 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1192B427D7; Fri, 29 Mar 2024 00:52:13 +0100 (CET) Received: from mail-oo1-f42.google.com (mail-oo1-f42.google.com [209.85.161.42]) by mails.dpdk.org (Postfix) with ESMTP id 8F778410E3 for ; Fri, 29 Mar 2024 00:52:09 +0100 (CET) Received: by mail-oo1-f42.google.com with SMTP id 006d021491bc7-5a58009fe88so856018eaf.0 for ; Thu, 28 Mar 2024 16:52:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1711669929; x=1712274729; 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=n/9xuf4XacId2U6FW8dKOd61jEvjhM4QV7CCOc4WLQcMeSKXESqrEb6a/PjqRyng+W UP11JwA8Xj6QTqkSgq2ZqMfCbBhuNRGrKEOQxFn6fHkGybFyF6XPfAh2PVelVHYoW56p Z8M6hXLqqkfWE2ec5Rs0SLiR517vEt3SJw4ulD6KDmJZGs8iCknZZsQ+dOOADb7VVvG9 fFN92s8yTo2pujWYS7tsghzI5/k7+kZRwgu45SEQzy9eyRmlxk44EVuGYWEt3VMIjRGG tiOkmkAnBDDF3FktKlzBvLQROEqRvS8S8Squkog97etQiOMOeqajUfIoAfNBM6+DdyiQ 4ybg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711669929; x=1712274729; 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=di1gdHmrA5LhPJ7NRIjRHnvpW7rKSOmNHC0oSXltLLN92CBELsMJk5kiKiZYxO1XUT N3zgdO7jEhovqUJr0AXrPOUE7653TsfqnQwKQNpWSQWZKEZy94RB0Z98nRH7oFG9Kd61 wra7c6csdeXnLWfZr8OIXWLDVpoQ6WHyN5SXHe6jfaYgfRMqgZpEScAr/h3mgif8XErB ggVinbHyFfoeydU2KNuyIUHD1q3xx/Bohjt5IEoA5EyUYe9PgAKeWUqycuYw5QeLCPU+ jwWbB+oVw5LrzFnXh5Vn5NbsxIyrvlSH9MR+WCAz07u3AkvBxyoMiiCZ1OKzh3r0o0Xb mTRQ== X-Gm-Message-State: AOJu0YyoB/FEwkpZId17j7JntDOEhir75wewJ14/A0QbDtcjV1JEswkP vsjLkZSoXRfBvdljsxi7QjRdIBk+sC1hRmS5ocu+vQmGwebjfZQAPiIjC0cdAkSVhtEmoxyfbV7 i X-Google-Smtp-Source: AGHT+IGvv1I7ClZBD4KsqLy0NCN8hOQg2IwfK4wk7d4TX75UFxKB+5OOOd53z08zgXhMBZ8gtsmyrA== X-Received: by 2002:a05:6358:33a4:b0:17b:57ee:7b7e with SMTP id i36-20020a05635833a400b0017b57ee7b7emr902891rwd.26.1711669928710; Thu, 28 Mar 2024 16:52:08 -0700 (PDT) Received: from hermes.local (204-195-123-203.wavecable.com. [204.195.123.203]) by smtp.gmail.com with ESMTPSA id g21-20020a631115000000b005df58c83e89sm1875650pgl.84.2024.03.28.16.52.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 16:52:08 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Tyler Retzlaff , Dmitry Kozlyuk , Pallavi Kadam Subject: [PATCH v18 03/15] windows: add os shim for localtime_r Date: Thu, 28 Mar 2024 16:49:33 -0700 Message-ID: <20240328235156.5768-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240328235156.5768-1-stephen@networkplumber.org> References: <20200814173441.23086-1-stephen@networkplumber.org> <20240328235156.5768-1-stephen@networkplumber.org> MIME-Version: 1.0 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_ */