]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/ocaml/contrib/otherlibs/unix/execve.c
Inital import
[l4.git] / l4 / pkg / ocaml / contrib / otherlibs / unix / execve.c
1 /***********************************************************************/
2 /*                                                                     */
3 /*                           Objective Caml                            */
4 /*                                                                     */
5 /*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         */
6 /*                                                                     */
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.  */
11 /*                                                                     */
12 /***********************************************************************/
13
14 /* $Id: execve.c 4144 2001-12-07 13:41:02Z xleroy $ */
15
16 #include <mlvalues.h>
17 #include <memory.h>
18 #include "unixsupport.h"
19
20 extern char ** cstringvect();
21
22 CAMLprim value unix_execve(value path, value args, value env)
23 {
24   char ** argv;
25   char ** envp;
26   argv = cstringvect(args);
27   envp = cstringvect(env);
28   (void) execve(String_val(path), argv, envp);
29   stat_free((char *) argv);
30   stat_free((char *) envp);
31   uerror("execve", path);
32   return Val_unit;                  /* never reached, but suppress warnings */
33                                 /* from smart compilers */
34 }
35