mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-17 09:23:05 +00:00
Be more precise about mmap
and undefined behavior.
`mmap` doesn't *always* cause undefined behavior; it depends on the details of how you use it.
This commit is contained in:
parent
1f8a450cdd
commit
6b4dbdbf47
@ -32,9 +32,9 @@
|
||||
//! other code using that file descriptor.
|
||||
//! This list doesn't include `mmap`, since `mmap` does do a proper borrow of
|
||||
//! its file descriptor argument. That said, `mmap` is unsafe for other
|
||||
//! reasons: it operates on raw pointers, and it has undefined behavior if the
|
||||
//! underlying storage is mutated. Mutations may come from other processes, or
|
||||
//! from the same process if the API provides `BorrowedFd` access, since as
|
||||
//! reasons: it operates on raw pointers, and it can have undefined behavior if
|
||||
//! the underlying storage is mutated. Mutations may come from other processes,
|
||||
//! or from the same process if the API provides `BorrowedFd` access, since as
|
||||
//! mentioned earlier, `BorrowedFd` values may be used in APIs which provide
|
||||
//! safe access to any system call. Consequently, code using `mmap` and
|
||||
//! presenting a safe API must take full responsibility for ensuring that safe
|
||||
|
Loading…
Reference in New Issue
Block a user