1996-09-04 07:17:43 -07:00
|
|
|
/***********************************************************************/
|
|
|
|
/* */
|
|
|
|
/* Objective Caml */
|
|
|
|
/* */
|
|
|
|
/* Xavier Leroy and Pascal Cuoq, projet Cristal, INRIA Rocquencourt */
|
|
|
|
/* */
|
|
|
|
/* Copyright 1996 Institut National de Recherche en Informatique et */
|
|
|
|
/* Automatique. Distributed only by permission. */
|
|
|
|
/* */
|
|
|
|
/***********************************************************************/
|
|
|
|
|
|
|
|
/* $Id$ */
|
|
|
|
|
|
|
|
#include <mlvalues.h>
|
|
|
|
#include <memory.h>
|
|
|
|
#include <alloc.h>
|
|
|
|
#include "unixsupport.h"
|
|
|
|
#include <process.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
1997-03-11 02:38:06 -08:00
|
|
|
value win_system(cmd) /* ML */
|
1996-09-04 07:17:43 -07:00
|
|
|
value cmd;
|
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
value st;
|
|
|
|
|
|
|
|
enter_blocking_section();
|
|
|
|
_flushall();
|
1996-09-05 06:32:25 -07:00
|
|
|
ret = system(String_val(cmd));;
|
1996-09-04 07:17:43 -07:00
|
|
|
leave_blocking_section();
|
|
|
|
if (ret == -1) uerror("system", Nothing);
|
1996-09-05 06:32:25 -07:00
|
|
|
st = alloc(1, 0); /* Tag 0: Exited */
|
1996-09-04 07:17:43 -07:00
|
|
|
Field(st, 0) = Val_int(ret);
|
|
|
|
return st;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|