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: 100395 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1736118vqr; Mon, 29 May 2023 12:55:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5lYgFf5XJFfRPxHiXzZmvs9xMdticyT4Adi3IarwSNXU380+yaldBUFjw76whKW+HwGjBV X-Received: by 2002:a17:90a:bb87:b0:255:f113:48f4 with SMTP id v7-20020a17090abb8700b00255f11348f4mr146263pjr.24.1685390122434; Mon, 29 May 2023 12:55:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685390122; cv=none; d=google.com; s=arc-20160816; b=N3NZL8YPdeLUewMZ0oR1jH/P/KTTH/JKrxI06SJQd0oIoxBn1WfP2TgWtKO3PqTqFV Q75LbknN7D1vRiMglCk7jmJZdx9Owj1CICfzs39nY4Hg5EgOvdxEdJD4OYOb2xHd+zVM PGjmnePKCQcYaIJnzNpcyjI81R4Xv1hbkWYA1Krqrv35bxqqGdh6loS350o04y/RLnrW k9jRr9qWZkGbFQ7JiR16IjYRE4LQKa9NDEYFbju3TT5LWL7hKnfqeusmBtA1QS03aSzq 9DezgZlK6O3G79wAS321/X3B20nHpYH/9L0k+cjmNljpFv/h+wfUEH23oAJVJMa2GEYR /nMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=8SSnHTFUdISsCKzhAe86DqtD6CqzpgIMM9vmV8l/fnA=; b=PzGaiiWeaPTbEsRUgduDgVOt9JHtWgeja2zWJZhB9TQWPfHPr2jLT0psN39FOI10hW qZcNJv30kGTfDf5+EqbARhgzBfE211G11tn/eNxsG5tMSx1HoFigq6mSntvVpJkiXXdb +cURSSnIAsn9kWqfxFiIEjAbfJ34L/osPHnwFzR4rMyuxYyy+OevGZOAY0ThcUt7X0Rb MOOzlRwGhZiU4BbGsO0UCZWgTyHMVQX37FTMRfmZ7cn76/p+JZ1PUcG7NrR8+fIp7A/y 5zZj5XDIcYOycwE6r7AkGbHls4BtVdpPGbJmWNd+741/KR1Cg2BxXT24xklLDBvBwYCY swHA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gl12-20020a17090b120c00b002477dac5834si10144992pjb.95.2023.05.29.12.55.10; Mon, 29 May 2023 12:55:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229753AbjE2Txa (ORCPT + 99 others); Mon, 29 May 2023 15:53:30 -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 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767259632756743553?= X-GMAIL-MSGID: =?utf-8?q?1767259632756743553?= 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 */