[Ecls-list] Port waitpid to windows?

Goffioul Michael goffioul at imec.be
Mon Nov 26 09:21:46 UTC 2007


> Hi Michael (or anybody else who knows the stuff),
> 
> could you complete the code for EXT:RUN-PROGRAM? I have 
> implemented a new option, :WAIT, which tells the function for 
> a process to finish.
> In Linux I implemented it using waitpid. I do not know how to 
> do the same in Windows.

What you have to do is (I cannot check myself as I'm not using
ECL currently)
- not close the process handle pr_info.hProcess (this probably
means adding a top-level variable to store it, let's call it
childHandle)
- use something like:

int status; /* just in case you'd need the exit status */
WaitForSingleObject(childHandle, INFINITE);
/* skip the following if you don't care about the exist status */
GetExitCodeProcess(childHandle, (LPDWORD)&status);
CloseHandle(childHandle);

Michael.




More information about the ecl-devel mailing list