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 7E3F9459C3; Wed, 18 Sep 2024 06:59:01 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AC9F5427DF; Wed, 18 Sep 2024 06:58:47 +0200 (CEST) Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by mails.dpdk.org (Postfix) with ESMTP id F414942795 for ; Wed, 18 Sep 2024 06:58:42 +0200 (CEST) Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-20551eeba95so47582495ad.2 for ; Tue, 17 Sep 2024 21:58:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1726635522; x=1727240322; 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=T716srQW11zVSEWc1qx9GIRcOvcSensA1Qs5PEFQXSk=; b=fC1w5ehvYnrmQn9bndesAx7Bdq07aMGx0+e+x9bkLBi+8iNKug1KDR36gEKhl67lgN YXXveoaeCGQepV7WqsAirsFj3WMqiu6ZbOOIIgrhrVNs6GuriYmHk2JZYjZdNrYxAAi2 MMxfxIA7d63pj25zRBkrG6O+WhkM5HvVldXL1POZRaEaoo44+qWBl5i4S75PB7fasWyu KzW8baDY5mtCT+FY60sBmbhKerKs0+UrF7f4cYyTv2w6D+0JWBVadWitOVsdV8pJoA/J X4mqyT3bU62ZBMIU5K8lVxBHYFgDuvDjtONZmCSCB1fVMmFmMBg02R4TS1AIJCdiFjnq 1yxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726635522; x=1727240322; 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=T716srQW11zVSEWc1qx9GIRcOvcSensA1Qs5PEFQXSk=; b=SQDgLIn1auIaZnYXEAMGLS/V0BYcMUPlr9JBQR6yu/jjkrMVqzmxQDQXr/S/Xo2Eea vdplzT3JC4tEyoy7Nn96qWiNtKEXu9MDHTZdpWAimPCasjKG369uCadbFdrJnL/Blio4 4OoQO3K7crD7F0xk1szLy/FxjiQzcKpKm/YtAL/FfKRhxunI0flr5zp1Bby8jkIXYejz sPHkmr4G2OmdV/N9rtIF8QH9DvlrFmt03GSWlaH9gNOp+DXLA+IEkmdSaidceh0dS46H awr/Jtw2V6lzBINpYQEjmm0549DeKxl/+dlvixRqG6UTb2k2lUxl4hHrZoiaB9Ddks74 2dbQ== X-Gm-Message-State: AOJu0YwPYAiizqi7vdG3wpvYbf9JxWX5E064qOAlWC9qz4zclZjShXc9 osDx57am95MTqpgRBM+UVemUUFp4ASUQ7HpaKMIJ5SlsyEfL6g2bAjnJ2KmfHGdtLnD3T8ERWwW f X-Google-Smtp-Source: AGHT+IFFO0pL8pV8WUy5azq8vnD+XZmx/seooAUxFHPj0N/6LZ27U57bNN+sdwc/yVdBld3h7skyhA== X-Received: by 2002:a17:902:ea12:b0:207:60f4:a3c4 with SMTP id d9443c01a7336-2078296a89emr262364655ad.37.1726635522124; Tue, 17 Sep 2024 21:58:42 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20794746d76sm57179245ad.292.2024.09.17.21.58.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Sep 2024 21:58:41 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Tyler Retzlaff , =?UTF-8?q?Morten=20Br=C3=B8rup?= Subject: [PATCH v23 03/15] windows: add os shim for localtime_r Date: Tue, 17 Sep 2024 21:56:08 -0700 Message-ID: <20240918045830.3798-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240918045830.3798-1-stephen@networkplumber.org> References: <20200814173441.23086-1-stephen@networkplumber.org> <20240918045830.3798-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 Acked-by: Morten Brørup --- 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.45.2