Skip to content

Commit 09c1ef4

Browse files
US1907300 - add md code escapes to code elements - PR5
1 parent 7eab8a7 commit 09c1ef4

File tree

9 files changed

+215
-221
lines changed

9 files changed

+215
-221
lines changed

docs/c-runtime-library/low-level-i-o.md

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ description: "Learn more about: Low-Level I/O"
33
title: "Low-Level I/O"
44
ms.date: "11/04/2016"
55
helpviewer_keywords: ["I/O [CRT], low-level", "I/O [CRT], functions", "low-level I/O routines", "file handles [C++]", "file handles [C++], I/O functions"]
6-
ms.assetid: 53e11bdd-6720-481c-8b2b-3a3a569ed534
76
---
87
# Low-Level I/O
98

@@ -13,34 +12,34 @@ Low-level routines can access the standard streams opened at program startup usi
1312

1413
|Stream|File Descriptor|
1514
|------------|---------------------|
16-
|**stdin**|0|
17-
|**stdout**|1|
18-
|**stderr**|2|
15+
|**`stdin`**|0|
16+
|**`stdout`**|1|
17+
|**`stderr`**|2|
1918

20-
Low-level I/O routines set the [errno](../c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr.md) global variable when an error occurs. You must include STDIO.H when you use low-level functions only if your program requires a constant that is defined in STDIO.H, such as the end-of-file indicator (**EOF**).
19+
Low-level I/O routines set the [`errno`](../c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr.md) global variable when an error occurs. You must include `STDIO.H` when you use low-level functions only if your program requires a constant that is defined in `STDIO.H`, such as the end-of-file indicator (**`EOF`**).
2120

2221
## Low-Level I/O Functions
2322

2423
|Function|Use|
2524
|--------------|---------|
26-
|[_close](../c-runtime-library/reference/close.md)|Close file|
27-
|[_commit](../c-runtime-library/reference/commit.md)|Flush file to disk|
28-
|[_creat, _wcreat](../c-runtime-library/reference/creat-wcreat.md)|Create file|
29-
|[_dup](../c-runtime-library/reference/dup-dup2.md)|Return next available file descriptor for given file|
30-
|[_dup2](../c-runtime-library/reference/dup-dup2.md)|Create second descriptor for given file|
31-
|[_eof](../c-runtime-library/reference/eof.md)|Test for end of file|
32-
|[_lseek, _lseeki64](../c-runtime-library/reference/lseek-lseeki64.md)|Reposition file pointer to given location|
33-
|[_open, _wopen](../c-runtime-library/reference/open-wopen.md)|Open file|
34-
|[_read](../c-runtime-library/reference/read.md)|Read data from file|
35-
|[_sopen, _wsopen](../c-runtime-library/reference/sopen-wsopen.md), [_sopen_s, _wsopen_s](../c-runtime-library/reference/sopen-s-wsopen-s.md)|Open file for file sharing|
36-
|[_tell, _telli64](../c-runtime-library/reference/tell-telli64.md)|Get current file-pointer position|
37-
|[_umask](../c-runtime-library/reference/umask.md), [_umask_s](../c-runtime-library/reference/umask-s.md)|Set file-permission mask|
38-
|[_write](../c-runtime-library/reference/write.md)|Write data to file|
39-
40-
**_dup** and **_dup2** are typically used to associate the predefined file descriptors with different files.
25+
|[`_close`](../c-runtime-library/reference/close.md)|Close file|
26+
|[`_commit`](../c-runtime-library/reference/commit.md)|Flush file to disk|
27+
|[`_creat`, `_wcreat`](../c-runtime-library/reference/creat-wcreat.md)|Create file|
28+
|[`_dup`](../c-runtime-library/reference/dup-dup2.md)|Return next available file descriptor for given file|
29+
|[`_dup2`](../c-runtime-library/reference/dup-dup2.md)|Create second descriptor for given file|
30+
|[`_eof`](../c-runtime-library/reference/eof.md)|Test for end of file|
31+
|[`_lseek`, `_lseeki64`](../c-runtime-library/reference/lseek-lseeki64.md)|Reposition file pointer to given location|
32+
|[`_open`, `_wopen`](../c-runtime-library/reference/open-wopen.md)|Open file|
33+
|[`_read`](../c-runtime-library/reference/read.md)|Read data from file|
34+
|[`_sopen`, `_wsopen`](../c-runtime-library/reference/sopen-wsopen.md), [`_sopen_s`, `_wsopen_s`](../c-runtime-library/reference/sopen-s-wsopen-s.md)|Open file for file sharing|
35+
|[`_tell`, `_telli64`](../c-runtime-library/reference/tell-telli64.md)|Get current file-pointer position|
36+
|[`_umask`](../c-runtime-library/reference/umask.md), [`_umask_s`](../c-runtime-library/reference/umask-s.md)|Set file-permission mask|
37+
|[`_write`](../c-runtime-library/reference/write.md)|Write data to file|
38+
39+
**`_dup`** and **`_dup2`** are typically used to associate the predefined file descriptors with different files.
4140

