Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: "Wesley W. Terpstra" <terpstra@gkec.tu-darmstadt.de>
To: caml-list@inria.fr
Subject: Re: Patch: kill() undex win32
Date: Thu, 11 Nov 2004 13:54:57 +0100	[thread overview]
Message-ID: <20041111125455.GA5958@muffin> (raw)
In-Reply-To: <20041111104847.GA5087@muffin>

[-- Attachment #1: Type: text/plain, Size: 247 bytes --]

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

[-- Attachment #2: ocaml-win32-terminate.patch --]
[-- Type: text/plain, Size: 2865 bytes --]

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 <windows.h>
+#include <mlvalues.h>
+#include <alloc.h>
+#include <memory.h>
+#include "unixsupport.h"
+#include <sys/types.h>
+
+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;
+}

  reply	other threads:[~2004-11-11 12:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-11 10:48 Wesley W. Terpstra
2004-11-11 12:54 ` Wesley W. Terpstra [this message]
2004-11-11 23:42   ` [Caml-list] " Christopher A. Watford
2004-11-12  1:07     ` Wesley W. Terpstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041111125455.GA5958@muffin \
    --to=terpstra@gkec.tu-darmstadt.de \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox