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 B2DF743D8B; Sat, 30 Mar 2024 04:05:01 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CFB5840698; Sat, 30 Mar 2024 04:04:48 +0100 (CET) Received: from mail-oa1-f48.google.com (mail-oa1-f48.google.com [209.85.160.48]) by mails.dpdk.org (Postfix) with ESMTP id 37D17402C9 for ; Sat, 30 Mar 2024 04:04:43 +0100 (CET) Received: by mail-oa1-f48.google.com with SMTP id 586e51a60fabf-22a8df1df8fso1428402fac.2 for ; Fri, 29 Mar 2024 20:04:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1711767882; x=1712372682; 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=BJGpkraAY/jYHdd07BpbtgoAqg5aFA+AsXyF0a73U9Jrl+vKSOq565hD44t7Unxr6i ahEHxP3CHo7rZNqtOntk8RK0RUrBTtsl3r9Rh5qCIh4ocsO9B1DcZVCRT4AqhXfzV/L/ ZDyV+uM2JKMo/0LRbP+GAWafiy1O4d4PcpAvbMyYipelo2tDGQYkEGrq75gcs9m9i7Uy cBzIKBNlb/Uh120sbjmm0cKrWTj7aW0ashwCrVuNbzdyOu0cMx29yM5nSpyFJ/iP0pEV YUojaAUP2GlSRftl18GArv3d/eKGFzUazVv/QEdAx5A7Fish5xEipIn68/KsvwBCKTSw hhaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711767882; x=1712372682; 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=PFzpD/vKbVdrXIvAxyWZAPJOW0pWIWRcwmI/hvgWhb6MicVFOUdmhFNWD23qvtrSLQ BgheKTvwPfW1zzW53l1AsT/rUKcGKDplZKP3FORB1CJgS25asPoejmZYhyh01Skx3rcY UKa9CRiYQjdepdfgcPF8vzfMXHOINzAQx0DI+gQUayPp/pCyhnGDxPPAh8IdYHIWac3c a4dhVE17nUvGvONAyyLDe5tlrE9OblUR1iN46cz0dwsuGDo/siogbtV8icpAISqyYZ3f QCCyfT7obUi3dqom6O9I9hHoeYsd/uceujQvqYpgXRX30H9q30A3BV9JVZ4FKNkQbVhn XByQ== X-Gm-Message-State: AOJu0Yw47xT407m4bpaW0rF6NlAGKM07GffMyHm2GtUuTNb1hTrDTfEA ewuZyLsqlrzBVurskMnh+EWwTBxn82wQVsNUuaNEWgnCoAupPH/7erVyklVgEGd5zTDhOIA3p19 l X-Google-Smtp-Source: AGHT+IEH+nGUmvDdVYDG+ufjYA1PQ2eWJJz75onORJmLSx1EMojjFemfKnzEXDSTxm2+gNFnDEovBQ== X-Received: by 2002:a05:6870:1697:b0:229:f61d:7e52 with SMTP id j23-20020a056870169700b00229f61d7e52mr4408908oae.34.1711767882500; Fri, 29 Mar 2024 20:04:42 -0700 (PDT) Received: from hermes.local (204-195-123-203.wavecable.com. [204.195.123.203]) by smtp.gmail.com with ESMTPSA id o3-20020a056a00214300b006e6288ef4besm3655486pfk.54.2024.03.29.20.04.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 20:04:42 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Tyler Retzlaff , Dmitry Kozlyuk , Pallavi Kadam Subject: [PATCH v19 03/15] windows: add os shim for localtime_r Date: Fri, 29 Mar 2024 20:00:46 -0700 Message-ID: <20240330030429.4630-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240330030429.4630-1-stephen@networkplumber.org> References: <20200814173441.23086-1-stephen@networkplumber.org> <20240330030429.4630-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