4 * This file contains a collection of utility procedures that
5 * are present in Tcl's Windows core but not in the generic
6 * core. For example, they do file manipulation and process
9 * Copyright (c) 1994-1996 Sun Microsystems, Inc.
11 * See the file "license.terms" for information on usage and redistribution
12 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
14 * SCCS: @(#) tclWinUtil.c 1.9 96/01/16 10:31:48
22 *----------------------------------------------------------------------
26 * Does the waitpid system call.
29 * Returns return value of pid it's waiting for.
34 *----------------------------------------------------------------------
38 Tcl_WaitPid(pid, statPtr, options)
46 if (options & WNOHANG) {
51 ret = WaitForSingleObject((HANDLE)pid, flags);
52 if (ret == WAIT_TIMEOUT) {
55 } else if (ret != WAIT_FAILED) {
56 GetExitCodeProcess((HANDLE)pid, (DWORD*)statPtr);
57 *statPtr = ((*statPtr << 8) & 0xff00);
58 CloseHandle((HANDLE)pid);