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 1EC67459CC; Wed, 18 Sep 2024 17:25:22 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 10B4C42EE4; Wed, 18 Sep 2024 17:25:22 +0200 (CEST) Received: from mail-ot1-f42.google.com (mail-ot1-f42.google.com [209.85.210.42]) by mails.dpdk.org (Postfix) with ESMTP id 241684003C for ; Wed, 18 Sep 2024 17:25:21 +0200 (CEST) Received: by mail-ot1-f42.google.com with SMTP id 46e09a7af769-7124395ca86so1447431a34.0 for ; Wed, 18 Sep 2024 08:25:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1726673120; x=1727277920; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=X9gcGzuBUzUVCBs2FFI9+qjuutBJ4kyXii4CtJUILFw=; b=kVENHfcpJ2n0r+mPED9NnMrpjukSTQR+p6NzPFcSnep5iI2H8ln97KYiNSBH/uP5vn Ol4shRPK3mpNx/wWnwbnEfDeXKKHDra1FuVUEk6DdeGWkFhsENlaYcAq6R2aJ2SGZY/b V4cjDqd+L2DkxackP71X9WLRPYebqORA/Sz5V0+XMTcjqM+mM2CNGXSK4gcT2GcY2dsz 3AE3BVVJmPi1q7JvkrncYTGu9NprKF/JctuqI7Iv2JH9cJyjUBgyFm0zu+N9MX8G16ek +aw/WRvu1Im1RIPoao7YopQ7AibjYdbmOU8vbZNFfttG/D1KZXW1AmNo/eMF3cPerNdH LyUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726673120; x=1727277920; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=X9gcGzuBUzUVCBs2FFI9+qjuutBJ4kyXii4CtJUILFw=; b=JRL4Nwe3PxO2hcClFfhyLCgsyb5eIwqzigfudcEluvG34BC1LlW54U1fJATb0jeqdW LM38nlja3P7h+eJVk2SZrgSYPaxVXEP51es6VN48ZkSlcUJao2j2UHk+fqK8OBjZTSuj YaDRUcYR4Ta0OezXDhWGuVW9c01+kBskSjHKjrTc6PRdGvnmaIVbB+EvAbCgBQU38e39 3A6H9x3W3BGZhlp8HtefiZfNk3puCLzAaZNSVo08Yuenx0xrWfet7CJfDAmSE6sBslf7 c3dDBC46GopYUheCdE8sG/6NVm8Z71t6Ru7ZRyft2N6gUKjpnLboU+R+WpyOf57bc2Af FgxA== X-Gm-Message-State: AOJu0Yykd95LrUhR759fhReNSrPB/4t6oU8An8iJaOafnjLYQyMTOS66 H4z6LmrYi/+ic4TKWCTjC9EzKi8Bik2x8VRFN+z2aIcL0J1DchJMcEpROagOk/g= X-Google-Smtp-Source: AGHT+IENKf2tjSKp3ksVg7gdG6RkwpZAUTwlplZ4yJ4hMlKsuM+zvTWSEjWuAKSn7T+DzL170ecp3A== X-Received: by 2002:a05:6830:6319:b0:70f:6d1e:d06e with SMTP id 46e09a7af769-7110947176cmr19249680a34.12.1726673120391; Wed, 18 Sep 2024 08:25:20 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-71239ecf5aesm2059853a34.45.2024.09.18.08.25.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Sep 2024 08:25:20 -0700 (PDT) Date: Wed, 18 Sep 2024 08:25:17 -0700 From: Stephen Hemminger To: fengchengwen Cc: , Tyler Retzlaff , Morten =?UTF-8?B?QnLDuHJ1cA==?= Subject: Re: [PATCH v23 03/15] windows: add os shim for localtime_r Message-ID: <20240918082517.37f39e91@hermes.local> In-Reply-To: <33766391-d639-4579-82ef-6a4bd92f60c3@huawei.com> References: <20200814173441.23086-1-stephen@networkplumber.org> <20240918045830.3798-1-stephen@networkplumber.org> <20240918045830.3798-4-stephen@networkplumber.org> <33766391-d639-4579-82ef-6a4bd92f60c3@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 On Wed, 18 Sep 2024 15:09:25 +0800 fengchengwen wrote: > > 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) > > buf always means char *, but this function return struct tm *, > suggest: > struct tm *localtime_r(const time_t *timep, struct tm *result) > > > +{ > > + if (localtime_s(buf, timer) == 0) > > + return buf; > > + else > > + return NULL; > > +} > > +#define localtime_r(timer, buf) rte_localtime_r(timer, buf) This is a windows wrapper around the GNU extension localtime_r() so the signature needs to be the same, will change the name of the args to match man page. struct tm *localtime_r(const time_t *restrict timep, struct tm *restrict result);