4241
## See also
4342

44-
[Input and Output](../c-runtime-library/input-and-output.md)<br/>
45-
[Universal C runtime routines by category](../c-runtime-library/run-time-routines-by-category.md)<br/>
46-
[System Calls](../c-runtime-library/system-calls.md)<br/>
43+
[Input and Output](../c-runtime-library/input-and-output.md)\
44+
[Universal C runtime routines by category](../c-runtime-library/run-time-routines-by-category.md)\
45+
[System Calls](../c-runtime-library/system-calls.md)

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

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ topic_type: ["apiref"]
99
f1_keywords: ["Abort"]
1010
helpviewer_keywords: ["aborting current process", "abort function", "processes, aborting"]
1111
---
12-
# abort
12+
# `abort`
1313

1414
Aborts the current process and returns an error code.
1515

@@ -24,13 +24,13 @@ void abort( void );
2424
2525
## Return Value
2626
27-
**abort** does not return control to the calling process. By default, it checks for an abort signal handler and raises `SIGABRT` if one is set. Then **abort** terminates the current process and returns an exit code to the parent process.
27+
**`abort`** does not return control to the calling process. By default, it checks for an abort signal handler and raises `SIGABRT` if one is set. Then **`abort`** terminates the current process and returns an exit code to the parent process.
2828
2929
## Remarks
3030
3131
**Microsoft Specific**
3232
33-
By default, when an app is built with the debug runtime library, the **abort** routine displays an error message before `SIGABRT` is raised. For console apps running in console mode, the message is sent to `STDERR`. Windows desktop apps and console apps running in windowed mode display the message in a message box. To suppress the message, use [_set_abort_behavior](set-abort-behavior.md) to clear the `_WRITE_ABORT_MSG` flag. The message displayed depends on the version of the runtime environment used. For applications built by using the most recent versions of Visual C++, the message resembles this:
33+
By default, when an app is built with the debug runtime library, the **`abort`** routine displays an error message before `SIGABRT` is raised. For console apps running in console mode, the message is sent to `STDERR`. Windows desktop apps and console apps running in windowed mode display the message in a message box. To suppress the message, use [`_set_abort_behavior`](set-abort-behavior.md) to clear the `_WRITE_ABORT_MSG` flag. The message displayed depends on the version of the runtime environment used. For applications built by using the most recent versions of Visual C++, the message resembles this:
3434
3535
> R6010 - abort() has been called
3636
@@ -40,11 +40,11 @@ In previous versions of the C runtime library, this message was displayed:
4040
4141
When the program is compiled in debug mode, the message box displays options to **Abort**, **Retry**, or **Ignore**. If the user chooses **Abort**, the program terminates immediately and returns an exit code of 3. If the user chooses **Retry**, a debugger is invoked for just-in-time debugging, if available. If the user chooses **Ignore**, **abort** continues normal processing.
4242
43-
In both retail and debug builds, **abort** then checks whether an abort signal handler is set. If a non-default signal handler is set, **abort** calls `raise(SIGABRT)`. Use the [signal](signal.md) function to associate an abort signal handler function with the `SIGABRT` signal. You can perform custom actions—for example, clean up resources or log information—and terminate the app with your own error code in the handler function. If no custom signal handler is defined, **abort** does not raise the `SIGABRT` signal.
43+
In both retail and debug builds, **`abort`** then checks whether an abort signal handler is set. If a non-default signal handler is set, **`abort`** calls `raise(SIGABRT)`. Use the [`signal`](signal.md) function to associate an abort signal handler function with the `SIGABRT` signal. You can perform custom actions—for example, clean up resources or log information—and terminate the app with your own error code in the handler function. If no custom signal handler is defined, **`abort`** does not raise the `SIGABRT` signal.
4444
45-
By default, in non-debug builds of desktop or console apps, **abort** then invokes the Windows Error Reporting Service mechanism (formerly known as Dr. Watson) to report failures to Microsoft. This behavior can be enabled or disabled by calling `_set_abort_behavior` and setting or masking the `_CALL_REPORTFAULT` flag. When the flag is set, Windows displays a message box that has text something like "A problem caused the program to stop working correctly." The user can choose to invoke a debugger with a **Debug** button, or choose the **Close program** button to terminate the app with an error code that's defined by the operating system.
45+
By default, in non-debug builds of desktop or console apps, **`abort`** then invokes the Windows Error Reporting Service mechanism (formerly known as Dr. Watson) to report failures to Microsoft. This behavior can be enabled or disabled by calling `_set_abort_behavior` and setting or masking the `_CALL_REPORTFAULT` flag. When the flag is set, Windows displays a message box that has text something like "A problem caused the program to stop working correctly." The user can choose to invoke a debugger with a **Debug** button, or choose the **Close program** button to terminate the app with an error code that's defined by the operating system.
4646
47-
If the Windows error reporting handler is not invoked, then **abort** calls [_exit](exit-exit-exit.md) to terminate the process with exit code 3 and returns control to the parent process or the operating system. `_exit` does not flush stream buffers or do `atexit`/`_onexit` processing.
47+
If the Windows error reporting handler is not invoked, then **`abort`** calls [`_exit`](exit-exit-exit.md) to terminate the process with exit code 3 and returns control to the parent process or the operating system. `_exit` does not flush stream buffers or do `atexit`/`_onexit` processing.
4848
4949
For more information about CRT debugging, see [CRT Debugging Techniques](/visualstudio/debugger/crt-debugging-techniques).
5050
@@ -56,7 +56,7 @@ By default, this function's global state is scoped to the application. To change
5656
5757
|Routine|Required header|
5858
|-------------|---------------------|
59-
|**abort**|\<process.h> or \<stdlib.h>|
59+
|**`abort`**|`<process.h>` or `<stdlib.h>`|
6060
6161
## Example
6262
@@ -96,13 +96,13 @@ File could not be opened: No such file or directory
9696

