From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id D43D2BB81 for ; Thu, 11 Nov 2004 13:54:59 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iABCsx2N011576 for ; Thu, 11 Nov 2004 13:54:59 +0100 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id NAA10711 for ; Thu, 11 Nov 2004 13:54:59 +0100 (MET) Received: from paris.dvs1.informatik.tu-darmstadt.de (paris.dvs1.informatik.tu-darmstadt.de [130.83.166.129]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iABCswcS011565 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 11 Nov 2004 13:54:58 +0100 Received: by paris.dvs1.informatik.tu-darmstadt.de (Postfix, from userid 11060) id 2C8334EB63; Thu, 11 Nov 2004 13:54:58 +0100 (CET) Date: Thu, 11 Nov 2004 13:54:57 +0100 From: "Wesley W. Terpstra" To: caml-list@inria.fr Subject: Re: Patch: kill() undex win32 Message-ID: <20041111125455.GA5958@muffin> References: <20041111104847.GA5087@muffin> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="ZGiS0Q5IWpPtfppv" Content-Disposition: inline In-Reply-To: <20041111104847.GA5087@muffin> User-Agent: Mutt/1.5.6+20040722i X-Miltered: at nez-perce with ID 41936123.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 41936122.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; tu-darmstadt:01 wrote:01 otherlibs:01 makefile:01 otherlibs:01 makefile:01 mkdir:01 sendrecv:01 sockopt:01 unixsupport:01 windir:01 winwait:01 unixsupport:01 windir:01 winwait:01 X-Attachments: name="ocaml-win32-terminate.patch" X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.0 X-Spam-Level: --ZGiS0Q5IWpPtfppv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Nov 11, 2004 at 11:48:49AM +0100, Wesley W. Terpstra wrote: > ... so I cannot test this patch (is there a free licence for it?). I can, however, find some bugs. The parameters were backwards, this patch is better. -- Wesley W. Terpstra --ZGiS0Q5IWpPtfppv Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="ocaml-win32-terminate.patch" diff -uN otherlibs/win32unix.orig/Makefile.nt otherlibs/win32unix/Makefile.nt --- otherlibs/win32unix.orig/Makefile.nt 2004-05-30 10:17:06.000000000 +0200 +++ otherlibs/win32unix/Makefile.nt 2004-11-11 11:34:58.000000000 +0100 @@ -30,7 +30,7 @@ mkdir.c open.c pipe.c read.c rename.c \ select.c sendrecv.c \ shutdown.c sleep.c socket.c sockopt.c startup.c stat.c \ - system.c unixsupport.c windir.c winwait.c write.c + system.c unixsupport.c windir.c winwait.c winkill.c write.c # Files from the ../unix directory UNIX_FILES = access.c addrofstr.c chdir.c chmod.c cst2constr.c \ diff -uN otherlibs/win32unix.orig/unix.ml otherlibs/win32unix/unix.ml --- otherlibs/win32unix.orig/unix.ml 2004-06-22 19:18:50.000000000 +0200 +++ otherlibs/win32unix/unix.ml 2004-11-11 11:40:45.000000000 +0100 @@ -385,7 +385,8 @@ | F_TRLOCK external lockf : file_descr -> lock_command -> int -> unit = "unix_lockf" -let kill pid signo = invalid_arg "Unix.kill not implemented" +external kill : int -> int -> unit = "win_killpid" + type sigprocmask_command = SIG_SETMASK | SIG_BLOCK | SIG_UNBLOCK let sigprocmask cmd sigs = invalid_arg "Unix.sigprocmask not implemented" let sigpending () = invalid_arg "Unix.sigpending not implemented" diff -uN otherlibs/win32unix.orig/winkill.c otherlibs/win32unix/winkill.c --- otherlibs/win32unix.orig/winkill.c 1970-01-01 01:00:00.000000000 +0100 +++ otherlibs/win32unix/winkill.c 2004-11-11 11:33:50.000000000 +0100 @@ -0,0 +1,33 @@ +/***********************************************************************/ +/* */ +/* Objective Caml */ +/* */ +/* Pascal Cuoq and Xavier Leroy, projet Cristal, INRIA Rocquencourt */ +/* */ +/* Copyright 1996 Institut National de Recherche en Informatique et */ +/* en Automatique. All rights reserved. This file is distributed */ +/* under the terms of the GNU Library General Public License, with */ +/* the special exception on linking described in file ../../LICENSE. */ +/* */ +/***********************************************************************/ + +/* $Id: winwait.c,v 1.14 2002/06/07 09:49:41 xleroy Exp $ */ + +#include +#include +#include +#include +#include "unixsupport.h" +#include + +CAMLprim value win_killpid(value vpid_req, value sig) +{ + /* we ignore the passed signal */ + HANDLE pid_req = (HANDLE) Long_val(vpid_req); + + if (! TerminateProcess(pid_req, 0x80)) { + win32_maperr(GetLastError()); + uerror("killpid", Nothing); + } + return Val_unit; +} --ZGiS0Q5IWpPtfppv--