1 /***********************************************************************/
5 /* Xavier Leroy, projet Cristal, INRIA Rocquencourt */
7 /* Copyright 1996 Institut National de Recherche en Informatique et */
8 /* en Automatique. All rights reserved. This file is distributed */
9 /* under the terms of the GNU Library General Public License, with */
10 /* the special exception on linking described in file ../../LICENSE. */
12 /***********************************************************************/
14 /* $Id: execvp.c 4144 2001-12-07 13:41:02Z xleroy $ */
18 #include "unixsupport.h"
20 extern char ** cstringvect();
22 extern char ** environ;
25 CAMLprim value unix_execvp(value path, value args)
28 argv = cstringvect(args);
29 (void) execvp(String_val(path), argv);
30 stat_free((char *) argv);
31 uerror("execvp", path);
32 return Val_unit; /* never reached, but suppress warnings */
33 /* from smart compilers */
36 CAMLprim value unix_execvpe(value path, value args, value env)
39 char ** saved_environ;
40 argv = cstringvect(args);
41 saved_environ = environ;
42 environ = cstringvect(env);
43 (void) execvp(String_val(path), argv);
44 stat_free((char *) argv);
45 stat_free((char *) environ);
46 environ = saved_environ;
47 uerror("execvp", path);
48 return Val_unit; /* never reached, but suppress warnings */
49 /* from smart compilers */