[PATCH v3] Fix POSIX compliance: Make blkcnt_t and blksize_t signed on alpha
Osama Abdelkader
osama.abdelkader@gmail.com
Sun Nov 23 18:29:54 GMT 2025
POSIX requires that blkcnt_t and blksize_t are signed integer types.
On alpha, these were incorrectly defined as unsigned types.
This change makes them signed to match:
- POSIX requirements
- All other architectures in glibc
Fixes #33355
Suggested-by: Collin Funk <collin.funk@gmail.com>
Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
---
v3: use __S64_TYPE for blkcnt64_t
---
sysdeps/unix/sysv/linux/alpha/bits/typesizes.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h b/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h
index 8cc4491c0b..24a3ee879c 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h
@@ -38,8 +38,8 @@
#define __PID_T_TYPE __S32_TYPE
#define __RLIM_T_TYPE __ULONGWORD_TYPE
#define __RLIM64_T_TYPE __U64_TYPE
-#define __BLKCNT_T_TYPE __U32_TYPE
-#define __BLKCNT64_T_TYPE __U64_TYPE
+#define __BLKCNT_T_TYPE __S32_TYPE
+#define __BLKCNT64_T_TYPE __S64_TYPE
#define __FSBLKCNT_T_TYPE __S32_TYPE
#define __FSBLKCNT64_T_TYPE __S64_TYPE
#define __FSFILCNT_T_TYPE __U32_TYPE
@@ -54,7 +54,7 @@
#define __KEY_T_TYPE __S32_TYPE
#define __CLOCKID_T_TYPE __S32_TYPE
#define __TIMER_T_TYPE void *
-#define __BLKSIZE_T_TYPE __U32_TYPE
+#define __BLKSIZE_T_TYPE __S32_TYPE
#define __FSID_T_TYPE struct { int __val[2]; }
#define __SSIZE_T_TYPE __SWORD_TYPE
#define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE
--
2.43.0
More information about the Libc-alpha
mailing list