9797
## See also
9898

99-
[Using abort](../../cpp/using-abort.md)<br/>
100-
[abort Function](../../c-language/abort-function-c.md)<br/>
101-
[Process and Environment Control](../../c-runtime-library/process-and-environment-control.md)<br/>
102-
[_exec, _wexec Functions](../../c-runtime-library/exec-wexec-functions.md)<br/>
103-
[exit, _Exit, _exit](exit-exit-exit.md)<br/>
104-
[raise](raise.md)<br/>
105-
[signal](signal.md)<br/>
106-
[_spawn, _wspawn Functions](../../c-runtime-library/spawn-wspawn-functions.md)<br/>
107-
[_DEBUG](../../c-runtime-library/debug.md)<br/>
108-
[_set_abort_behavior](set-abort-behavior.md)
99+
[Using `abort`](../../cpp/using-abort.md)\
100+
[`abort` Function](../../c-language/abort-function-c.md)\
101+
[Process and Environment Control](../../c-runtime-library/process-and-environment-control.md)\
102+
[`_exec`, `_wexec` Functions](../../c-runtime-library/exec-wexec-functions.md)\
103+
[`exit`, `_Exit`, `_exit`](exit-exit-exit.md)\
104+
[`raise`](raise.md)\
105+
[`signal`](signal.md)\
106+
[`_spawn`, `_wspawn` Functions](../../c-runtime-library/spawn-wspawn-functions.md)\
107+
[`_DEBUG`](../../c-runtime-library/debug.md)\
108+
[`_set_abort_behavior`](set-abort-behavior.md)

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

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ api_type: ["DLLExport"]
88
topic_type: ["apiref"]
99
f1_keywords: ["_read"]
1010
helpviewer_keywords: ["data [CRT]", "_read function", "read function", "data [C++], reading", "reading data [C++]", "files [C++], reading"]
11-
ms.assetid: 2ce9c433-57ad-47fe-9ac1-4a7d4c883d30
1211
---
13-
# _read
12+
# `_read`
1413

