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 0D5FB43D4E; Tue, 26 Mar 2024 02:58:52 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 271CC40A8A; Tue, 26 Mar 2024 02:58:44 +0100 (CET) Received: from mail-oo1-f51.google.com (mail-oo1-f51.google.com [209.85.161.51]) by mails.dpdk.org (Postfix) with ESMTP id 360D840A6F for ; Tue, 26 Mar 2024 02:58:41 +0100 (CET) Received: by mail-oo1-f51.google.com with SMTP id 006d021491bc7-5a4b35ff84eso2748000eaf.2 for ; Mon, 25 Mar 2024 18:58:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1711418320; x=1712023120; 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=xbiYW24kIG7Qwc0ImikXW0nIWKac6V+ifayNXjSVd79yJNqUtjKWUBWSQUcyR66qYh XAKmck3Nismb15NoLyYLdUYPW9dYKmgFO27ej7NG5e5NYaQFG6heDq9OedyRO25p03Mn AbaCzLCt3K0H9HviS+CgkIlbHkSBWco2x3uX8EEiIxM4wEi4QhGpBw0vEo7Eg5wezueJ 8xbS+tQ0a3Qq0anZGr0kKCXtlZrhGT8KIM81utxcYh1ZXpHX/pnOdnpQfGBpHhs3RB/G L+cWJxLTtT5sKjTbWNbWY65RZw/639P5dRv6arN3vm/ER15FMEL49lvKp/TwG6RmFfK6 AL+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711418320; x=1712023120; 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=INNramOu1xw9zj9kJnRwfOC0M9hAn4XCCv7oc2yIexCWb1c4Mt4JAPMK7GoVR88pJb pytca32qMuzsIt/k5l0iSRlAK4uOFpaGmF5H9H6uoMwWw9X0L2Zl5VQ1nJBp5FazTcyW YTFTxrFZYmnarIoR7BlqhRa1T5KkEMla+3yq07+QUb5hzlwQomwo8cxvjveZmI0o6x52 TMFVeC2t8+OlWrfSA75er8kGHafokVNiVs7L4TPb42hmkFKjTJp1PO1qxDN3i31Ek8vA hI8z7gAgm0CQB++r6oFM9bU/4KQu90mLh37GWpA2WnGpD5XGtQ6rQYvImLgdogiSLXIa oSEg== X-Gm-Message-State: AOJu0Yz4Gz5uwTsk7VDc5KO+Il/zTA5O1C36kBye0vdT/KbTI+nYaGrB wsqHuwqA0JS81tZ2vs1Zu7aGkiz3rTovtSpaxRyCaFWoZIBjNsWPvRP1byK3Gxu63pbA2IDDEvb W X-Google-Smtp-Source: AGHT+IF6L6WkqUMKJ+Y5UerCrx0bDpv3LIkgYrkzj6Ij6wUet1rdqS5UYfKGTSa+v5DXcZjgssynEg== X-Received: by 2002:a05:6358:6184:b0:17c:1e44:a489 with SMTP id w4-20020a056358618400b0017c1e44a489mr9182614rww.32.1711418320241; Mon, 25 Mar 2024 18:58:40 -0700 (PDT) Received: from hermes.local (204-195-123-203.wavecable.com. [204.195.123.203]) by smtp.gmail.com with ESMTPSA id u19-20020a63d353000000b005dc88b232a5sm6571541pgi.26.2024.03.25.18.58.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 18:58:39 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Dmitry Kozlyuk , Tyler Retzlaff , Pallavi Kadam Subject: [PATCH v13 02/11] windows: add os shim for localtime_r Date: Mon, 25 Mar 2024 18:56:57 -0700 Message-ID: <20240326015827.825648-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240326015827.825648-1-stephen@networkplumber.org> References: <20200814173441.23086-1-stephen@networkplumber.org> <20240326015827.825648-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