Skip to content

Commit eda05d7

Browse files
TylerMSFTTylerMSFT
authored andcommitted
acrolinx
1 parent b229eee commit eda05d7

File tree

1 file changed

+14
-14
lines changed
  • docs/c-runtime-library/reference

1 file changed

+14
-14
lines changed

docs/c-runtime-library/reference/cwait.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,43 +29,43 @@ intptr_t _cwait(
2929

3030
### Parameters
3131

32-
*termstat*\
32+
*`termstat`*\
3333
Pointer to a buffer where the result code of the specified process will be stored, or **NULL**.
3434

35-
*procHandle*\
35+
*`procHandle`*\
3636
The handle to the process to wait on (that is, the process that has to terminate before **_cwait** can return).
3737

38-
*action*\
39-
NULL: Ignored by Windows operating system applications; for other applications: action code to perform on *procHandle*.
38+
*`action`*\
39+
`NULL`: Ignored by Windows operating system applications; for other applications: action code to perform on *`procHandle`*.
4040

4141
## Return Value
4242

43-
When the specified process has successfully completed, returns the handle of the specified process and sets *termstat* to the result code that's returned by the specified process. Otherwise, returns -1 and sets **errno** as follows.
43+
When the specified process has successfully completed, returns the handle of the specified process and sets *`termstat`* to the result code that's returned by the specified process. Otherwise, returns -1 and sets **`errno`** as follows.
4444

4545
|Value|Description|
4646
|-----------|-----------------|
47-
|**ECHILD**|No specified process exists, *procHandle* is invalid, or the call to the [GetExitCodeProcess](/windows/win32/api/processthreadsapi/nf-processthreadsapi-getexitcodeprocess) or [WaitForSingleObject](/windows/win32/api/synchapi/nf-synchapi-waitforsingleobject) API failed.|
48-
|**EINVAL**|*action* is invalid.|
47+
|**`ECHILD`**|No specified process exists, *`procHandle`* is invalid, or the call to the [`GetExitCodeProcess`](/windows/win32/api/processthreadsapi/nf-processthreadsapi-getexitcodeprocess) or [`WaitForSingleObject`](/windows/win32/api/synchapi/nf-synchapi-waitforsingleobject) API failed.|
48+
|**`EINVAL`**|*action* is invalid.|
4949

50-
For more information about these and other return codes, see [errno, _doserrno, _sys_errlist, and _sys_nerr](../../c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr.md).
50+
For more information about these and other return codes, see [`errno, _doserrno, _sys_errlist, and _sys_nerr`](../../c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr.md).
5151

5252
## Remarks
5353

54-
The **_cwait** function waits for the termination of the process ID of the specified process that's provided by *procHandle*. The value of *procHandle* that's passed to **_cwait** should be the value that's returned by the call to the [_spawn](../../c-runtime-library/spawn-wspawn-functions.md) function that created the specified process. If the process ID terminates before **_cwait** is called, **_cwait** returns immediately. **_cwait** can be used by any process to wait for any other known process for which a valid handle (*procHandle*) exists.
54+
The **`_cwait`** function waits for the termination of the process ID of the specified process that's provided by *`procHandle`*. The value of *`procHandle`* that's passed to **`_cwait`** should be the value that's returned by the call to the [`_spawn`](../../c-runtime-library/spawn-wspawn-functions.md) function that created the specified process. If the process ID terminates before **`_cwait`** is called, **`_cwait`** returns immediately. **`_cwait`** can be used by any process to wait for any other known process for which a valid handle (*`procHandle`*) exists.
5555

56-
*termstat* points to a buffer where the return code of the specified process will be stored. The value of *termstat* indicates whether the specified process terminated normally by calling the Windows [ExitProcess](/windows/win32/api/processthreadsapi/nf-processthreadsapi-exitprocess) API. **ExitProcess** is called internally if the specified process calls **exit** or **_exit**, returns from **main**, or reaches the end of **main**. For more information about the value that's passed back through *termstat*, see [GetExitCodeProcess](/windows/win32/api/processthreadsapi/nf-processthreadsapi-getexitcodeprocess). If **_cwait** is called by using a **NULL** value for *termstat*, the return code of the specified process is not stored.
56+
*`termstat`* points to a buffer where the return code of the specified process will be stored. The value of *`termstat`* indicates whether the specified process terminated normally by calling the Windows [`ExitProcess`](/windows/win32/api/processthreadsapi/nf-processthreadsapi-exitprocess) API. **`ExitProcess`** is called internally if the specified process calls **`exit`** or **`_exit`**, returns from **`main`**, or reaches the end of **`main`**. For more information about the value that's passed back through *`termstat`*, see [GetExitCodeProcess](/windows/win32/api/processthreadsapi/nf-processthreadsapi-getexitcodeprocess). If **`_cwait`** is called by using a **`NULL`** value for *`termstat`*, the return code of the specified process isn't stored.
5757

58-
The *action* parameter is ignored by the Windows operating system because parent-child relationships are not implemented in these environments.
58+
The *`action`* parameter is ignored by the Windows operating system because parent-child relationships aren't implemented in these environments.
5959

60-
Unless *procHandle* is -1 or -2 (handles to the current process or thread), the handle will be closed. Therefore, in this situation, do not use the returned handle.
60+
Unless *`procHandle`* is -1 or -2 (handles to the current process or thread), the handle will be closed. In this situation, don't use the returned handle.
6161

6262
By default, this function's global state is scoped to the application. To change this, see [Global state in the CRT](../global-state.md).
6363

6464
## Requirements
6565

6666
|Routine|Required header|Optional header|
6767
|-------------|---------------------|---------------------|
68-
|**_cwait**|\<process.h>|\<errno.h>|
68+
|**`_cwait`**|\<process.h>|\<errno.h>|
6969

7070
For more compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md).
7171

@@ -128,7 +128,7 @@ int main(int argc, char* argv[])
128128
}
129129
```
130130
131-
The order of the output will vary from run to run.
131+
The order of the output varies from run to run.
132132
133133
```Output
134134
Hi, Dad. It's Ann.

0 commit comments

Comments
 (0)