[PATCH] mlist: use fixed-width integer types for struct linux_dirent64 d_ino and d_off

3 views
Skip to first unread message

Michael Forney

unread,
Dec 7, 2022, 4:22:45 PM12/7/22
to mbl...@googlegroups.com
ino64_t and off64_t are non-standard types and musl will no longer
expose them without __LARGEFILE64_SOURCE in the next release.
Internally, the kernel uses u64 and s64 for these fields, so replace
them with uint64_t and int64_t respectively.
---
mlist.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mlist.c b/mlist.c
index 5debf99..20061d9 100644
--- a/mlist.c
+++ b/mlist.c
@@ -111,8 +111,8 @@ list(char *prefix, char *file)
#include <sys/syscall.h>

struct linux_dirent64 {
- ino64_t d_ino; /* 64-bit inode number */
- off64_t d_off; /* 64-bit offset to next structure */
+ uint64_t d_ino; /* 64-bit inode number */
+ int64_t d_off; /* 64-bit offset to next structure */
unsigned short d_reclen; /* Size of this dirent */
unsigned char d_type; /* File type */
char d_name[]; /* Filename (null-terminated) */
--
2.37.3

Reply all
Reply to author
Forward
0 new messages