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.

Add eventfd support

Registering an eventfd to the io_uring is useful for interfacing
with systems that already use polling.

Signed-off-by: Luca Seritan <luca.seritan@gmail.com>

+21
+5
vendor/opam/uring/lib/uring/uring.ml
··· 343 343 external peek_cqe : t -> cqe_option = "ocaml_uring_peek_cqe" 344 344 345 345 external error_of_errno : int -> Unix.error = "ocaml_uring_error_of_errno" 346 + external register_eventfd : t -> Unix.file_descr -> unit = "ocaml_uring_register_eventfd" 346 347 end 347 348 348 349 type 'a t = { ··· 582 583 fn_on_ring Uring.peek_cqe t 583 584 584 585 let peek = get_cqe_nonblocking 586 + 587 + let register_eventfd t fd = 588 + check t; 589 + Uring.register_eventfd t.uring fd 585 590 586 591 let wait ?timeout t = 587 592 check t;
+4
vendor/opam/uring/lib/uring/uring.mli
··· 441 441 val peek : 'a t -> 'a completion_option 442 442 [@@deprecated "Renamed to Uring.get_cqe_nonblocking"] 443 443 444 + val register_eventfd : 'a t -> Unix.file_descr -> unit 445 + (** [register_eventfd t fd] will register an eventfd to the the uring [t]. 446 + See documentation for io_uring_register_eventfd *) 447 + 444 448 val error_of_errno : int -> Unix.error 445 449 (** [error_of_errno e] converts the error code [abs e] to a Unix error type. *) 446 450
+12
vendor/opam/uring/lib/uring/uring_stubs.c
··· 998 998 else 999 999 return Val_false; 1000 1000 } 1001 + 1002 + value 1003 + ocaml_uring_register_eventfd(value v_uring, value v_fd) { 1004 + struct io_uring *ring = Ring_val(v_uring); 1005 + int fd = Int_val(v_fd); 1006 + 1007 + int ret = io_uring_register_eventfd(ring, fd); 1008 + if (ret) 1009 + unix_error(-ret, "io_uring_register_eventfd", Nothing); 1010 + 1011 + return Val_unit; 1012 + }