|
6 | 6 | //!
|
7 | 7 | //! This module provides three types for representing file descriptors,
|
8 | 8 | //! with different ownership properties: raw, borrowed, and owned, which are
|
9 |
| -//! analogous to types used for representing pointers. These types reflect the Unix version of [I/O safety]. |
| 9 | +//! analogous to types used for representing pointers. These types reflect concepts of [I/O |
| 10 | +//! safety][io-safety] on Unix. |
10 | 11 | //!
|
11 | 12 | //! | Type | Analogous to |
|
12 | 13 | //! | ------------------ | ------------ |
|
|
17 | 18 | //! Like raw pointers, `RawFd` values are primitive values. And in new code,
|
18 | 19 | //! they should be considered unsafe to do I/O on (analogous to dereferencing
|
19 | 20 | //! them). Rust did not always provide this guidance, so existing code in the
|
20 |
| -//! Rust ecosystem often doesn't mark `RawFd` usage as unsafe. Once the |
21 |
| -//! `io_safety` feature is stable, libraries will be encouraged to migrate, |
| 21 | +//! Rust ecosystem often doesn't mark `RawFd` usage as unsafe. |
| 22 | +//! Libraries are encouraged to migrate, |
22 | 23 | //! either by adding `unsafe` to APIs that dereference `RawFd` values, or by
|
23 | 24 | //! using to `BorrowedFd` or `OwnedFd` instead.
|
24 | 25 | //!
|
|
54 | 55 | //! Like boxes, `OwnedFd` values conceptually own the resource they point to,
|
55 | 56 | //! and free (close) it when they are dropped.
|
56 | 57 | //!
|
| 58 | +//! See the [`io` module docs][io-safety] for a general explanation of I/O safety. |
| 59 | +//! |
57 | 60 | //! ## `/proc/self/mem` and similar OS features
|
58 | 61 | //!
|
59 | 62 | //! Some platforms have special files, such as `/proc/self/mem`, which
|
|
74 | 77 | //! necessary to use *sandboxing*, which is outside the scope of `std`.
|
75 | 78 | //!
|
76 | 79 | //! [`BorrowedFd<'a>`]: crate::os::unix::io::BorrowedFd
|
77 |
| -//! [I/O safety]: crate::io#io-safety |
| 80 | +//! [io-safety]: crate::io#io-safety |
78 | 81 |
|
79 | 82 | #![stable(feature = "rust1", since = "1.0.0")]
|
80 | 83 |
|
|
0 commit comments