From a0c8d7373311facda78d250751203371cc0487b2 Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Wed, 4 Sep 1996 14:17:43 +0000 Subject: Merge du stage de Pascal Cuoq git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@952 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02 --- otherlibs/win32unix/winwait.c | 47 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 otherlibs/win32unix/winwait.c (limited to 'otherlibs/win32unix/winwait.c') diff --git a/otherlibs/win32unix/winwait.c b/otherlibs/win32unix/winwait.c new file mode 100644 index 0000000000..ac1865cf05 --- /dev/null +++ b/otherlibs/win32unix/winwait.c @@ -0,0 +1,47 @@ +/***********************************************************************/ +/* */ +/* Objective Caml */ +/* */ +/* Pascal Cuoq, projet Cristal, INRIA Rocquencourt */ +/* */ +/* Copyright 1996 Institut National de Recherche en Informatique et */ +/* Automatique. Distributed only by permission. */ +/* */ +/***********************************************************************/ + +/* $Id$ */ + +#include +#include +#include +#include +#include +#include "unixsupport.h" +#include + +static value alloc_process_status(pid, status) + int pid, status; +{ + value st, res; + Push_roots(r, 1); + + + st = alloc(1, 0); + Field(st, 0) = Val_int(status); + + r[0] = st; + res = alloc_tuple(2); + Field(res, 0) = Val_int(pid); + Field(res, 1) = r[0]; + Pop_roots(); + return res; +} + +value win_waitpid(flags, pid_req) + value flags, pid_req; +{ + int status; + if (_cwait(&status,Int_val(pid_req), 0/* ignored by win32 */) == -1) + uerror("waitpid", Nothing); + return alloc_process_status(pid_req, status); +} -- cgit v1.2.1