···330330 external submit_close : t -> Unix.file_descr -> id -> bool = "ocaml_uring_submit_close" [@@noalloc]
331331 external submit_statx : t -> id -> Unix.file_descr -> Statx.t -> Sketch.ptr -> int -> int -> bool = "ocaml_uring_submit_statx_byte" "ocaml_uring_submit_statx_native" [@@noalloc]
332332 external submit_splice : t -> id -> Unix.file_descr -> Unix.file_descr -> int -> bool = "ocaml_uring_submit_splice" [@@noalloc]
333333+ external submit_bind : t -> id -> Unix.file_descr -> Sockaddr.t -> bool = "ocaml_uring_submit_bind" [@@noalloc]
334334+ external submit_listen : t -> id -> Unix.file_descr -> int -> bool = "ocaml_uring_submit_listen" [@@noalloc]
333335 external submit_connect : t -> id -> Unix.file_descr -> Sockaddr.t -> bool = "ocaml_uring_submit_connect" [@@noalloc]
334336 external submit_accept : t -> id -> Unix.file_descr -> Sockaddr.t -> bool = "ocaml_uring_submit_accept" [@@noalloc]
335337 external submit_cancel : t -> id -> id -> bool = "ocaml_uring_submit_cancel" [@@noalloc]
···545547546548let splice t ~src ~dst ~len user_data =
547549 with_id t (fun id -> Uring.submit_splice t.uring id src dst len) user_data
550550+551551+let bind t fd addr user_data =
552552+ let addr = Sockaddr.of_unix addr in
553553+ with_id_full t (fun id -> Uring.submit_bind t.uring id fd addr) user_data ~extra_data:addr
554554+555555+let listen t fd backlog user_data =
556556+ with_id t (fun id -> Uring.submit_listen t.uring id fd backlog) user_data
548557549558let connect t fd addr user_data =
550559 let addr = Sockaddr.of_unix addr in
+6
vendor/opam/uring/lib/uring/uring.mli
···595595(** [statx t ?fd ~mask path stat flags] stats [path], which is resolved relative to [fd]
596596 (or the current directory if [fd] is not given). *)
597597598598+val bind : 'a t -> Unix.file_descr -> Unix.sockaddr -> 'a -> 'a job option
599599+(** [bind t fd addr d] will submit a request to bind [fd] to [addr]. *)
600600+601601+val listen : 'a t -> Unix.file_descr -> int -> 'a -> 'a job option
602602+(** [listen t fd backlog d] will submit a request to listen on [fd] with [backlog] maximum pending connections. *)
603603+598604val connect : 'a t -> Unix.file_descr -> Unix.sockaddr -> 'a -> 'a job option
599605(** [connect t fd addr d] will submit a request to connect [fd] to [addr]. *)
600606
+24
vendor/opam/uring/lib/uring/uring_stubs.c
···778778779779// v_sockaddr must not be GC'd while the call is in progress
780780value /* noalloc */
781781+ocaml_uring_submit_bind(value v_uring, value v_id, value v_fd, value v_sockaddr) {
782782+ struct io_uring *ring = Ring_val(v_uring);
783783+ struct io_uring_sqe *sqe;
784784+ struct sock_addr_data *addr = Sock_addr_val(v_sockaddr);
785785+ sqe = io_uring_get_sqe(ring);
786786+ if (!sqe) return (Val_false);
787787+ io_uring_prep_bind(sqe, Int_val(v_fd), &(addr->sock_addr_addr.s_gen), addr->sock_addr_len);
788788+ io_uring_sqe_set_data(sqe, (void *)Long_val(v_id));
789789+ return (Val_true);
790790+}
791791+792792+value /* noalloc */
793793+ocaml_uring_submit_listen(value v_uring, value v_id, value v_fd, value v_backlog) {
794794+ struct io_uring *ring = Ring_val(v_uring);
795795+ struct io_uring_sqe *sqe;
796796+ sqe = io_uring_get_sqe(ring);
797797+ if (!sqe) return (Val_false);
798798+ io_uring_prep_listen(sqe, Int_val(v_fd), Int_val(v_backlog));
799799+ io_uring_sqe_set_data(sqe, (void *)Long_val(v_id));
800800+ return (Val_true);
801801+}
802802+803803+// v_sockaddr must not be GC'd while the call is in progress
804804+value /* noalloc */
781805ocaml_uring_submit_connect(value v_uring, value v_id, value v_fd, value v_sockaddr) {
782806 struct io_uring *ring = Ring_val(v_uring);
783807 struct io_uring_sqe *sqe;