]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
tools/nolibc: make dev_t 64 bits wide
authorThomas Weißschuh <linux@weissschuh.net>
Sat, 4 Apr 2026 08:08:21 +0000 (10:08 +0200)
committerThomas Weißschuh <linux@weissschuh.net>
Sat, 4 Apr 2026 08:28:57 +0000 (10:28 +0200)
statx() returns both 32-bit minor and major numbers. For both of them to
fit into the 'dev_t' in 'struct stat', that needs to be 64 bits wide.

The other uses of 'dev_t' in nolibc are makedev() and friends and
mknod(). makedev() and friends are going to be adapted in an upcoming
commit and mknod() will silently truncate 'dev_t' to 'unsigned int' in
the kernel, similar to other libcs.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://patch.msgid.link/20260404-nolibc-makedev-v2-4-456a429bf60c@weissschuh.net
tools/include/nolibc/std.h

index b9a116123902584e0af4f022a0e80f97e70c093e..dc2dc46f8ca88f3bc04ce701fa74551b7114833b 100644 (file)
@@ -19,7 +19,7 @@
 #include <linux/types.h>
 
 /* those are commonly provided by sys/types.h */
-typedef unsigned int          dev_t;
+typedef uint64_t              dev_t;
 typedef uint64_t              ino_t;
 typedef unsigned int         mode_t;
 typedef   signed int          pid_t;