| Age | Commit message (Collapse) | Author | Lines |
|
|
|
remove useless mut from examples
remove useless mut from examples
|
|
This allows using most delay loaded functions before the init code initializes them. It also only preloads a select few functions, rather than all functions.
Co-Authored-By: Mark Rousskov <mark.simulacrum@gmail.com>
|
|
Implement `fs::get_path` for FreeBSD.
Using `F_KINFO` fcntl flag, the kf_structsize field
needs to be set beforehand for that effect.
|
|
|
|
Using `F_KINFO` fcntl flag, the kf_structsize field
needs to be set beforehand for that effect.
|
|
kmc-solid: Use `libc::abort` to abort a program
This PR updates the target-specific abort subroutine for the [`*-kmc-solid_*`](https://doc.rust-lang.org/nightly/rustc/platform-support/kmc-solid.html) Tier 3 targets.
The current implementation uses a `hlt` instruction, which is the most direct way to notify a connected debugger but is not the most flexible way. This PR changes it to call the `abort` libc function, making it possible for a system designer to override its behavior as they see fit.
|
|
protect `std::io::Take::limit` from overflow in `read`
Resolves #94981
|
|
|
|
|
|
|
|
The implementation of BufReader contains a lot of redundant checks.
While any one of these checks is not particularly expensive to execute,
especially when taken together they dramatically inhibit LLVM's ability
to make subsequent optimizations.
|
|
|
|
Add cgroupv1 support to available_parallelism
Fixes #97549
My dev machine uses cgroup v2 so I was only able to test that code path. So the v1 code path is written only based on documentation. I could use some help testing that it works on a machine with cgroups v1:
```
$ x.py build --stage 1
# quota.rs
fn main() {
println!("{:?}", std::thread::available_parallelism());
}
# assuming stage1 is linked in rustup
$ rust +stage1 quota.rs
# spawn a new cgroup scope for the current user
$ sudo systemd-run -p CPUQuota="300%" --uid=$(id -u) -tdS
# should print Ok(3)
$ ./quota
```
If it doesn't work as expected an strace, the contents of `/proc/self/cgroups` and the structure of `/sys/fs/cgroups` would help.
|
|
Co-authored-by: Josh Triplett <josh@joshtriplett.org>
|
|
Some language settings can result in unreliable UTF-8 being produced.
This can result in failing to emit the error string, panicking instead.
from_lossy_utf8 allows us to assume these strings usually will be fine.
|
|
Redox doesn't appear to support `UTIME_OMIT`, so we can't set file times
individually.
|
|
|
|
Fix the stable version of `AsFd for Arc<T>` and `Box<T>`
These merged in #97437 for 1.64.0, apart from the main `io_safety`
feature that stabilized in 1.63.0.
|
|
std: use futex-based locks on Fuchsia
This switches `Condvar` and `RwLock` to the futex-based implementation currently used on Linux and some BSDs. Additionally, `Mutex` now has its own, priority-inheriting implementation based on the mutex in Fuchsia's `libsync`. It differs from the original in that it panics instead of aborting when reentrant locking is detected.
````@rustbot```` ping fuchsia
r? ````@m-ou-se````
|
|
|
|
These merged in #97437 for 1.64.0, apart from the main `io_safety`
feature that stabilized in 1.63.0.
|
|
|
|
stdlib support for Apple WatchOS
This is a follow-up to https://github.com/rust-lang/rust/pull/95243 (Add Apple WatchOS compiler targets) that adds stdlib support for Apple WatchOS.
`@deg4uss3r`
`@nagisa`
|
|
|
|
Windows: Use `FindFirstFileW` for getting the metadata of locked system files
Fixes #96980
Usually opening a file handle with access set to metadata only will always succeed, even if the file is locked. However some special system files, such as `C:\hiberfil.sys`, are locked by the system in a way that denies even that. So as a fallback we try reading the cached metadata from the directory.
Note that the test is a bit iffy. I don't know if `hiberfil.sys` actually exists in the CI.
r? rust-lang/libs
|
|
* Reduce duplicate impls; show only the `fn (T)` and include a sentence
saying that there exists up to twelve of them.
* Show `Copy` and `Clone`.
* Show auto traits like `Send` and `Sync`, and blanket impls like `Any`.
|
|
The file it's testing does not exist in the CI environment.
|
|
|
|
The attribute is also renamed `fake_variadic`.
|
|
|
|
|
|
add tracking issue to generic member access APIs
Missed as part of https://github.com/rust-lang/rust/pull/98072
|
|
r=joshtriplett
Document and stabilize process_set_process_group
Tracking issue: https://github.com/rust-lang/rust/issues/93857
FCP finished here: https://github.com/rust-lang/rust/issues/93857#issuecomment-1179551697
|
|
Implement `fmt::Write` for `OsString`
This allows to format into an `OsString` without unnecessary
allocations. E.g.
```
let mut temp_filename = path.into_os_string();
write!(&mut temp_filename, ".tmp.{}", process::id());
```
|
|
|
|
Explain PGID 0, and provide the acronym PGID.
|
|
|
|
r=Mark-Simulacrum
Stabilize `core::ffi::CStr`, `alloc::ffi::CString`, and friends
Stabilize the `core_c_str` and `alloc_c_string` feature gates.
Change `std::ffi` to re-export these types rather than creating type
aliases, since they now have matching stability.
|
|
Fix typo in mod.rs
constuct -> construct
|
|
Add std::fs::write documentation precision
Fixes #97947.
As mentioned in #97947, the documentation is updated
|
|
r=yaahc
Add new unstable API `downcast` to `std::io::Error`
https://github.com/rust-lang/libs-team/issues/57
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
|
|
|
|
|
|
Stabilize the `core_c_str` and `alloc_c_string` feature gates.
Change `std::ffi` to re-export these types rather than creating type
aliases, since they now have matching stability.
|
|
Just return `io::ErrorKind::Unsupported` instead.
|
|
futimens requires Android API level 19, and std still supports older API
levels.
|
|
This would otherwise silently ignore the attempt, since 0 serves as a
flag to not set a timestamp.
|
|
|
|
Add `struct FileTimes` to contain the relevant file timestamps, since
most platforms require setting all of them at once. (This also allows
for future platform-specific extensions such as setting creation time.)
Add `File::set_file_time` to set the timestamps for a `File`.
Implement the `sys` backends for UNIX, macOS (which needs to fall back
to `futimes` before macOS 10.13 because it lacks `futimens`), Windows,
and WASI.
|