Skip to content

Commit

Permalink
fix(haiku): execve not allowed if other pthreads have already been cr…
Browse files Browse the repository at this point in the history
…eated (ocaml#10953)

* fix(haiku): execve not allowed if other pthreads have already been created

Co-authored-by: Antonio Nuno Monteiro <[email protected]>
Signed-off-by: Anarchos <[email protected]>
Signed-off-by: Sylvain78 <[email protected]>

* chore: add changelog entry

Signed-off-by: Antonio Nuno Monteiro <[email protected]>

---------

Signed-off-by: Anarchos <[email protected]>
Signed-off-by: Sylvain78 <[email protected]>
Signed-off-by: Antonio Nuno Monteiro <[email protected]>
Co-authored-by: Antonio Nuno Monteiro <[email protected]>
  • Loading branch information
Sylvain78 and anmonteiro authored Dec 26, 2024
1 parent c973f16 commit acb928f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions doc/changes/10953.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Support HaikuOS: don't call `execve` since it's not allowed if other pthreads
have been created. (@Sylvain78, #10953)
2 changes: 1 addition & 1 deletion otherlibs/stdune/src/proc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let restore_cwd_and_execve prog argv ~env =
(* run at_exit before changing the working directory *)
Stdlib.do_at_exit ();
Sys.chdir (Path.External.to_string Path.External.initial_cwd);
if Sys.win32
if Sys.win32 || Platform.OS.value = Platform.OS.Haiku
then (
let pid = Unix.create_process_env prog argv env Unix.stdin Unix.stdout Unix.stderr in
match snd (Unix.waitpid [] pid) with
Expand Down

0 comments on commit acb928f

Please sign in to comment.