Avoid statx() when reading binary export

Should fix #261.
This commit is contained in:
Yorhel 2025-06-23 13:47:45 +02:00
parent 5b96a48f53
commit 67f34090fb

View file

@ -504,7 +504,9 @@ pub fn import() void {
pub fn open(fd: std.fs.File) !void { pub fn open(fd: std.fs.File) !void {
global.fd = fd; global.fd = fd;
const size = try fd.getEndPos(); // Do not use fd.getEndPos() because that requires newer kernels supporting statx() #261.
try fd.seekFromEnd(0);
const size = try fd.getPos();
if (size < 16) return error.EndOfStream; if (size < 16) return error.EndOfStream;
// Read index block // Read index block