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 149BA43D5B; Wed, 27 Mar 2024 01:29:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7FD2841151; Wed, 27 Mar 2024 01:29:16 +0100 (CET) Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) by mails.dpdk.org (Postfix) with ESMTP id 31C74402D2 for ; Wed, 27 Mar 2024 01:29:12 +0100 (CET) Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-6e6fb9a494aso4914170b3a.0 for ; Tue, 26 Mar 2024 17:29:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1711499351; x=1712104151; 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=pmDjo5P70wvFU/ZjeNTWQD6qn0FcWNbKZxqswB9V0bokuhaRX7K0RX+s9NfUcfm790 07zTG9Kx2rtHr02aDn/F/EJwx6ek375Angq/uALkujDprPK1JxWIQrvgeIbK6rh9ggj9 YqWfZiTLmFNX+kcImIjSB7upK4N94OdvaapKxreTK6tFYsJqv3El6Y0v1UFbuuQpAzRD sVNHGgNtwmG72S7k7WOlJo1KBDQyHmPbkbfk3sXHJKgegWvCukYx/aInnOLaVC1Wupde mOiowmwBk7Y3DOLaiGACX7Fvcwfi5oGnCm7l0maW3irHdMLULvYhTUvV+n6L6T2zY0jH 4JRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711499351; x=1712104151; 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=i0zO76Dc2Mz9wPrp9NekpcQvRigaDAF56A+2Q5sZAAZXou1A+QpthK7ETtXOm2D1qO 6ZklbKp/3wLLrg3ju9GM44rCaAs/h0Rtlkxx/LQTKxAWccntDwxhMZkFFYJMcEAcWfht sVJNG6pGVricDaTa4BLE/D6Eg+OD8ccOHQmr25QiRvfqHB3suKfU2BM2I4+VUspqzUMk P//L5XJYxlKDb+2U/WBibvgJ3taR1D2b0VD6xqUXv0XzqHCkAgp+jQRPoUEaxwlvQkoy 9wCc3OZUfEoqYohMVpkWlxCX+D8r2MAg039QrDHLq6k1MXTQsKIT1zQX0WhIoRQ/uAAL EGsA== X-Gm-Message-State: AOJu0YzECISsOJ4QFK4P0OBi+NfUY6eGYheNpTBItir9M7jtZerIkVz4 EPvMyxsC6rKLtUJ0E3BAk6L40z2XyuQj7HLug8WQo6C3zNAHpmiaYRNZCQS8jYZ7kxLFY6mrDNv a X-Google-Smtp-Source: AGHT+IH7bmunyX5KK8H7dP7Ia4ewqHDS28AgpWrL+UiiWo0HjMxXWcElQvfC4Ia1JaK40VY1PpdvFg== X-Received: by 2002:a05:6a20:3d81:b0:1a3:c4e9:5cbc with SMTP id s1-20020a056a203d8100b001a3c4e95cbcmr1426658pzi.49.1711499351301; Tue, 26 Mar 2024 17:29:11 -0700 (PDT) Received: from hermes.local (204-195-123-203.wavecable.com. [204.195.123.203]) by smtp.gmail.com with ESMTPSA id w15-20020a17090ad60f00b002a04eef22c5sm225383pju.44.2024.03.26.17.29.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 17:29:11 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Dmitry Kozlyuk , Tyler Retzlaff , Pallavi Kadam Subject: [PATCH v15 03/15] windows: add os shim for localtime_r Date: Tue, 26 Mar 2024 17:27:02 -0700 Message-ID: <20240327002859.203006-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240327002859.203006-1-stephen@networkplumber.org> References: <20200814173441.23086-1-stephen@networkplumber.org> <20240327002859.203006-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