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 978C245B56; Wed, 16 Oct 2024 22:24:14 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1DD6540616; Wed, 16 Oct 2024 22:24:01 +0200 (CEST) Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) by mails.dpdk.org (Postfix) with ESMTP id AB7494027C for ; Wed, 16 Oct 2024 22:23:58 +0200 (CEST) Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-20c8c50fdd9so9392905ad.0 for ; Wed, 16 Oct 2024 13:23:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1729110238; x=1729715038; 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=lxRrCvLT4Xv7g0jHDEOqMAqfGdL9jPEeURqKg/Cqh74=; b=Bg+uZTz6vb72ad4Fprws68L3xB63DFVNLCfBEANkufDhbvYq0UPJ/rbeANt8cSes4S H2osVKlTFGNWdD1nvVUtRqPKQnS8g6QN20RYYm4/nolQUIHDuW5mq84+R1TFaDlYickQ Z+2Eq2TBs8vSQ76BvfQwmRkIIMGNhtkoJdcvGSoBzaDnhgK85ky5RE2GMUg5KmYD8S7J yi4lVkg71oNl7Iks3+R9C/0gGmDcrZJpEWplIKfzpbWd8T9NjTJuvH4QjIQgxZvw64Rr 7TOXooKK6aD0BbLyIVjqK3JqYm3mq8zbAzfWMVsBomI3gjiEzFbBM3hJIZJc6TAhl4Pv PowA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729110238; x=1729715038; 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=lxRrCvLT4Xv7g0jHDEOqMAqfGdL9jPEeURqKg/Cqh74=; b=DNaI80I3TmuCYemX4zHC3KtUz9hofALuQUSlW5HldKM7bjIeYz8q7wUfl1jkXZmHlC wxdyGNuvbvnjnZF/dY5rpBsxT+jJfsQN86GO+QxYZKiYgi4weI0uPH7shSiNps6zyhCY cKbiDdd3xwnhcfgkUFhOJDRgeyg5+NA7PAHcPNrIqqGWO/Vsbo1nV53d2B8eIAQRbm9E Dzf/Lgm+RKUtHNBLMU2Hu7Y414tTJ1Dn6qrep95DZi1wWtFSutNa2eYgyy0iCY82tPQo 3ICq+aBmoCi0h2sdP23Ui1BSVVVpmMtPt74uz+uGTCg8IGT/K1+MJiTAKwnEnrCXy4O6 0bqQ== X-Gm-Message-State: AOJu0Yy3VwyqA6/5yAVj1zrrZFVVsEhE4rb+aljRJ2KL+7BeLKk/1DuF sZIbfvYTIFfnetieMye0dDt/RMPYZR05Sx/vMogGwkQO1s1lXgbYLRciurkJmecD7mkO9bzwChw c X-Google-Smtp-Source: AGHT+IEScjMZQIEfVr/JxcVj1oIgDwDFLbq2QdIpxws8ScRCBG5mRTMLqw4ahIjwjl/fP3/qYYgcQA== X-Received: by 2002:a17:902:e74a:b0:20c:ea22:3317 with SMTP id d9443c01a7336-20d479a2626mr14314505ad.29.1729110237880; Wed, 16 Oct 2024 13:23:57 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20d180361e5sm32308825ad.120.2024.10.16.13.23.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Oct 2024 13:23:57 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Tyler Retzlaff , =?UTF-8?q?Morten=20Br=C3=B8rup?= , Bruce Richardson , Chengwen Feng , Dmitry Kozlyuk , Pallavi Kadam Subject: [PATCH v26 03/15] windows: add os shim for localtime_r Date: Wed, 16 Oct 2024 13:20:30 -0700 Message-ID: <20241016202343.190653-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241016202343.190653-1-stephen@networkplumber.org> References: <20200814173441.23086-1-stephen@networkplumber.org> <20241016202343.190653-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 Acked-by: Chengwen Feng --- 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