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 34B4A43D49; Mon, 25 Mar 2024 21:54:31 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CE8CC40A8A; Mon, 25 Mar 2024 21:54:20 +0100 (CET) Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by mails.dpdk.org (Postfix) with ESMTP id EB94540A6C for ; Mon, 25 Mar 2024 21:54:18 +0100 (CET) Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1e0511a4383so34312925ad.2 for ; Mon, 25 Mar 2024 13:54:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1711400058; x=1712004858; 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=YbZAthlyaEUUNsR5TLLebEdwQ/pD6jFJO+aJhq4yxXrsP3W7p95EEZ/pDbinh4WVTu yP48Q32hSBqnv0dQwMT8MdqQrRQGABf3Mv8aLGz5G1uifnAZy46Qz8UprprogExDQD8D E0zD2tOhyp8ulztOBBLgpGIJ3EuGp2HHLGCYnD6q8yCAnGAQ+5AjboGVIJVVNWXmAFl+ kiRr5RWpmA0q3XN0k1Rgs3/rJrA/G59mPZnX9wK34cQv+O05wsKZWELuFUub9uhNXFC3 0f3HpOAyHEbYg9RZZxEAVIEvhmv/hM8EPn+h6Lh2FMj6UprdqQlVZjaA8M1zdfieqV7v 6MUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711400058; x=1712004858; 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=nu/nTvo7pZSiqGHdydE3VzfjYxPQEojc702Gck5hp/iaenFByni3VknCtxQtSVMQes FTat1k3W7hn/dFskZz9Ag9viWCBeXtHoO6oVpRg34uYdH0RffSi2oyV565YYGGqOgbk+ 4pNr97CAWijoB7p3MIcl8KGdCbytiYSODD2W9KqCb0DaSPKrIIuHep7FNnqcvhagnRzB leeljaFoWBcmUxNbKC5l/EKLMV/v+BopMrvvRIgjmMyeqtMpzk2CO5GwdUDPRCID2xBK LUe/uFnyrUvh0kl+9ej0+Ksb3D0LB1znVoT3yLnykPPah5a3uWu7WAQ7AsyEGbRHPhhB /bHg== X-Gm-Message-State: AOJu0YyuohCHUYAb9X87zxCkM1dQ8N1iBcns6YPHt3BPb6LMAF5QkdsP nxaKay5IDeKf45GjilSrmW4+Y+VzihXm3+I862sXoBRFfS8Ci++3vTakfGCm7vjxb8zVvWx0Uv+ 8 X-Google-Smtp-Source: AGHT+IEXMKgqKRfeiCh0wW1YhEGye93p/rJkWFoIRs70PAw48AVsjv2Ff39Hsa0qvVPUge/Qt126IA== X-Received: by 2002:a17:903:24e:b0:1e0:6351:ad94 with SMTP id j14-20020a170903024e00b001e06351ad94mr9077185plh.36.1711400058119; Mon, 25 Mar 2024 13:54:18 -0700 (PDT) Received: from hermes.local (204-195-123-203.wavecable.com. [204.195.123.203]) by smtp.gmail.com with ESMTPSA id b18-20020a170903229200b001e0b5eee802sm3164487plh.123.2024.03.25.13.54.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 13:54:17 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Dmitry Kozlyuk , Tyler Retzlaff , Pallavi Kadam Subject: [PATCH v12 02/14] windows: add os shim for localtime_r Date: Mon, 25 Mar 2024 13:46:59 -0700 Message-ID: <20240325205405.669897-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240325205405.669897-1-stephen@networkplumber.org> References: <20200814173441.23086-1-stephen@networkplumber.org> <20240325205405.669897-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