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 A036043D5A; Tue, 26 Mar 2024 18:36:25 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2F8E440EF1; Tue, 26 Mar 2024 18:36:10 +0100 (CET) Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by mails.dpdk.org (Postfix) with ESMTP id 3CAF940EA5 for ; Tue, 26 Mar 2024 18:36:06 +0100 (CET) Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-6ea7f2d093aso3989589b3a.3 for ; Tue, 26 Mar 2024 10:36:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1711474565; x=1712079365; 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=rWr4Nj42OSt1qQ+/sdxRLE4o2h++5ALozDKDmm63pSArsJNOrZ0NZ2F9wQu+hZFlqk 1kLiLoHymNrzA0IluYKwDWYXceY8h2brqiRLfWp95VOCZnu9/MvlriEsVumNYfxxaFY/ eLRTlWpLmWC+H0JCd0gB/w1Nskx5h3AxWMvNgSaKqylx0znzuvoeyFIu83qvYPTTu2Gi daTaSM8Ru3rD7r3YYKf1SffnxZhxwtlOeNc61zUGtq8xH+oc2LghiMGGHPeVrUcpJyQd 2F//dVxx8stpvVWsEtk/knl+OonTDPu9kGVTyORIjUS9CTXnmU8KvCli0WJp8uViIuaR KKnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711474565; x=1712079365; 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=w5k1lF10pix+XKuxsf3Y4Fdr31lUzRHiiQ0f2kbpdjIcgPXMMehXbkQic3PRamUpUi U0eVvB0+H7sLStIMgCsNf+yeE4ghT5Fa9gPeX5gUoZj87jkpcOV7MsHfSGJTbo9o5XDr 6/EAepcRuxOmwo21wcpWLDYdNPqE1BkFbH1ucy40BQgvsxLGK+vu0IFRTSVSNZyKcXDl bAfNTSAnzBr9/JzbsahFO1IRmrNi3TUvRrSQNomorbBw5Mwu0im7H25GgZrb97q/Vjzu xmq2eXq3qzPyyeYtel8MnfMor6E0mrB/WklTFEBm333aTxkn4FTzTLfce9Yfa6fOipD3 adyQ== X-Gm-Message-State: AOJu0YwcjFi1kGYYG0o1tXG3qdHHwHa+6I0AnCm9oWfLpfGa2BHnjoIm 4qmUEe5e6rYQyZH1XZYOYKa31h8udhWb+2+VPvMLdfD5091tawwefVRouoU2lFlwbJMziiet1fC C X-Google-Smtp-Source: AGHT+IF9i8FcmpEdBLw9DeKhw06KEFKKnAOaCchRG/qwPNbKUP0g7xY+fgln3ZmhSKb0gdjXBmJ5bw== X-Received: by 2002:a05:6a00:1a8f:b0:6e6:270a:9303 with SMTP id e15-20020a056a001a8f00b006e6270a9303mr2007526pfv.32.1711474565365; Tue, 26 Mar 2024 10:36:05 -0700 (PDT) Received: from hermes.local (204-195-123-203.wavecable.com. [204.195.123.203]) by smtp.gmail.com with ESMTPSA id u6-20020aa78386000000b006e58da8bb6asm6205546pfm.132.2024.03.26.10.36.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 10:36:04 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Dmitry Kozlyuk , Tyler Retzlaff , Pallavi Kadam Subject: [PATCH v14 03/15] windows: add os shim for localtime_r Date: Tue, 26 Mar 2024 10:34:23 -0700 Message-ID: <20240326173552.97249-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240326173552.97249-1-stephen@networkplumber.org> References: <20200814173441.23086-1-stephen@networkplumber.org> <20240326173552.97249-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