1514
Reads data from a file.
1615

@@ -26,38 +25,38 @@ int _read(
2625

2726
### Parameters
2827

29-
*fd*<br/>
28+
*`fd`*\
3029
File descriptor referring to the open file.
3130

32-
*buffer*<br/>
31+
*`buffer`*\
3332
Storage location for data.
3433

35-
*buffer_size*<br/>
34+
*`buffer_size`*\
3635
Maximum number of bytes to read.
3736

3837
## Return Value
3938

40-
**_read** returns the number of bytes read, which might be less than *buffer_size* if there are fewer than *buffer_size* bytes left in the file, or if the file was opened in text mode. In text mode, each carriage return-line feed pair `\r\n` is replaced with a single line feed character `\n`. Only the single line feed character is counted in the return value. The replacement does not affect the file pointer.
39+
**`_read`** returns the number of bytes read, which might be less than *`buffer_size`* if there are fewer than *`buffer_size`* bytes left in the file, or if the file was opened in text mode. In text mode, each carriage return-line feed pair `\r\n` is replaced with a single line feed character `\n`. Only the single line feed character is counted in the return value. The replacement does not affect the file pointer.
4140

42-
If the function tries to read at end of file, it returns 0. If *fd* is not valid, the file isn't open for reading, or the file is locked, the invalid parameter handler is invoked, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If execution is allowed to continue, the function returns -1 and sets **errno** to **EBADF**.
41+
If the function tries to read at end of file, it returns 0. If *`fd`* is not valid, the file isn't open for reading, or the file is locked, the invalid parameter handler is invoked, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If execution is allowed to continue, the function returns -1 and sets **`errno`** to **`EBADF`**.
4342

44-
If *buffer* is **NULL**, or if *buffer_size* > **INT_MAX**, the invalid parameter handler is invoked. If execution is allowed to continue, the function returns -1 and **errno** is set to **EINVAL**.
43+
If *`buffer`* is `NULL`, or if *`buffer_size`* > **`INT_MAX`**, the invalid parameter handler is invoked. If execution is allowed to continue, the function returns -1 and **`errno`** is set to **`EINVAL`**.
4544

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

4847
## Remarks
4948

50-
The **_read** function reads a maximum of *buffer_size* bytes into *buffer* from the file associated with *fd*. The read operation begins at the current position of the file pointer associated with the given file. After the read operation, the file pointer points to the next unread character.
49+
The **`_read`** function reads a maximum of *`buffer_size`* bytes into *`buffer`* from the file associated with *`fd`*. The read operation begins at the current position of the file pointer associated with the given file. After the read operation, the file pointer points to the next unread character.
5150

52-
If the file was opened in text mode, the read terminates when **_read** encounters a CTRL+Z character, which is treated as an end-of-file indicator. Use [_lseek](lseek-lseeki64.md) to clear the end-of-file indicator.
51+
If the file was opened in text mode, the read terminates when **`_read`** encounters a CTRL+Z character, which is treated as an end-of-file indicator. Use [`_lseek`](lseek-lseeki64.md) to clear the end-of-file indicator.
5352

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

5655
## Requirements
5756

5857
|Routine|Required header|
5958
|-------------|---------------------|
60-
|**_read**|\<io.h>|
59+
|**`_read`**|`<io.h>`|
6160

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

@@ -120,8 +119,8 @@ Read 19 bytes from file
120119

121120
## See also
122121

123-
[Low-Level I/O](../../c-runtime-library/low-level-i-o.md)<br/>
124-
[_creat, _wcreat](creat-wcreat.md)<br/>
125-
[fread](fread.md)<br/>
126-
[_open, _wopen](open-wopen.md)<br/>
127-
[_write](write.md)<br/>
122+
[Low-Level I/O](../../c-runtime-library/low-level-i-o.md)\
123+
[`_creat`, `_wcreat`](creat-wcreat.md)\
124+
[`fread`](fread.md)\
125+
[`_open`, `_wopen`](open-wopen.md)\
126+
[`_write`](write.md)\

0 commit comments

Comments
 (0)