···331331 external submit_openat2 : t -> id -> Unix.file_descr -> Open_how.t -> bool = "ocaml_uring_submit_openat2" [@@noalloc]
332332 external submit_linkat : t -> id -> Unix.file_descr -> Sketch.ptr -> Unix.file_descr -> Sketch.ptr -> int -> bool = "ocaml_uring_submit_linkat_byte" "ocaml_uring_submit_linkat_native" [@@noalloc]
333333 external submit_unlinkat : t -> id -> Unix.file_descr -> Sketch.ptr -> bool -> bool = "ocaml_uring_submit_unlinkat" [@@noalloc]
334334+ external submit_mkdirat : t -> id -> Unix.file_descr -> Sketch.ptr -> int -> bool = "ocaml_uring_submit_mkdirat" [@@noalloc]
334335 external submit_send_msg : t -> id -> Unix.file_descr -> Msghdr.t -> Sketch.ptr -> bool = "ocaml_uring_submit_send_msg" [@@noalloc]
335336 external submit_recv_msg : t -> id -> Unix.file_descr -> Msghdr.t -> Sketch.ptr -> bool = "ocaml_uring_submit_recv_msg" [@@noalloc]
336337 external submit_fsync : t -> id -> Unix.file_descr -> int64 -> int -> bool = "ocaml_uring_submit_fsync" [@@noalloc]
···485486 with_id t (fun id ->
486487 let buf = Sketch.String.alloc t.sketch path in
487488 Uring.submit_unlinkat t.uring id fd buf dir
489489+ ) user_data
490490+491491+let mkdirat t ~mode ?(fd=at_fdcwd) path user_data =
492492+ with_id t (fun id ->
493493+ let buf = Sketch.String.alloc t.sketch path in
494494+ Uring.submit_mkdirat t.uring id fd buf mode
488495 ) user_data
489496490497let read t ~file_offset fd (buf : Cstruct.t) user_data =
+5
vendor/opam/uring/lib/uring/uring.mli
···284284 @param dir If [true], this acts like [rmdir] (only removing empty directories).
285285 If [false], it acts like [unlink] (only removing non-directories). *)
286286287287+val mkdirat : 'a t -> mode:Unix.file_perm -> ?fd:Unix.file_descr -> string -> 'a -> 'a job option
288288+(** [mkdirat t ~mode ~fd path] makes a directory [path], which is resolved relative to [fd].
289289+ If [fd] is not given, then the current working directory is used.
290290+ @param mode The mode used to create the directory. *)
291291+287292module Poll_mask : sig
288293 include FLAGS
289294
+11
vendor/opam/uring/lib/uring/uring_stubs.c
···854854}
855855856856value /* noalloc */
857857+ocaml_uring_submit_mkdirat(value v_uring, value v_id, value v_fd, value v_sketch_ptr, value v_mode) {
858858+ struct io_uring *ring = Ring_val(v_uring);
859859+ struct io_uring_sqe *sqe = io_uring_get_sqe(ring);
860860+ char *path = Sketch_ptr_val(v_sketch_ptr);
861861+ if (!sqe) return (Val_false);
862862+ io_uring_prep_mkdirat(sqe, Int_val(v_fd), path, Int_val(v_mode));
863863+ io_uring_sqe_set_data(sqe, (void *)Long_val(v_id));
864864+ return (Val_true);
865865+}
866866+867867+value /* noalloc */
857868ocaml_uring_submit_fsync(value v_uring, value v_id, value v_fd, value v_off, value v_len)
858869{
859870 struct io_uring *ring = Ring_val(v_uring);
+25
vendor/opam/uring/tests/main.md
···865865- : unit = ()
866866```
867867868868+## Mkdirat
869869+870870+```ocaml
871871+# let t : [ `Mkdir of int ] Uring.t = Uring.create ~queue_depth:1 ();;
872872+val t : [ `Mkdir of int ] Uring.t = <abstr>
873873+# Uring.mkdirat t ~mode:0o755 "mkdir" (`Mkdir 0);;
874874+- : [ `Mkdir of int ] Uring.job option = Some <abstr>
875875+# Uring.submit t;;
876876+- : int = 1
877877+# Uring.wait t;;
878878+- : [ `Mkdir of int ] Uring.completion_option =
879879+Uring.Some {Uring.result = 0; data = `Mkdir 0}
880880+# (Unix.stat "mkdir").st_perm;;
881881+- : int = 448
882882+# let v = Uring.mkdirat t ~mode:0o755 "mkdir" (`Mkdir 1);;
883883+val v : [ `Mkdir of int ] Uring.job option = Some <abstr>
884884+# Uring.submit t;;
885885+- : int = 1
886886+# Uring.wait t;;
887887+- : [ `Mkdir of int ] Uring.completion_option =
888888+Uring.Some {Uring.result = -17; data = `Mkdir 1}
889889+# Uring.exit t;;
890890+- : unit = ()
891891+```
892892+868893## Timeout
869894870895Timeout should return (-ETIME). This is defined in https://github.com/torvalds/linux/blob/master/include/uapi/asm-generic/errno.h#L45