std.c.dirent
has incorrect field types for ino
and off
with 64-bit file offsets on linux
#23622
Labels
bug
Observed behavior contradicts documented or intended behavior
Zig Version
0.14.0
Steps to Reproduce and Observed Behavior
The following Zig program tries to use
std.c.readdir
to iterate through a directory.I would expect the
null terminated=X
to print out the name of the file, just like this C program:Here is the result of running these programs:
Expected Behavior
I would expect both the
null terminated=X
to print the same value as for the C program:Here is the
dirent
in source:I think the
ino
and theoff
should sometimes beu64
andi64
, respectively. For example, this Zig program works fine:I am willing to contribute to the change, but I am unsure how to detect if we should be using 64-bit
ino_t
andoff_t
. For example, here is the code from glibc:Thanks
The text was updated successfully, but these errors were encountered: