You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
varp="bigfile.bin";if(File.Exists(p))
File.Delete(p);// Larger than 4GiB to trigger 32-bit overflowusing(vars=new FileStream(p, FileMode.Create, FileAccess.Write, FileShare.None))
s.SetLength(1024*1024*1024*5L);varfi=new FileInfo(p);
Console.WriteLine(fi.Length);// Fails without large file support, works with itvarret= Mono.Unix.Native.Syscall.lstat(p,outvar stat);if(ret!=0)thrownew Exception($"lstat failed: {ret}");
Console.WriteLine(stat.st_size);
This should add the required directives to the compiler, but when I build with the latest Ubuntu, these options are enabled by default.
I am not sure what system the NuGet packages were built with, but I think an OS update would fix it.
I can make a PR with my changes, but they may not be needed.
Running with my own build gives this output:
5368709120
5368709120
The text was updated successfully, but these errors were encountered:
kenkendk
changed the title
Missing LARGE_FILE_SUPPORT on 32-bit Arm
Missing LARGE_FILE_SOURCE on 32-bit Arm
Aug 2, 2024
Simple Program.cs:
And the
test.csproj
file:Running this program on 32-bit Linux gives:
The cause is overflow in the file size because it has not been compiled with
-DLARGE_FILE_SOURCE=1
.I have a "kind-of" fix here:
424ee24
This should add the required directives to the compiler, but when I build with the latest Ubuntu, these options are enabled by default.
I am not sure what system the NuGet packages were built with, but I think an OS update would fix it.
I can make a PR with my changes, but they may not be needed.
Running with my own build gives this output:
The text was updated successfully, but these errors were encountered: