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 4D55544136; Tue, 4 Jun 2024 02:48:10 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2C0FF432D0; Tue, 4 Jun 2024 02:47:50 +0200 (CEST) Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by mails.dpdk.org (Postfix) with ESMTP id 12E1B432B0 for ; Tue, 4 Jun 2024 02:47:47 +0200 (CEST) Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1f47f07acd3so4839565ad.0 for ; Mon, 03 Jun 2024 17:47:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1717462066; x=1718066866; 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=ZlrKTSbTZG9U7EVa2nyOT/6+zSdva+byCe6SWEMtVSw=; b=mvzDAZUV0QG3hTcl5tW70vTX0dz3ZO0JLeSnz+m/BBqmEWzKXnk7HrWpre86wsOVVK i6m0xLjTgGWNwWnS4A4yDflsOvF4s/6wzKUBUhN53gGSpgQlxTze3jixGWXPBka6YZTo ANoJorqiWAZtrAi/tH44wiLQbps7HJ0n4UyzK4I43toYdMRjGEKrC4nwOIg6ofUbpZVF +nvHnFR5du4Lt3CLjVbqli7g39lvZqku6dFijpIY2LtGYCZMeHnPnK80sOpmO8t0x2YL fOihRjArPeDWpTmcTrbWTEQdDdkshsV9tr7XyLDn4o9jt4RuIOT7q1C6oiz1qDYGEzY8 8IQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717462066; x=1718066866; 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=ZlrKTSbTZG9U7EVa2nyOT/6+zSdva+byCe6SWEMtVSw=; b=cv11w4jLCAODKf9U3urMlztZMQaqvdGvxf+h1GTpbDfhcWEpoE943mAf1XGTd889GV 3IPnSsax9cF5vYgcmUFUI4YN8R7a+7LQ5p+ejK/qZmZEMWhGo4PgsMIH4Xb9OL+AZyys 3pJA7tr1CoT1LODqDdlyELK1kv2bhx1YZAIiH6X8c2tlqJZso7/OF5aL2WY3CNQZubCJ bT6grr6UhFFuN7ciNr1c/pM49RVwjb2Pc16HCBJDrxLpRBOhmZ2zWvrR1WrIkeOhyMHf isFF4Ki6ezXUXonQxmg5KmDl12rmISQ/jUHvLsGiitWQLATipa32h2BoSCiW3CFcJliT seyQ== X-Gm-Message-State: AOJu0YxedcoJVEKz1QNv89BrFckQZItu1u5gxL2szR/pU8h3gOClI/Ig g3htLxKml1J+Bzdeq8vLi3NcNV+TTQEUiI5xO7pW+9mUygpzQWLHuUr6S4So8syfri/eIR6gEXW u8J0= X-Google-Smtp-Source: AGHT+IEMiyhuTvgx8Wg/zEd7qOmjzy4YPtqLWtgsWMP7hdAVxicPaQTAs/ghq61ecYLSIjxg9bjsKg== X-Received: by 2002:a17:902:e549:b0:1f6:71fa:fced with SMTP id d9443c01a7336-1f671fb0498mr52470875ad.50.1717462066169; Mon, 03 Jun 2024 17:47:46 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f6323e9aa7sm70381125ad.192.2024.06.03.17.47.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 17:47:45 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Tyler Retzlaff , Dmitry Kozlyuk , Pallavi Kadam Subject: [PATCH v21 03/14] windows: add os shim for localtime_r Date: Mon, 3 Jun 2024 17:44:51 -0700 Message-ID: <20240604004731.6654-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240604004731.6654-1-stephen@networkplumber.org> References: <20200814173441.23086-1-stephen@networkplumber.org> <20240604004731.6654-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 Acked-by: Tyler Retzlaff --- 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