The unpac monorepo manager self-hosting as a monorepo using unpac
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Make Uring.statx st_size an int64 to avoid potential truncation

authored by

Anil Madhavapeddy and committed by
Thomas Leonard
0bb949a7 d5e35636

+8 -15
+1 -1
vendor/opam/uring/lib/uring/uring.ml
··· 144 144 external uid : t -> (int64 [@unboxed]) = "ocaml_uring_statx_uid_bytes" "ocaml_uring_statx_uid_native" [@@noalloc] 145 145 external gid : t -> (int64 [@unboxed]) = "ocaml_uring_statx_gid_bytes" "ocaml_uring_statx_gid_native" [@@noalloc] 146 146 external ino : t -> (int64 [@unboxed]) = "ocaml_uring_statx_ino_bytes" "ocaml_uring_statx_ino_native" [@@noalloc] 147 + external size : t -> (int64 [@unboxed]) = "ocaml_uring_statx_size_bytes" "ocaml_uring_statx_size_native" [@@noalloc] 147 148 external blocks : t -> (int64 [@unboxed]) = "ocaml_uring_statx_blocks_bytes" "ocaml_uring_statx_blocks_native" [@@noalloc] 148 149 external attributes_mask : t -> (int64 [@unboxed]) = "ocaml_uring_statx_attributes_mask_bytes" "ocaml_uring_statx_attributes_mask_native" [@@noalloc] 149 150 external rdev : t -> (int64 [@unboxed]) = "ocaml_uring_statx_rdev_bytes" "ocaml_uring_statx_rdev_native" [@@noalloc] ··· 167 168 external perm : t -> (int [@untagged]) = "ocaml_uring_statx_perm_bytes" "ocaml_uring_statx_perm_native" [@@noalloc] 168 169 169 170 external kind : t -> kind = "ocaml_uring_statx_kind" 170 - external size : t -> Optint.Int63.t = "ocaml_uring_statx_size" 171 171 end 172 172 173 173 module Sockaddr = struct
+1 -1
vendor/opam/uring/lib/uring/uring.mli
··· 314 314 val uid : t -> Int64.t 315 315 val gid : t -> Int64.t 316 316 val ino : t -> Int64.t 317 + val size : t -> Int64.t 317 318 val blocks : t -> Int64.t 318 319 val attributes_mask : t -> Int64.t 319 320 val rdev : t -> Int64.t ··· 342 343 val mode : t -> int 343 344 val perm : t -> int 344 345 345 - val size : t -> Optint.Int63.t 346 346 val kind : t -> kind 347 347 end 348 348
+1 -8
vendor/opam/uring/lib/uring/uring_stubs.c
··· 54 54 // TODO: this belongs in Optint 55 55 #ifdef ARCH_SIXTYFOUR 56 56 #define Int63_val(v) Long_val(v) 57 - #define caml_copy_int63(v) Val_long(v) 58 57 #else 59 58 #define Int63_val(v) (Int64_val(v) >> 1) 60 - #define caml_copy_int63(v) caml_copy_int64(v << 1) 61 59 #endif 62 60 63 61 #define Ring_val(v) *((struct io_uring**)Data_custom_val(v)) ··· 510 508 STATX_GETTER(uid, int64_t, caml_copy_int64); 511 509 STATX_GETTER(gid, int64_t, caml_copy_int64); 512 510 STATX_GETTER(ino, int64_t, caml_copy_int64); 511 + STATX_GETTER(size, int64_t, caml_copy_int64); 513 512 STATX_GETTER(blocks, int64_t, caml_copy_int64); 514 513 STATX_GETTER(attributes_mask, int64_t, caml_copy_int64); 515 514 STATX_GETTER(mask, int64_t, caml_copy_int64); ··· 619 618 ocaml_uring_statx_kind(value v_statx) { 620 619 struct statx *s = Statx_val(v_statx); 621 620 return get_file_type_variant(s); 622 - } 623 - 624 - value 625 - ocaml_uring_statx_size(value v_statx) { 626 - struct statx *s = Statx_val(v_statx); 627 - return caml_copy_int63(s->stx_size); 628 621 } 629 622 630 623 struct sock_addr_data {
+4 -4
vendor/opam/uring/tests/main.md
··· 214 214 val token : [ `Open_path | `Statx ] = `Statx 215 215 val retval : int = 0 216 216 217 - # Uring.Statx.kind statx, Printf.sprintf "0o%o" (Uring.Statx.perm statx), Int63.to_int (Uring.Statx.size statx);; 218 - - : Uring.Statx.kind * string * int = (`Regular_file, "0o600", 9) 217 + # Uring.Statx.kind statx, Printf.sprintf "0o%o" (Uring.Statx.perm statx), (Uring.Statx.size statx);; 218 + - : Uring.Statx.kind * string * int64 = (`Regular_file, "0o600", 9L) 219 219 220 220 # if not (Uring.Statx.(Mask.check (mask statx) Mask.dioalign)) then assert (Uring.Statx.dio_mem_align statx = 0L);; 221 221 - : unit = () ··· 261 261 val token : [ `Open_path | `Statx ] = `Statx 262 262 val retval : int = 0 263 263 264 - # Uring.Statx.kind statx, Printf.sprintf "0o%o" (Uring.Statx.perm statx), Int63.to_int (Uring.Statx.size statx);; 265 - - : Uring.Statx.kind * string * int = (`Regular_file, "0o600", 9) 264 + # Uring.Statx.kind statx, Printf.sprintf "0o%o" (Uring.Statx.perm statx), (Uring.Statx.size statx);; 265 + - : Uring.Statx.kind * string * int64 = (`Regular_file, "0o600", 9L) 266 266 267 267 # let fd : unit = Unix.close fd;; 268 268 val fd : unit = ()
+1 -1
vendor/opam/uring/tests/urstat.ml
··· 22 22 | _ -> "" in 23 23 Format.printf " File: %s%s\n Size: %Lu\t\tBlocks: %Lu\tIO Block: %Lu\t %a\nDevice: %Lu\tInode: %Lu\tLinks: %Lu\nAccess: (%04o/TODO)\tUid: (%Lu/TODO)\tGid: (%Lu/TODO)\nAccess: %a\nModify: %a\nChange: %a\n Birth: %a\n%!" 24 24 fname opt_symlink 25 - (Optint.Int63.to_int64 (S.size buf)) 25 + (S.size buf) 26 26 (S.blocks buf) 27 27 (S.blksize buf) 28 28 S.pp_kind (S.kind buf)