···8484CAMLprim value ocaml_uring_submit_accept(value, value, value, value);
8585CAMLprim value ocaml_uring_submit_cancel(value, value, value);
8686CAMLprim value ocaml_uring_submit_openat2(value, value, value, value);
8787+CAMLprim value ocaml_uring_submit_linkat_native(value, value, value, value, value, value, value);
8888+CAMLprim value ocaml_uring_submit_linkat_byte(value *, int);
8789CAMLprim value ocaml_uring_submit_unlinkat(value, value, value, value, value);
8890CAMLprim value ocaml_uring_submit_send_msg(value, value, value, value, value);
8991CAMLprim value ocaml_uring_submit_recv_msg(value, value, value, value, value);
+15-1
vendor/opam/uring/lib/uring/uring.ml
···116116117117 module Flags = struct
118118 include Flags
119119- include Config.Statx.Flags
119119+ include Config.At
120120 end
121121122122 module Attr = struct
···329329 external submit_accept : t -> id -> Unix.file_descr -> Sockaddr.t -> bool = "ocaml_uring_submit_accept" [@@noalloc]
330330 external submit_cancel : t -> id -> id -> bool = "ocaml_uring_submit_cancel" [@@noalloc]
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]
332333 external submit_unlinkat : t -> id -> Unix.file_descr -> Sketch.ptr -> bool -> bool = "ocaml_uring_submit_unlinkat" [@@noalloc]
333334 external submit_send_msg : t -> id -> Unix.file_descr -> Msghdr.t -> Sketch.ptr -> bool = "ocaml_uring_submit_send_msg" [@@noalloc]
334335 external submit_recv_msg : t -> id -> Unix.file_descr -> Msghdr.t -> Sketch.ptr -> bool = "ocaml_uring_submit_recv_msg" [@@noalloc]
···464465 in
465466 let open_how = Open_how.v ~open_flags ~perm ~resolve path in
466467 with_id_full t (fun id -> Uring.submit_openat2 t.uring id fd open_how) user_data ~extra_data:open_how
468468+469469+module Linkat_flags = struct
470470+ include Flags
471471+ let empty_path = Config.At.empty_path
472472+ let symlink_follow = Config.At.symlink_follow
473473+end
474474+475475+let linkat t ?(old_dir_fd=at_fdcwd) ?(new_dir_fd=at_fdcwd) ~flags ~old_path ~new_path user_data =
476476+ with_id t (fun id ->
477477+ let old_path_buf = Sketch.String.alloc t.sketch old_path in
478478+ let new_path_buf = Sketch.String.alloc t.sketch new_path in
479479+ Uring.submit_linkat t.uring id old_dir_fd old_path_buf new_dir_fd new_path_buf flags
480480+ ) user_data
467481468482let unlink t ~dir ?(fd=at_fdcwd) path user_data =
469483 with_id t (fun id ->
+26
vendor/opam/uring/lib/uring/uring.mli
···251251 @param perm sets the access control bits for newly created files (subject to the process's umask)
252252 @param resolve controls how the pathname is resolved. *)
253253254254+module Linkat_flags : sig
255255+ include FLAGS
256256+257257+ val empty_path : t
258258+ (** If the old path is empty, link to old_dir_fd. *)
259259+260260+ val symlink_follow : t
261261+ (** If the old path is a symlink, link its target. *)
262262+end
263263+264264+val linkat : 'a t ->
265265+ ?old_dir_fd:Unix.file_descr ->
266266+ ?new_dir_fd:Unix.file_descr ->
267267+ flags:Linkat_flags.t ->
268268+ old_path:string ->
269269+ new_path:string ->
270270+ 'a -> 'a job option
271271+(** [linkat t ~flags ~old_path ~new_path] creates a new hard link.
272272+273273+ If [new_path] already exists then it is not overwritten.
274274+275275+ @param old_dir_fd If provided and [old_path] is a relative path, it is interpreted relative to [old_dir_fd].
276276+ @param new_dir_fd If provided and [new_path] is a relative path, it is interpreted relative to [new_dir_fd].
277277+ @param old_path Path of the already-existing link.
278278+ @param new_path Path for the newly created link. *)
279279+254280val unlink : 'a t -> dir:bool -> ?fd:Unix.file_descr -> string -> 'a -> 'a job option
255281(** [unlink t ~dir ~fd path] removes the directory entry [path], which is resolved relative to [fd].
256282 If [fd] is not given, then the current working directory is used.