From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id CAA13161; Thu, 7 Aug 2003 02:21:45 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 CAA12194 for ; Thu, 7 Aug 2003 02:21:43 +0200 (MET DST) Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h770LgT25752 for ; Thu, 7 Aug 2003 02:21:42 +0200 (MET DST) Received: from localhost (suiren.kurims.kyoto-u.ac.jp [130.54.16.25]) by kurims.kurims.kyoto-u.ac.jp (8.9.3p2/3.7W) with ESMTP id JAA10767; Thu, 7 Aug 2003 09:21:37 +0900 (JST) To: j.scott@runbox.com Cc: caml-list@inria.fr Subject: Re: [Caml-list] Unix.kill on Win32 In-Reply-To: <000201c35c17$2cefc4a0$0300a8c0@James> References: <000201c35c17$2cefc4a0$0300a8c0@James> X-Mailer: Mew version 1.94.2 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20030807092137N.garrigue@kurims.kyoto-u.ac.jp> Date: Thu, 07 Aug 2003 09:21:37 +0900 From: Jacques Garrigue X-Dispatcher: imput version 20000228(IM140) X-Loop: caml-list@inria.fr X-Spam: no; 0.00; jacques:01 caml-list:01 runbox:99 32,:01 api:01 ocamlrun:01 dynamically:01 dlls:01 ctrl-c:01 garrigue:01 unix:02 thread:02 module:03 suppose:03 receiving:96 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk From: "James Scott" > Would it be possible/sensible to have some limited implementation of > Unix.kill for Win32, so that 'kill pid 9' or 'kill pid 15' worked for > example? I may be wrong, but when I looked at the problem about 5 years ago, I couldn't find any way to act on a windows process from outside it. The process manager must be using some internal API. The only solution I found for ocamlbrowser is to have ocamlrun create a special thread waiting on a pipe, and break when receiving C on this pipe, and commit suicide when receiving T! This only works if you can modify the source of the process you want to kill, so this cannot be in the Unix module. Now, as it seems that you can dynamically change the dlls a running process is accessing, I suppose you could also do it without the source code, if you're a guru. By the way, the comment in the microsoft documentation about Ctrl-C handlers being activated in another thread in console applications let me think that this is more or less the standard way to do it on windows :-( I hope I am wrong. Jacques Garrigue ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners