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 348D6459C0; Tue, 17 Sep 2024 22:42:09 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 22BFF427D2; Tue, 17 Sep 2024 22:41:56 +0200 (CEST) Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by mails.dpdk.org (Postfix) with ESMTP id C8E9A427A5 for ; Tue, 17 Sep 2024 22:41:51 +0200 (CEST) Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-20570b42f24so64845725ad.1 for ; Tue, 17 Sep 2024 13:41:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1726605711; x=1727210511; 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=rOi7gDrgqyJHjLy+jDS7h1HmpcSNpfsPK1G9au1TW36H/wO+nMZwd2VM3sj27O2Khq /L+UiMF3B9+1b11ZdJ7BXhvLx3HeV9p9erFrV1/DlRwDX380tTgB5kH+o1ynCxD8W2YE Ffsmt5yCR5ljkTRwOGJRqejOXaAr2+HOnjCO9hvbHSb1K0FAONFN4QXulE3Xi5YA3Zl7 9/UfN6XwBUOZTb9j1b2b8PSkdWfuW9iDF2wJOw0WMkbTJ3q/AgF7HouCSNdpFf8aWsca wBjRHT81BPHY4GUOGyFVHZOt830NBS9BWGsqc4+eJYMj05H1fdWJg8HkqVuEA3Na7S3O cgkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726605711; x=1727210511; 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=oSoZXMB9VK4h/CccdcMOqoPec++OEblrh35zhqAybZWBOjCcjW2BPg90nKTNcFcISn 48ziyIRW+IwQmzAh3nY23SApc4m1WHXp4inY9qYI3QRvEqKNY2OtxFj1cErM/wDahoWY /jGkSoVEHjhOq5Nzhrto2CoXFp7O8KsnoehbHHWOUp+HrICGokcgCpgycXB0dD6Q4JfV kQybjIpQgFkZTlmGLhYOT8CJanzSNCzhFepntUexVodOgj3KVRSk7paMCUCW2w54oIVs g50asRPlh+M4lPuAZVGl4rlo5kn0j2KkZxrFtNhSkptNh+hApK1pZUPxGc3VCJODshUV uAew== X-Gm-Message-State: AOJu0Yx79BNFv+Zobd/yVKdmb+n2MOhQ3jrWpJ9w6rPfDFFTLHbHSX4u qfYUYeFRfo+H5Wg1Iom4poJEJTKIq+kgigRVVVENyb9aaQX/8b/KdYv5LCkUGXoLu5g1Zarq6tj f X-Google-Smtp-Source: AGHT+IFZsmIdu1VahqBtrtMIReySwEcI8HPJUHvwowHqsxlr9CsIy80Lqf2/9iFq9p8d+EDwHkwQTA== X-Received: by 2002:a17:903:2a8e:b0:1fb:3e8c:95a6 with SMTP id d9443c01a7336-2076e3f86ffmr313711525ad.40.1726605711013; Tue, 17 Sep 2024 13:41:51 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20794731afasm53830425ad.272.2024.09.17.13.41.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Sep 2024 13:41:50 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Tyler Retzlaff , =?UTF-8?q?Morten=20Br=C3=B8rup?= Subject: [PATCH v22 03/15] windows: add os shim for localtime_r Date: Tue, 17 Sep 2024 13:35:45 -0700 Message-ID: <20240917203828.414701-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240917203828.414701-1-stephen@networkplumber.org> References: <20200814173441.23086-1-stephen@networkplumber.org> <20240917203828.414701-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