Skip to content

Commit

Permalink
fix: sendfile() in docker
Browse files Browse the repository at this point in the history
Signed-off-by: Haoxiang Fei <feihaoxiang2014@gmail.com>
  • Loading branch information
tonyfettes authored and emillon committed Apr 2, 2024
1 parent 3796663 commit 0951c52
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions otherlibs/stdune/src/copyfile_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ CAMLprim value stdune_copyfile(value v_from, value v_to) {
caml_failwith("copyfile: only on macos");
}

static int dune_sendfile(int in, int out, int length) {
static int dune_sendfile(int in, int out, size_t length) {
int ret;
while (length > 0) {
ret = sendfile(out, in, NULL, length);
Expand All @@ -90,7 +90,7 @@ CAMLprim value stdune_sendfile(value v_in, value v_out, value v_size) {
caml_release_runtime_system();
/* TODO Use copy_file_range once we have a good mechanism to test for its
* existence */
int ret = dune_sendfile(FD_val(v_in), FD_val(v_out), Int_val(v_size));
int ret = dune_sendfile(FD_val(v_in), FD_val(v_out), Long_val(v_size));
caml_acquire_runtime_system();
if (ret < 0) {
uerror("sendfile", Nothing);
Expand Down

0 comments on commit 0951c52

Please sign in to comment.