[libc-commits] [libc] [libc] Change fsfilcnt_t and fsblkcnt_t to be 64-bits long (PR #99876)

Mikhail R. Gadelha via libc-commits libc-commits at lists.llvm.org
Mon Jul 22 07:04:34 PDT 2024


https://github.com/mikhailramalho updated https://github.com/llvm/llvm-project/pull/99876

>From 3e09e25b984612cf4b6373f60efec2272c942636 Mon Sep 17 00:00:00 2001
From: "Mikhail R. Gadelha" <mikhail at igalia.com>
Date: Mon, 22 Jul 2024 10:57:11 -0300
Subject: [PATCH] [libc] Change fsfilcnt_t and fsblkcnt_t to be 64-bits long

In 32-bit systems with 64-bit offsets, both fsfilcnt_t and fsblkcnt_t
are 64-bit long, just like 64-bit systems. This patch changes both types
to be 64-bit long for all platforms and follows the reasoning used to
change off_t: the standard only requires it to be an unsigned int, so
making it 64-bit long doesn't violate this property.
---
 libc/include/llvm-libc-types/fsblkcnt_t.h | 2 +-
 libc/include/llvm-libc-types/fsfilcnt_t.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libc/include/llvm-libc-types/fsblkcnt_t.h b/libc/include/llvm-libc-types/fsblkcnt_t.h
index 88a53d38cb1b3..8c7d3307278cd 100644
--- a/libc/include/llvm-libc-types/fsblkcnt_t.h
+++ b/libc/include/llvm-libc-types/fsblkcnt_t.h
@@ -9,6 +9,6 @@
 #ifndef LLVM_LIBC_TYPES_FSBLKCNT_T_H
 #define LLVM_LIBC_TYPES_FSBLKCNT_T_H
 
-typedef __SIZE_TYPE__ fsblkcnt_t;
+typedef __UINT64_TYPE__ fsblkcnt_t;
 
 #endif // LLVM_LIBC_TYPES_FSBLKCNT_T_H
diff --git a/libc/include/llvm-libc-types/fsfilcnt_t.h b/libc/include/llvm-libc-types/fsfilcnt_t.h
index c5693591907ab..12697830e92eb 100644
--- a/libc/include/llvm-libc-types/fsfilcnt_t.h
+++ b/libc/include/llvm-libc-types/fsfilcnt_t.h
@@ -9,6 +9,6 @@
 #ifndef LLVM_LIBC_TYPES_FSFILCNT_T_H
 #define LLVM_LIBC_TYPES_FSFILCNT_T_H
 
-typedef __SIZE_TYPE__ fsfilcnt_t;
+typedef __UINT64_TYPE__ fsfilcnt_t;
 
 #endif // LLVM_LIBC_TYPES_FSFILCNT_T_H



More information about the libc-commits mailing list