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
Copy file name to clipboardExpand all lines: docs/c-runtime-library/reference/execve-wexecve.md
+11-5Lines changed: 11 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -45,25 +45,31 @@ Array of pointers to environment settings.
45
45
46
46
## Return Value
47
47
48
-
If successful, these functions do not return to the calling process. A return value of -1 indicates an error, in which case the **errno** global variable is set.
48
+
If successful, these functions don't return to the calling process. A return value of -1 indicates an error, in which case the **errno** global variable is set.
49
49
50
50
|**errno** value|Description|
51
51
|-------------------|-----------------|
52
52
|**E2BIG**|The space required for the arguments and environment settings exceeds 32 KB.|
53
53
|**EACCES**|The specified file has a locking or sharing violation.|
54
54
|**EINVAL**|Invalid parameter.|
55
-
|**EMFILE**|Too many files open (the specified file must be opened to determine whether it is executable).|
55
+
|**EMFILE**|Too many files open (the specified file must be opened to determine whether it's executable).|
56
56
|**ENOENT**|The file or path not found.|
57
-
|**ENOEXEC**|The specified file is not executable or has an invalid executable-file format.|
58
-
|**ENOMEM**|Not enough memory is available to execute the new process; the available memory has been corrupted; or an invalid block exists, indicating that the calling process was not allocated properly.|
57
+
|**ENOEXEC**|The specified file isn't executable or has an invalid executable-file format.|
58
+
|**ENOMEM**|Not enough memory is available to execute the new process; the available memory has been corrupted; or an invalid block exists, indicating that the calling process wasn't allocated properly.|
59
59
60
60
For more information about these and other return codes, see [_doserrno, errno, _sys_errlist, and _sys_nerr](../../c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr.md).
61
61
62
62
## Remarks
63
63
64
64
Each of these functions loads and executes a new process, passing an array of pointers to command-line arguments and an array of pointers to environment settings.
65
65
66
-
**_execve** and **_wexecve** validate their parameters. If *cmdname* is a null pointer, or if *argv* is a null pointer, pointer to an empty array, or if the array contains an empty string as the first argument, these functions invoke the invalid parameter handler as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If execution is allowed to continue, these functions set **errno** to **EINVAL** and return -1. No process is launched.
66
+
**_execve** and **_wexecve** validate their parameters. These functions invoke the invalid parameter handler, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md), when:
67
+
68
+
-*cmdname* is a null pointer,
69
+
-*argv* is either a null pointer or pointer to an empty array,
70
+
- the array contains an empty string as the first argument.
71
+
72
+
If execution is allowed to continue by the handler, these functions set **errno** to **EINVAL**, and return -1. No process is launched.
67
73
68
74
By default, this function's global state is scoped to the application. To change this behavior, see [Global state in the CRT](../global-state.md).
Copy file name to clipboardExpand all lines: docs/c-runtime-library/reference/execvp-wexecvp.md
+11-5Lines changed: 11 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -40,25 +40,31 @@ Array of pointers to parameters.
40
40
41
41
## Return Value
42
42
43
-
If successful, these functions do not return to the calling process. A return value of -1 indicates an error, in which case the **errno** global variable is set.
43
+
If successful, these functions don't return to the calling process. A return value of -1 indicates an error, in which case the **errno** global variable is set.
44
44
45
45
|**errno** value|Description|
46
46
|-------------------|-----------------|
47
47
|**E2BIG**|The space required for the arguments and environment settings exceeds 32 KB.|
48
48
|**EACCES**|The specified file has a locking or sharing violation.|
49
49
|**EINVAL**|Invalid parameter.|
50
-
|**EMFILE**|Too many files open (the specified file must be opened to determine whether it is executable).|
50
+
|**EMFILE**|Too many files open (the specified file must be opened to determine whether it's executable).|
51
51
|**ENOENT**|The file or path not found.|
52
-
|**ENOEXEC**|The specified file is not executable or has an invalid executable-file format.|
53
-
|**ENOMEM**|Not enough memory is available to execute the new process; the available memory has been corrupted; or an invalid block exists, indicating that the calling process was not allocated properly.|
52
+
|**ENOEXEC**|The specified file isn't executable or has an invalid executable-file format.|
53
+
|**ENOMEM**|Not enough memory is available to execute the new process; the available memory has been corrupted; or an invalid block exists, indicating that the calling process wasn't allocated properly.|
54
54
55
55
For more information about these and other return codes, see [_doserrno, errno, _sys_errlist, and _sys_nerr](../../c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr.md).
56
56
57
57
## Remarks
58
58
59
59
Each of these functions loads and executes a new process, passing an array of pointers to command-line arguments and using the **PATH** environment variable to find the file to execute.
60
60
61
-
The **_execvp** functions validate their parameters. If the *cmdname* is a null pointer, or *argv* is a null pointer, pointer to an empty array, or if the array contains an empty string as the first argument, these functions invoke the invalid parameter handler as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If execution is allowed to continue, these functions set **errno** to **EINVAL** and return -1. No process is launched.
61
+
The **_execvp** functions validate their parameters. These functions invoke the invalid parameter handler, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md), when:
62
+
63
+
-*cmdname* is a null pointer,
64
+
-*argv* is either a null pointer or pointer to an empty array,
65
+
- the array contains an empty string as the first argument.
66
+
67
+
If execution is allowed to continue by the handler, these functions set **errno** to **EINVAL**, and return -1. No process is launched.
62
68
63
69
By default, this function's global state is scoped to the application. To change this behavior, see [Global state in the CRT](../global-state.md).
Copy file name to clipboardExpand all lines: docs/c-runtime-library/reference/execvpe-wexecvpe.md
+12-6Lines changed: 12 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -45,24 +45,30 @@ Array of pointers to environment settings.
45
45
46
46
## Return Value
47
47
48
-
If successful, these functions do not return to the calling process. A return value of -1 indicates an error, in which case the **errno** global variable is set.
48
+
If successful, these functions don't return to the calling process. A return value of -1 indicates an error, in which case the **errno** global variable is set.
49
49
50
50
|**errno** value|Description|
51
51
|-------------------|-----------------|
52
52
|**E2BIG**|The space that's required for the arguments and environment settings exceeds 32 KB.|
53
53
|**EACCES**|The specified file has a locking or sharing violation.|
54
-
|**EMFILE**|Too many files are open. (The specified file must be opened to determine whether it is executable.)|
55
-
|**ENOENT**|The file or path is not found.|
56
-
|**ENOEXEC**|The specified file is not executable or has an invalid executable-file format.|
57
-
|**ENOMEM**|Not enough memory is available to execute the new process; the available memory has been corrupted; or an invalid block exists, which indicates that the calling process was not allocated correctly.|
54
+
|**EMFILE**|Too many files are open. (The specified file must be opened to determine whether it's executable.)|
55
+
|**ENOENT**|The file or path isn't found.|
56
+
|**ENOEXEC**|The specified file isn't executable or has an invalid executable-file format.|
57
+
|**ENOMEM**|Not enough memory is available to execute the new process; the available memory has been corrupted; or an invalid block exists, which indicates that the calling process wasn't allocated correctly.|
58
58
59
59
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).
60
60
61
61
## Remarks
62
62
63
63
Each of these functions loads and executes a new process, and passes an array of pointers to command-line arguments and an array of pointers to environment settings. These functions use the **PATH** environment variable to find the file to execute.
64
64
65
-
The **_execvpe** functions validate their parameters. If the *cmdname* is a null pointer, or if *argv* is a null pointer, a pointer to an empty array, or a pointer to an array that contains an empty string as the first argument, these functions invoke the invalid parameter handler, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If execution is allowed to continue, these functions set **errno** to **EINVAL** and return -1. No process is launched.
65
+
The **_execvpe** functions validate their parameters. These functions invoke the invalid parameter handler, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md), when:
66
+
67
+
-*cmdname* is a null pointer,
68
+
-*argv* is either a null pointer or pointer to an empty array,
69
+
- the array contains an empty string as the first argument.
70
+
71
+
If execution is allowed to continue by the handler, these functions set **errno** to **EINVAL**, and return -1. No process is launched.
66
72
67
73
By default, this function's global state is scoped to the application. To change this behavior, see [Global state in the CRT](../global-state.md).
Copy file name to clipboardExpand all lines: docs/c-runtime-library/reference/exit-exit-exit.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ Exit status code.
39
39
40
40
The **`exit`**, **`_Exit`** and **`_exit`** functions terminate the calling process. The **`exit`** function calls destructors for thread-local objects, then calls—in last-in-first-out (LIFO) order—the functions that are registered by **`atexit`** and **`_onexit`**, and then flushes all file buffers before it terminates the process. The **`_Exit`** and **`_exit`** functions terminate the process without destroying thread-local objects or processing **`atexit`** or **`_onexit`** functions, and without flushing stream buffers.
41
41
42
-
Although the **`exit`**, **`_Exit`** and **`_exit`** calls do not return a value, the value in *`status`* is made available to the host environment or waiting calling process, if one exists, after the process exits. Typically, the caller sets the *`status`* value to 0 to indicate a normal exit, or to some other value to indicate an error. The *`status`* value is available to the operating-system batch command **`ERRORLEVEL`** and is represented by one of two constants: **`EXIT_SUCCESS`**, which represents a value of 0, or **`EXIT_FAILURE`**, which represents a value of 1.
42
+
Although the **`exit`**, **`_Exit`** and **`_exit`** calls don't return a value, the value in *`status`* is made available to the host environment or waiting calling process, if one exists, after the process exits. Typically, the caller sets the *`status`* value to 0 to indicate a normal exit, or to some other value to indicate an error. The *`status`* value is available to the operating-system batch command **`ERRORLEVEL`** and is represented by one of two constants: **`EXIT_SUCCESS`**, which represents a value of 0, or **`EXIT_FAILURE`**, which represents a value of 1.
43
43
44
44
The **`exit`**, **`_Exit`**, **`_exit`**, **`quick_exit`**, **`_cexit`**, and **`_c_exit`** functions behave as follows.
45
45
@@ -49,10 +49,10 @@ The **`exit`**, **`_Exit`**, **`_exit`**, **`quick_exit`**, **`_cexit`**, and **
49
49
|**`_Exit`**|Performs minimal C library termination procedures, terminates the process, and provides the supplied status code to the host environment.|
50
50
|**`_exit`**|Performs minimal C library termination procedures, terminates the process, and provides the supplied status code to the host environment.|
51
51
|**`quick_exit`**|Performs quick C library termination procedures, terminates the process, and provides the supplied status code to the host environment.|
52
-
|**`_cexit`**|Performs complete C library termination procedures and returns to the caller. Does not terminate the process.|
53
-
|**`_c_exit`**|Performs minimal C library termination procedures and returns to the caller. Does not terminate the process.|
52
+
|**`_cexit`**|Performs complete C library termination procedures and returns to the caller. Doesn't terminate the process.|
53
+
|**`_c_exit`**|Performs minimal C library termination procedures and returns to the caller. Doesn't terminate the process.|
54
54
55
-
When you call the **`exit`**, **`_Exit`** or **`_exit`** function, the destructors for any temporary or automatic objects that exist at the time of the call are not called. An automatic object is a non-static local object defined in a function. A temporary object is an object that's created by the compiler, such as a value returned by a function call. To destroy an automatic object before you call **`exit`**, **`_Exit`**, or **`_exit`**, explicitly call the destructor for the object, as shown here:
55
+
When you call the **`exit`**, **`_Exit`** or **`_exit`** function, the destructors for any temporary or automatic objects that exist at the time of the call aren't called. An automatic object is a non-static local object defined in a function. A temporary object is an object that's created by the compiler, such as a value returned by a function call. To destroy an automatic object before you call **`exit`**, **`_Exit`**, or **`_exit`**, explicitly call the destructor for the object, as shown here:
56
56
57
57
```cpp
58
58
voidlast_fn() {}
@@ -63,7 +63,7 @@ void last_fn() {}
63
63
}
64
64
```
65
65
66
-
Do not use **`DLL_PROCESS_ATTACH`** to call **`exit`** from **`DllMain`**. To exit the **`DLLMain`** function, return **`FALSE`** from **`DLL_PROCESS_ATTACH`**.
66
+
Don't use **`DLL_PROCESS_ATTACH`** to call **`exit`** from **`DllMain`**. To exit the **`DLLMain`** function, return **`FALSE`** from **`DLL_PROCESS_ATTACH`**.
67
67
68
68
By default, this function's global state is scoped to the application. To change this behavior, see [Global state in the CRT](../global-state.md).
0 commit comments