diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 2001-08-28 14:47:48 +0000 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 2001-08-28 14:47:48 +0000 |
commit | ddd99c7e5d2f0f8e7364e8521fa7e8308999344e (patch) | |
tree | 3c0158d035a52c0cf185c08c3288c3c76d6718d0 /otherlibs/win32unix/createprocess.c | |
parent | c345611817d76ccc3bbd02db1f942774220739f9 (diff) |
Chargement dynamique de primitives C
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@3677 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'otherlibs/win32unix/createprocess.c')
-rw-r--r-- | otherlibs/win32unix/createprocess.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/otherlibs/win32unix/createprocess.c b/otherlibs/win32unix/createprocess.c index d0e2abba9..6e84c78da 100644 --- a/otherlibs/win32unix/createprocess.c +++ b/otherlibs/win32unix/createprocess.c @@ -14,11 +14,9 @@ #include <windows.h> #include <mlvalues.h> +#include <osdeps.h> #include "unixsupport.h" -/* From the Caml runtime */ -extern char * searchpath(char * name); - static int win_has_console(void); value win_create_process_native(value cmd, value cmdline, value env, @@ -29,8 +27,7 @@ value win_create_process_native(value cmd, value cmdline, value env, char * exefile, * envp; int flags; - exefile = searchpath(String_val(cmd)); - if (exefile == NULL) exefile = String_val(cmd); + exefile = search_exe_in_path(String_val(cmd)); if (env != Val_int(0)) { envp = String_val(Field(env, 0)); } else { @@ -54,7 +51,7 @@ value win_create_process_native(value cmd, value cmdline, value env, /* Create the process */ if (! CreateProcess(exefile, String_val(cmdline), NULL, NULL, TRUE, flags, envp, NULL, &si, &pi)) { - _dosmaperr(GetLastError()); + win32_maperr(GetLastError()); uerror("create_process", cmd); } CloseHandle(pi.hThread); @@ -63,7 +60,7 @@ value win_create_process_native(value cmd, value cmdline, value env, return Val_int(pi.hProcess); } -value win_create_process(value * argv, int argn) /* ML */ +CAMLprim value win_create_process(value * argv, int argn) { return win_create_process_native(argv[0], argv[1], argv[2], argv[3], argv[4], argv[5]); |