On 32 bit platforms, because OCaml native ints are limited to 31 bits,
there is a trap in the normal Unix.stat, Unix.lstat functions where
any field in the stat struct may overflow. The result is random
errors like:
supermin: error: lstat: Value too large for defined data type: /tmp/tmp.Ss9aYEBASm/d2/root
You would probably only see this on armv7.
The OCaml Unix module has a "LargeFile" submodule which fixes this by
using int64 for some (unfortunately not all) fields.
For more information see the OCaml sources, file
otherlibs/unix/stat.c, all instances of "EOVERFLOW".
Gbp-Pq: Name 0001-Open-Unix.LargeFile-to-avoid-lstat-Value-too-large-f.patch
*)
open Unix
+open Unix.LargeFile
open Printf
open Utils
*)
open Unix
+open Unix.LargeFile
open Printf
open Utils
*)
open Unix
+open Unix.LargeFile
open Printf
open Utils
*)
open Unix
+open Unix.LargeFile
open Printf
open Utils
let kernels =
filter_map (
fun kernel_file ->
- let size = try (stat kernel_file).st_size with Unix_error _ -> 0 in
- if size < 10000 then None
+ let size = try (stat kernel_file).st_size with Unix_error _ -> 0L in
+ if size < 10000_L then None
else (
let kernel_name = Filename.basename kernel_file in
let modpath = Filename.dirname kernel_file in
*)
open Unix
+open Unix.LargeFile
open Printf
open Utils
*)
open Unix
+open Unix.LargeFile
open Printf
open Utils
*)
open Unix
+open Unix.LargeFile
open Printf
open Utils
*)
open Unix
+open Unix.LargeFile
open Printf
open Utils
*)
open Unix
+open Unix.LargeFile
open Printf
open Utils
*)
open Unix
+open Unix.LargeFile
open Printf
open Types
*)
open Unix
+open Unix.LargeFile
open Printf
let (+^) = Int64.add