From patchwork Mon May 29 19:53:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 13258894 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44386C7EE23 for ; Mon, 29 May 2023 19:53:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229742AbjE2Tx3 (ORCPT ); Mon, 29 May 2023 15:53:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229750AbjE2Tx0 (ORCPT ); Mon, 29 May 2023 15:53:26 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.221.58]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B153992; Mon, 29 May 2023 12:53:24 -0700 (PDT) X-QQ-mid: bizesmtp87t1685389995t9lfs5qi Received: from linux-lab-host.localdomain ( [119.123.130.80]) by bizesmtp.qq.com (ESMTP) with id ; Tue, 30 May 2023 03:53:14 +0800 (CST) X-QQ-SSF: 01200000000000D0V000000A0000000 X-QQ-FEAT: CR3LFp2JE4kuE2cO00Q/1KOi7QfVnxapLBkeSoUSu+aL7k4cNLL5T6EAjWCRL qWr+iK9XeavjZJL6SHlw1xJ39WYbVKpn5xi/kAYVRjWTUL0jc2GvhKngTUvjVkB3ZP96t8a f6bQH5yJmO7ydx9hHga2PhgYSPsewy6BXmnd6JDH+Ie/uv5PlwLeMbh5hPN9bnBjuf1wI3/ GX2HxLY2DDBNVjPV+v9pZ+RHjGYrURspNgApsk8t2R447yUh1MyCWXTv37OH8MqQk7xofTe afhTgbVNBvAS13Ewbqx3MqxnOl2Za5ZPSVDk9HvB/MNtCFJIf1+Y3Kh+P7RY2QdIZKD4kmW uCPOfJoEI2bVSbOW6d9M/0ygbJnGPeXTqMdOiA1LxQIbZHwVtv3xTZEg6CNn28wnViEtzW+ X-QQ-GoodBg: 0 X-BIZMAIL-ID: 2371937537439054605 From: Zhangjin Wu To: w@1wt.eu Cc: arnd@arndb.de, falcon@tinylab.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org, thomas@t-8ch.de Subject: [PATCH v2 06/13] tools/nolibc: add pure 64bit off_t, time_t and blkcnt_t Date: Tue, 30 May 2023 03:53:00 +0800 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrsz:qybglogicsvrsz3a-3 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org clean up std.h with include/uapi/linux/posix_types.h convert time_t to 64bit even in 32bit platforms, for y2038 issue. align off_t and blkcnt_t with 'struct statx' in include/uapi/linux/stat.h Suggested-by: Arnd Bergmann Link: https://lore.kernel.org/linux-riscv/83ab9f47-e1ed-463c-a717-26aad6bf2b71@app.fastmail.com/ Signed-off-by: Zhangjin Wu --- tools/include/nolibc/std.h | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/tools/include/nolibc/std.h b/tools/include/nolibc/std.h index 933bc0be7e1c..0f458c1c24de 100644 --- a/tools/include/nolibc/std.h +++ b/tools/include/nolibc/std.h @@ -20,17 +20,21 @@ #include "stdint.h" -/* those are commonly provided by sys/types.h */ -typedef unsigned int dev_t; -typedef unsigned long ino_t; -typedef unsigned int mode_t; -typedef signed int pid_t; -typedef unsigned int uid_t; -typedef unsigned int gid_t; -typedef unsigned long nlink_t; -typedef signed long off_t; -typedef signed long blksize_t; -typedef signed long blkcnt_t; -typedef signed long time_t; +#include + +/* based on linux/types.h */ +typedef uint32_t __kernel_dev_t; + +typedef __kernel_dev_t dev_t; +typedef __kernel_ulong_t ino_t; +typedef __kernel_mode_t mode_t; +typedef __kernel_pid_t pid_t; +typedef __kernel_uid32_t uid_t; +typedef __kernel_gid32_t gid_t; +typedef __kernel_loff_t off_t; +typedef __kernel_time64_t time_t; +typedef uint32_t nlink_t; +typedef uint32_t blksize_t; +typedef uint64_t blkcnt_t; #endif /* _NOLIBC_STD_H */