Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Unix.kill on Win32
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-08-07 (00:21)
From: Jacques Garrigue <garrigue@k...>
Subject: Re: [Caml-list] Unix.kill on Win32
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 Archives:
Bug reports: FAQ:
Beginner's list: