Skip to content

Commit

Permalink
Expose UV_PROCESS_WINDOWS_FILE_PATH_EXACT_NAME
Browse files Browse the repository at this point in the history
  • Loading branch information
aantron committed Feb 8, 2024
1 parent c5ed14a commit 188b893
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/c/luv_c_type_descriptions.ml
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,8 @@ struct
let windows_hide = constant "UV_PROCESS_WINDOWS_HIDE" int
let windows_hide_console = constant "UV_PROCESS_WINDOWS_HIDE_CONSOLE" int
let windows_hide_gui = constant "UV_PROCESS_WINDOWS_HIDE_GUI" int
let windows_file_path_exact_name =
constant "UV_PROCESS_WINDOWS_FILE_PATH_EXACT_NAME" int
end

module Redirection =
Expand Down
2 changes: 2 additions & 0 deletions src/c/shims.h
Original file line number Diff line number Diff line change
Expand Up @@ -803,4 +803,6 @@
{
return ENOSYS;
}

#define UV_PROCESS_WINDOWS_FILE_PATH_EXACT_NAME 0
#endif
1 change: 1 addition & 0 deletions src/feature/detect_features.ml
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ let () =
needs 14 "prioritized" "See [`PRIORITIZED] in {!Luv.Poll.Event.t}.";
needs 24 "process_windows_hide_console" "See {!Luv.Process.spawn}.";
needs 24 "process_windows_hide_gui" "See {!Luv.Process.spawn}.";
needs 48 "process_windows_file_path_exact_name" "See {!Luv.Process.spawn}.";
needs 33 "random" "See {!Luv.Random.random}.";
needs 28 "readdir" "See {!Luv.File.readdir}.";
needs 45 "setaffinity" "See {!Luv.Thread.setaffinity}.";
Expand Down
2 changes: 2 additions & 0 deletions src/process.ml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ let spawn
?windows_hide
?windows_hide_console
?windows_hide_gui
?windows_file_path_exact_name
path arguments =

let loop = Loop.or_default loop in
Expand Down Expand Up @@ -167,6 +168,7 @@ let spawn
|> maybe_flag windows_hide Flag.windows_hide
|> maybe_flag windows_hide_console Flag.windows_hide_console
|> maybe_flag windows_hide_gui Flag.windows_hide_gui
|> maybe_flag windows_file_path_exact_name Flag.windows_file_path_exact_name
in

let redirections, redirection_count = build_redirection_array redirect in
Expand Down
7 changes: 5 additions & 2 deletions src/process.mli
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ val spawn :
?windows_hide:bool ->
?windows_hide_console:bool ->
?windows_hide_gui:bool ->
?windows_file_path_exact_name:bool ->
string ->
string list ->
(t, Error.t) result
Expand Down Expand Up @@ -117,12 +118,14 @@ val spawn :
process, and redirect them to [/dev/null] or [nul].
[?windows_hide_console] and [?windows_hide_gui] have no effect on libuv
prior to 1.24.0.
prior to 1.24.0. [?windows_file_path_exact_name] has no effect on libuv
prior to 1.48.0.
{{!Luv.Require} Feature checks}:
- [Luv.Require.(has process_windows_hide_console)]
- [Luv.Require.(has process_windows_hide_gui)] *)
- [Luv.Require.(has process_windows_hide_gui)]
- [Luv.Require.(has process_windows_file_path_exact_name)] *)

val disable_stdio_inheritance : unit -> unit
(** Disables (tries) file descriptor inheritance for inherited descriptors.
Expand Down

0 comments on commit 188b893

Please sign in to comment.