You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Terminates a thread; **_endthread** terminates a thread that's created by **_beginthread** and **_endthreadex** terminates a thread that's created by **_beginthreadex**.
14
+
Terminates a thread; **`_endthread`** terminates a thread that's created by **`_beginthread`** and **`_endthreadex`** terminates a thread that's created by **`_beginthreadex`**.
16
15
17
16
## Syntax
18
17
@@ -25,31 +24,31 @@ void _endthreadex(
25
24
26
25
### Parameters
27
26
28
-
*retval*<br/>
27
+
*`retval`*\
29
28
Thread exit code.
30
29
31
30
## Remarks
32
31
33
-
You can call **_endthread** or **_endthreadex** explicitly to terminate a thread; however, **_endthread** or **_endthreadex** is called automatically when the thread returns from the routine passed as a parameter to **_beginthread** or **_beginthreadex**. Terminating a thread with a call to **endthread** or **_endthreadex** helps ensure proper recovery of resources allocated for the thread.
32
+
You can call **`_endthread`** or **`_endthreadex`** explicitly to terminate a thread; however, **`_endthread`** or **`_endthreadex`** is called automatically when the thread returns from the routine passed as a parameter to **`_beginthread`** or **`_beginthreadex`**. Terminating a thread with a call to **`endthread`** or **`_endthreadex`** helps ensure proper recovery of resources allocated for the thread.
34
33
35
34
> [!NOTE]
36
-
> For an executable file linked with Libcmt.lib, do not call the Win32 [ExitThread](/windows/win32/api/processthreadsapi/nf-processthreadsapi-exitthread) API; this prevents the run-time system from reclaiming allocated resources. **_endthread** and **_endthreadex** reclaim allocated thread resources and then call **ExitThread**.
35
+
> For an executable file linked with Libcmt.lib, do not call the Win32 [`ExitThread`](/windows/win32/api/processthreadsapi/nf-processthreadsapi-exitthread) API; this prevents the run-time system from reclaiming allocated resources. **`_endthread`** and **`_endthreadex`** reclaim allocated thread resources and then call **`ExitThread`**.
37
36
38
-
**_endthread** automatically closes the thread handle. (This behavior differs from the Win32 **ExitThread** API.) Therefore, when you use **_beginthread** and **_endthread**, do not explicitly close the thread handle by calling the Win32 [CloseHandle](/windows/win32/api/handleapi/nf-handleapi-closehandle) API.
37
+
**`_endthread`** automatically closes the thread handle. (This behavior differs from the Win32 **`ExitThread`** API.) Therefore, when you use **`_beginthread`** and **`_endthread`**, don't explicitly close the thread handle by calling the Win32 [`CloseHandle`](/windows/win32/api/handleapi/nf-handleapi-closehandle) API.
39
38
40
-
Like the Win32 **ExitThread** API, **_endthreadex**does not close the thread handle. Therefore, when you use **_beginthreadex** and **_endthreadex**, you must close the thread handle by calling the Win32 **CloseHandle** API.
39
+
Like the Win32 **`ExitThread`** API, **`_endthreadex`**doesn't close the thread handle. Therefore, when you use **`_beginthreadex`** and **`_endthreadex`**, you must close the thread handle by calling the Win32 **`CloseHandle`** API.
41
40
42
41
> [!NOTE]
43
-
> **_endthread** and **_endthreadex** cause C++ destructors pending in the thread not to be called.
42
+
> **`_endthread`** and **`_endthreadex`** cause C++ destructors pending in the thread not to be called.
44
43
45
44
By default, this function's global state is scoped to the application. To change this, see [Global state in the CRT](../global-state.md).
46
45
47
46
## Requirements
48
47
49
48
|Function|Required header|
50
49
|--------------|---------------------|
51
-
|**_endthread**|\<process.h>|
52
-
|**_endthreadex**|\<process.h>|
50
+
|**`_endthread`**|`<process.h>`|
51
+
|**`_endthreadex`**|`<process.h>`|
53
52
54
53
For more compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md).
55
54
@@ -59,9 +58,9 @@ Multithreaded versions of the [C run-time libraries](../../c-runtime-library/crt
59
58
60
59
## Example
61
60
62
-
See the example for [_beginthread](beginthread-beginthreadex.md).
61
+
See the example for [`_beginthread`](beginthread-beginthreadex.md).
63
62
64
63
## See also
65
64
66
-
[Process and Environment Control](../../c-runtime-library/process-and-environment-control.md)<br/>
Returns 0 if the file-status information is obtained. A return value of -1 indicates an error. If the file descriptor is invalid or *buffer* is **NULL**, the invalid parameter handler is invoked, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If execution is allowed to continue, **errno** is set to **EBADF**, in the case of an invalid file descriptor, or to **EINVAL**, if *buffer* is **NULL**.
55
+
Returns 0 if the file-status information is obtained. A return value of -1 indicates an error. If the file descriptor is invalid or *`buffer`* is **`NULL`**, the invalid parameter handler is invoked, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If execution is allowed to continue, **`errno`** is set to **`EBADF`**, in the case of an invalid file descriptor, or to **`EINVAL`**, if *`buffer`* is **`NULL`**.
57
56
58
57
## Remarks
59
58
60
-
The **_fstat** function obtains information about the open file associated with *fd* and stores it in the structure pointed to by *buffer*. The **_stat** structure, defined in SYS\Stat.h, contains the following fields.
59
+
The **`_fstat`** function obtains information about the open file associated with *`fd`* and stores it in the structure pointed to by *`buffer`*. The **`_stat`** structure, defined in `SYS\Stat.h`, contains the following fields.
61
60
62
61
|Field|Meaning|
63
62
|-|-|
64
-
|**st_atime**| Time of the last file access. |
65
-
|**st_ctime**| Time of the creation of the file. |
66
-
|**st_dev**| If a device, *fd*; otherwise 0. |
67
-
|**st_mode**| Bit mask for file-mode information. The **_S_IFCHR** bit is set if *fd* refers to a device. The **_S_IFREG** bit is set if *fd* refers to an ordinary file. The read/write bits are set according to the file's permission mode. **_S_IFCHR** and other constants are defined in SYS\Stat.h. |
68
-
|**st_mtime**| Time of the last modification of the file. |
69
-
|**st_nlink**| Always 1 on non-NTFS file systems. |
70
-
|**st_rdev**| If a device, *fd*; otherwise 0. |
71
-
|**st_size**| Size of the file in bytes. |
63
+
|**`st_atime`**| Time of the last file access. |
64
+
|**`st_ctime`**| Time of the creation of the file. |
65
+
|**`st_dev`**| If a device, *`fd`*; otherwise 0. |
66
+
|**`st_mode`**| Bit mask for file-mode information. The **`_S_IFCHR`** bit is set if *`fd`* refers to a device. The **`_S_IFREG`** bit is set if *`fd`* refers to an ordinary file. The read/write bits are set according to the file's permission mode. **`_S_IFCHR`** and other constants are defined in `SYS\Stat.h`. |
67
+
|**`st_mtime`**| Time of the last modification of the file. |
68
+
|**`st_nlink`**| Always 1 on non-NTFS file systems. |
69
+
|**`st_rdev`**| If a device, *`fd`*; otherwise 0. |
70
+
|**`st_size`**| Size of the file in bytes. |
72
71
73
-
If *fd* refers to a device, the **st_atime**, **st_ctime**, **st_mtime**, and **st_size** fields are not meaningful.
72
+
If *`fd`* refers to a device, the **`st_atime`**, **`st_ctime`**, **`st_mtime`**, and **`st_size`** fields aren't meaningful.
74
73
75
-
Because Stat.h uses the [_dev_t](../../c-runtime-library/standard-types.md) type, which is defined in Types.h, you must include Types.h before Stat.h in your code.
74
+
Because `Stat.h` uses the [`_dev_t`](../../c-runtime-library/standard-types.md) type, which is defined in `Types.h`, you must include `Types.h` before `Stat.h` in your code.
76
75
77
-
**_fstat64**, which uses the **__stat64** structure, allows file-creation dates to be expressed up through 23:59:59, December 31, 3000, UTC; whereas the other functions only represent dates through 23:59:59 January 18, 2038, UTC. Midnight, January 1, 1970, is the lower bound of the date range for all these functions.
76
+
**`_fstat64`**, which uses the **`__stat64`** structure, allows file-creation dates to be expressed up through 23:59:59, December 31, 3000, UTC; whereas the other functions only represent dates through 23:59:59 January 18, 2038, UTC. Midnight, January 1, 1970, is the lower bound of the date range for all these functions.
78
77
79
-
Variations of these functions support 32-bit or 64-bit time types and 32-bit or 64-bit file lengths. The first numerical suffix (**32** or **64**) indicates the size of the time type used; the second suffix is either **i32** or **i64**, indicating whether the file size is represented as a 32-bit or 64-bit integer.
78
+
Variations of these functions support 32-bit or 64-bit time types and 32-bit or 64-bit file lengths. The first numerical suffix (**32** or **64**) indicates the size of the time type used; the second suffix is either **`i32`** or **`i64`**, indicating whether the file size is represented as a 32-bit or 64-bit integer.
80
79
81
-
**_fstat** is equivalent to **_fstat64i32**, and **`struct`****_stat** contains a 64-bit time. This is true unless **_USE_32BIT_TIME_T** is defined, in which case the old behavior is in effect; **_fstat** uses a 32-bit time, and **`struct`****_stat** contains a 32-bit time. The same is true for **_fstati64**.
80
+
**`_fstat`** is equivalent to **`_fstat64i32`**, and **`struct`****`_stat`** contains a 64-bit time. This is true unless **`_USE_32BIT_TIME_T`** is defined, in which case the old behavior is in effect; **`_fstat`** uses a 32-bit time, and **`struct`****`_stat`** contains a 32-bit time. The same is true for **`_fstati64`**.
82
81
83
82
By default, this function's global state is scoped to the application. To change this, see [Global state in the CRT](../global-state.md).
84
83
85
-
### Time Type and File Length Type Variations of _stat
84
+
### Time Type and File Length Type Variations of `_stat`
Copy file name to clipboardExpand all lines: docs/c-runtime-library/reference/mkgmtime-mkgmtime32-mkgmtime64.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ A quantity of type **`__time32_t`** or **`__time64_t`** representing the number
40
40
41
41
The **`_mkgmtime32`** and **`_mkgmtime64`** functions convert a UTC time to a **`__time32_t`** or **`__time64_t`** type representing the time in UTC. To convert a local time to UTC time, use **`mktime`**, **`_mktime32`**, and **`_mktime64`** instead.
42
42
43
-
**_mkgmtime** is an inline function that evaluates to **`_mkgmtime64`**, and **`time_t`** is equivalent to **`__time64_t`**. If you need to force the compiler to interpret **`time_t`** as the old 32-bit **`time_t`**, you can define **`_USE_32BIT_TIME_T`**. We don't recommend it, because your application might fail after January 18, 2038, the maximum range of a 32-bit **`time_t`**. It's not allowed at all on 64-bit platforms.
43
+
**`_mkgmtime`** is an inline function that evaluates to **`_mkgmtime64`**, and **`time_t`** is equivalent to **`__time64_t`**. If you need to force the compiler to interpret **`time_t`** as the old 32-bit **`time_t`**, you can define **`_USE_32BIT_TIME_T`**. We don't recommend it, because your application might fail after January 18, 2038, the maximum range of a 32-bit **`time_t`**. It's not allowed at all on 64-bit platforms.
44
44
45
45
The time structure passed in is changed as follows, in the same way as it's changed by the **`_mktime`** functions: the **`tm_wday`** and **`tm_yday`** fields are set to new values based on the values of **`tm_mday`** and **`tm_year`**. Because the time is assumed to be UTC, the **`tm_isdst`** field is ignored.
0 commit comments