about summary refs log tree commit diff
path: root/library/std/src/os
AgeCommit message (Collapse)AuthorLines
2023-08-14add a csky-unknown-linux-gnuabiv2 targetDirreke-0/+2
2023-08-14mention /proc/self/fd with /proc/self/memRalf Jung-3/+3
2023-08-14wording; and explain some of the possible consequences of violating io-safetyRalf Jung-2/+2
2023-08-14typosRalf Jung-1/+1
2023-08-14sync the various FromRawFd trait docs, and remove 'valid'Ralf Jung-21/+32
2023-08-13add more explicit I/O safety documentationRalf Jung-9/+22
2023-08-10Rollup merge of #114194 - thomcc:flushinline, r=cuviperMichael Goulet-0/+1
Inline trivial (noop) flush calls At work I noticed that `writer.flush()?` didn't get optimized away in cases where the flush is obviously a no-op, which I had expected (well, desired). I went through and added `#[inline]` to a bunch of cases that were obviously noops, or delegated to ones that were obviously noops. I omitted platforms I don't have access to (some tier3). I didn't do this very scientifically, in cases where it was non-obvious I left `#[inline]` off.
2023-08-05std/tests: disable ancillary tests on freebsd since the feature itself is.David CARLIER-1/+1
2023-07-28inline trivial (noop) flush callsThom Chiovoloni-0/+1
2023-07-26Add definitions for riscv64_linux_android targetChris Wailes-1/+1
2023-07-26Auto merge of #102757 - pcc:android-std-tests, r=workingjubileebors-0/+18
Make std tests pass on newer Android Newer versions of Android forbid the creation of hardlinks as well as Unix domain sockets in the /data filesystem via SELinux rules, which causes several tests depending on this behavior to fail. So let's skip these tests on Android if we see an EACCES from one of these syscalls. To achieve this, introduce a macro with the horrible name of or_panic_or_skip_on_android_eacces (better suggestions welcome) which skips (returns from) the test if an EACCES return value is seen on Android.
2023-07-22Rollup merge of #113876 - darklyspaced:master, r=cuviperMatthias Krüger-1/+30
fix docs & example for `std::os::unix::prelude::FileExt::write_at` Changelog: * used `File::create` instead of `File::read` to get a writeable file * explicity mentioned the bug with `pwrite64` in docs Unfortunately, I don't think that there is really much we can do about this since the feature has already been stabilised. We could potentially add a clippy lint warning people on Linux that using `write_at` with the `O_APPEND` flag does not exhibit the behaviour that they would have assumed. fixes #113627
2023-07-22Rollup merge of #112490 - Alexendoo:c-char-cfg-all, r=cuviperMatthias Krüger-5/+0
Remove `#[cfg(all())]` workarounds from `c_char` Casts to type aliases are now ignored by Clippy https://github.com/rust-lang/rust-clippy/pull/8596 Closes https://github.com/rust-lang/rust-clippy/issues/8093
2023-07-22Auto merge of #113033 - JohnTitor:stabilize-unix-chown, r=cuviperbors-6/+3
Stabilize chown functions (`unix_chown`) Closes #88989 FCP is complete here: https://github.com/rust-lang/rust/issues/88989#issuecomment-1561125635
2023-07-20added a problematic exampledarklyspaced-3/+25
2023-07-20fix docs & example for FileExt::write_atdarklyspaced-1/+8
2023-07-18support for mips32r6 as a target_arch valuechenx97-1/+1
2023-07-18support for mips64r6 as a target_arch valuechenx97-0/+1
2023-07-10Correct the Android stat struct definitionsChris Wailes-47/+58
See https://cs.android.com/android/platform/superproject/+/master:bionic/libc/include/sys/stat.h for reference.
2023-06-25Stabilize chown functions (`unix_chown`)Yuki Okushi-6/+3
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-06-21Update tvOS support elsewhere in the stdlibThom Chiovoloni-1/+7
2023-06-21wip: Support Apple tvOS in libstdThom Chiovoloni-3/+13
2023-06-17Rollup merge of #112352 - dankm:fbsd_doc_fix, r=thomccMatthias Krüger-1/+7
Fix documentation build on FreeBSD After the socket ancillary data implementation was introduced, the documentation build was broken on FreeBSD hosts, add the same workaround as for the existing implementations. Fixes the doc build after #91793
2023-06-16Remove `#[cfg(all())]` workarounds from `c_char`Alex Macleod-5/+0
2023-06-13Fix building the documentation on FreeBSD.MikaelUrankar-0/+1
It fixes the following error: error[E0412]: cannot find type `sockcred2` in module `libc` --> library/std/src/os/unix/net/ancillary.rs:211:29 | 211 | pub struct SocketCred(libc::sockcred2); | ^^^^^^^^^ not found in `libc`
2023-06-06Fix documentation build on FreeBSDDan McGregor-1/+7
After the socket ancillary data implementation was introduced, the build was broken on FreeBSD, add the same workaround as for the existing implementations.
2023-06-05Std support improvement for ps vita targetNikolay Arhipov-1/+1
2023-05-30add doc on From<OwnedFd/Handle> impl for ChildStd*Vincent Thiberville-0/+24
2023-05-30add FromOwnedFd/FromOwnedHandle for ChildStdin/out/errVincent Thiberville-0/+57
2023-05-30Swap out CURRENT_RUSTC_VERSION to 1.71.0Mark Rousskov-6/+6
2023-05-15Add creation time support to `FileTimes` on apple and windowsbeetrees-7/+78
2023-05-14Auto merge of #108196 - sunfishcode:sunfishcode/windows-as-socket-impls, ↵bors-0/+72
r=dtolnay Implement `AsHandle`/`AsSocket` for `Arc`/`Rc`/`Box` on Windows Implement the Windows counterpart to #97437 and #107317: Implement `AsHandle` and `AsSocket` for `Arc<T>`, `Rc<T>`, and `Box<T>`.
2023-05-09Don't force include Windows goop when documentingChris Denton-34/+40
2023-05-09Auto merge of #110152 - ChrisDenton:windows-sys, r=thomccbors-1/+1
Start using `windows sys` for Windows FFI bindings in std Switch to using windows-sys for FFI. In order to avoid some currently contentious issues, this uses windows-bindgen to generate a smaller set of bindings instead of using the full crate. Unlike the windows-sys crate, the generated bindings uses `*mut c_void` for handle types instead of `isize`. This to sidestep opsem concerns about mixing pointer types and integers between languages. Note that `SOCKET` remains defined as an integer but instead of being a usize, it's changed to fit the [standard library definition](https://github.com/rust-lang/rust/blob/a41fc00eaf352541008965fec0dee811e44373b3/library/std/src/os/windows/raw.rs#L12-L16): ```rust #[cfg(target_pointer_width = "32")] pub type SOCKET = u32; #[cfg(target_pointer_width = "64")] pub type SOCKET = u64; ``` The generated bindings also customizes the `#[link]` imports. I hope to switch to using raw-dylib but I don't want to tie that too closely with the switch to windows-sys. --- Changes outside of the bindings are, for the most part, fairly minimal (e.g. some differences in `*mut` vs. `*const` or a few types differ). One issue is that our own bindings sometimes mix in higher level types, like `BorrowedHandle`. This is pretty adhoc though.
2023-05-08Rollup merge of #110638 - nikarh:vita, r=Mark-SimulacrumYuki Okushi-0/+175
STD support for PSVita This PR adds std support for `armv7-sony-vita-newlibeabihf` target. The work here is fairly similar to #95897, just for a different target platform. This depends on the following pull requests: rust-lang/backtrace-rs#523 rust-lang/libc#3209
2023-05-08Auto merge of #106621 - ozkanonur:enable-elided-lifetimes-for-doctests, ↵bors-1/+1
r=Mark-Simulacrum enable `rust_2018_idioms` lint group for doctests With this change, `rust_2018_idioms` lint group will be enabled for compiler/libstd doctests. Resolves #106086 Resolves #99144 Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-05-07PS Vita std supportNikolay Arhipov-0/+175
2023-05-07enable `rust_2018_idioms` for doctestsozkanonur-1/+1
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-05-05Use new bindingsChris Denton-1/+1
2023-05-01Inline AsRawFd implementationsKonrad Borowski-0/+1
2023-05-01Inline AsInner implementationsKonrad Borowski-0/+1
2023-04-28replace version placeholdersPietro Albini-17/+17
2023-04-27Auto merge of #110562 - ComputerDruid:riscv, r=tmandrybors-0/+6
Add definitions for riscv64gc-unknown-fuchsia To compile, also requires a libc update with https://github.com/rust-lang/libc/pull/3204
2023-04-26Spelling library/Josh Soref-2/+2
* advance * aligned * borrowed * calculate * debugable * debuggable * declarations * desugaring * documentation * enclave * ignorable * initialized * iterator * kaboom * monomorphization * nonexistent * optimizer * panicking * process * reentrant * rustonomicon * the * uninitialized Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-25Add definitions for riscv64gc-unknown-fuchsiaDan Johnson-0/+6
2023-04-13Rollup merge of #110072 - joshtriplett:stabilize-is-terminal, r=Mark-SimulacrumMatthias Krüger-2/+2
Stabilize IsTerminal FCP completed in https://github.com/rust-lang/rust/issues/98070 . closes: https://github.com/rust-lang/rust/issues/98070
2023-04-11Rollup merge of #96971 - zhaixiaojuan:master, r=wesleywiserMichael Goulet-0/+1
Initial support for loongarch64-unknown-linux-gnu Hi, We hope to add a new port in rust for LoongArch. LoongArch intro LoongArch is a RISC style ISA which is independently designed by Loongson Technology in China. It is divided into two versions, the 32-bit version (LA32) and the 64-bit version (LA64). LA64 applications have application-level backward binary compatibility with LA32 applications. LoongArch is composed of a basic part (Loongson Base) and an expanded part. The expansion part includes Loongson Binary Translation (LBT), Loongson VirtualiZation (LVZ), Loongson SIMD EXtension (LSX) and Loongson Advanced SIMD EXtension(LASX). Currently the LA464 processor core supports LoongArch ISA and the Loongson 3A5000 processor integrates 4 64-bit LA464 cores. LA464 is a four-issue 64-bit high-performance processor core. It can be used as a single core for high-end embedded and desktop applications, or as a basic processor core to form an on-chip multi-core system for server and high-performance machine applications. Documentations: ISA: https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html ABI: https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html More docs can be found at: https://loongson.github.io/LoongArch-Documentation/README-EN.html Since last year, we have locally adapted two versions of rust, rust1.41 and rust1.57, and completed the test locally. I'm not sure if I'm submitting all the patches at once, so I split up the patches and here's one of the commits
2023-04-10Stabilize IsTerminalJosh Triplett-2/+2
closes: https://github.com/rust-lang/rust/issues/98070
2023-04-04library/std: Add support for loongarch64zhaixiaojuan-0/+1
2023-04-02Fix typo in std/src/os/fd/owned.rsTaiki Endo-1/+1