about summary refs log tree commit diff
path: root/library/std/src/os
AgeCommit message (Collapse)AuthorLines
2025-09-30std: merge address family computationjoboet-5/+5
2025-09-28Rollup merge of #140482 - devnexen:tcp_deferaccept_toduration, r=joboetMatthias Krüger-13/+22
std::net: update tcp deferaccept delay type to Duration. See comment [here](https://github.com/rust-lang/rust/issues/119639#issuecomment-2839330337).
2025-09-27fix build for androidDavid Carlier-0/+1
2025-09-26Update CURRENT_RUSTC_VERSION post-bumpMark Rousskov-1/+1
2025-09-26std::net: update tcp deferaccept delay type to Duration.David Carlier-13/+21
2025-09-19Fix test suite in iOS/tvOS/watchOS/visionOS simulatorMads Marquart-0/+2
2025-09-13initial implementation of the darwin_objc unstable featureJo Bates-0/+15
2025-09-06Rollup merge of #139524 - Berrysoft:cygwin-socket-ext, r=tgross35Trevor Gross-51/+125
Add socket extensions for cygwin r? `@joboet` * Abstract name uds addr * quickack * passcred
2025-09-06Add socket extensions for cygwinBerrysoft-51/+125
2025-09-04Rollup merge of #140459 - niklasf:feature/read-buf-at, r=tgross35Stuart Cook-0/+132
Add `read_buf` equivalents for positioned reads Adds the following items under the ~~`read_buf` (rust-lang/rust#78485)~~ `read_buf_at` (rust-lang/rust#140771) feature: - `std::os::unix::fs::FileExt::read_buf_at` - `std::os::unix::fs::FileExt::read_buf_exact_at` - `std::os::windows::fs::FileExt::seek_read_buf` try-job: `x86_64-msvc*` try-job: `test-various*` try-job: `dist-various*`
2025-09-03Add `read_buf` equivalents for positioned readsNiklas Fiekas-0/+132
Adds the following items under the `read_buf_at` feature: - `std::os::unix::fs::FileExt::read_buf_at` - `std::os::unix::fs::FileExt::read_buf_exact_at` - `std::os::windows::fs::FileExt::seek_read_buf`
2025-08-27Rollup merge of #145335 - clarfonthey:wtf8-core-alloc, r=Mark-SimulacrumMatthias Krüger-4/+34
Move WTF-8 code from std into core and alloc This is basically a small portion of rust-lang/rust#129411 with a smaller scope. It *does not*\* affect any public APIs; this code is still internal to the standard library. It just moves the WTF-8 code into `core` and `alloc` so it can be accessed by `no_std` crates like `backtrace`. > \* The only public API this affects is by adding a `Debug` implementation to `std::os::windows::ffi::EncodeWide`, which was not present before. This is due to the fact that `core` requires `Debug` implementations for all types, but `std` does not (yet) require this. Even though this was ultimately changed to be a wrapper over the original type, not a re-export, I decided to keep the `Debug` implementation so it remains useful. Like we do with ordinary strings, the tests are still located entirely in `alloc`, rather than splitting them into `core` and `alloc`. ---- Reviewer note: for ease of review, this is split into three commits: 1. Moving the original files into their new "locations" 2. Actually modifying the code to compile. 3. Removing aesthetic changes that were made so that the diff for commit 2 was readable. You can review commits 1 and 3 to verify these claims, but commit 2 contains the majority of the changes you should care about. ---- API changes: `impl Debug for std::os::windows::ffi::EncodeWide`
2025-08-20Move WTF-8 code from std to core/allocltdk-4/+34
2025-08-19Fix doc of `std::os::windows::io::BorrowedSocket::borrow_raw`Lorenz Leutgeb-1/+1
A small oversight in 0cb69dec57f I noticed while reading.
2025-08-16library: Migrate from `cfg_if` to `cfg_select`Josh Triplett-10/+12
Migrate the standard library from using the external `cfg_if` crate to using the now-built-in `cfg_select` macro. This does not yet eliminate the dependency from `library/std/Cargo.toml`, because while the standard library itself no longer uses `cfg_if`, it also incorporates the `backtrace` crate, which does. Migration assisted by the following vim command (after selecting the full `cfg_if!` invocation): ``` '<,'>s/\(cfg_if::\)\?cfg_if/cfg_select/ | '<,'>s/^\( *\)} else {/\1}\r\1_ => {/c | '<,'>s/^\( *\)} else if #\[cfg(\(.*\))\] /\1}\r\1\2 => /e | '<,'>s/if #\[cfg(\(.*\))\] {/\1 => {/e ``` This is imperfect, but substantially accelerated the process. This prompts for confirmation on the `} else {` since that can also appear inside one of the arms. This also requires manual intervention to handle any multi-line conditions.
2025-07-11Rollup merge of #142391 - LevitatingBusinessMan:setsid, r=workingjubileeMatthias Krüger-0/+8
rust: library: Add `setsid` method to `CommandExt` trait Add a setsid method to the CommandExt trait so that callers can create a process in a new session and process group whilst still using the POSIX spawn fast path. Tracking issue: rust-lang/rust#105376 ACP: https://github.com/rust-lang/libs-team/issues/184 This PR was previously submitted by ``@HarveyHunt`` (whom I marked as Co-Author in the commit message) in rust-lang/rust#105377. However that PR went stale. I applied the [suggestion](https://github.com/rust-lang/rust/pull/105377/files/231d19fcbfe155b2e85116865adae4253380ff1f#r1893457943) to change the function signature to `fn setsid(&mut self, setsid: bool) -> &mut Command`.
2025-07-10rust: library: Add setsid method to CommandExt traitLevitatingBusinessMan (Rein Fernhout)-0/+8
Add a setsid method to the CommandExt trait so that callers can create a process in a new session and process group whilst still using the POSIX spawn fast path. Co-Authored-By: Harvey Hunt <harveyhunt@fb.com>
2025-07-03setup CI and tidy to use typos for spellchecking and fix few typosklensy-1/+1
2025-07-01Update version placeholdersJosh Stone-8/+8
2025-06-29Rollup merge of #142889 - nabijaczleweli:rusts, r=Mark-SimulacrumMatthias Krüger-7/+5
Clarify doc comment on unix OpenOptions
2025-06-28Rollup merge of #123476 - devnexen:std_net_solaris_exclbind, r=Mark-SimulacrumMatthias Krüger-0/+102
std::net: adding `unix_socket_exclbind` feature for solaris/illumos. allows to have a tigher control over the binding exclusivness of the socket. ACP: https://github.com/rust-lang/libs-team/issues/366
2025-06-28"set by Rusts options". Remove misleading always-true if cfg!(unix). Drop ↵наб-7/+5
#![feature(rustc_private)]
2025-06-24Rollup merge of #140005 - mlowicki:patch-1, r=tgross35Guillaume Gomez-1/+22
Set MSG_NOSIGNAL for UnixStream https://github.com/rust-lang/rust/issues/139956 Same logic as for https://github.com/rust-lang/rust/blob/1f76d219c906f0112bb1872f33aa977164c53fa6/library/std/src/sys/net/connection/socket.rs#L399-L405.
2025-06-20Rollup merge of #141990 - Qelxiros:141975-unix_send_signal, ↵Trevor Gross-0/+38
r=ChrisDenton,tgross35 Implement send_signal for unix child processes Tracking issue: rust-lang/rust#141975 There are two main differences between my implementation and the Public API section of the tracking issue. ~First, `send_signal` requires a mutable reference, like `Child::kill`.~ Second, `ChildExt` has `Sealed` as a supertrait, bringing it more in line with other extension traits like `CommandExt`. try-job: `dist-various*` try-job: `test-various*`
2025-06-18add ChildExt(::send_signal)Jeremy Smart-0/+38
2025-06-16Set MSG_NOSIGNAL for UnixSteamMichał Łowicki-1/+22
https://github.com/rust-lang/rust/issues/139956 fix
2025-06-12Delegate `<SocketAddr as Debug>` to `ByteStr`Tamir Duberstein-4/+14
This allows UTF-8 characters to be printed without escapes, rather than just ASCII.
2025-06-10std::net: adding `unix_socket_exclbind` feature for solaris/illumos.David Carlier-0/+102
allows to have a tigher control over the binding exclusivness of the socket.
2025-06-09Rollup merge of #129121 - devnexen:stabilize_ext_linux_tcp_layer, r=tgross35Matthias Krüger-10/+8
Stabilize `tcp_quickack` to stabilise the quickack part for now, tcp_deferaccept had been added at a later stage. The related API calls are the following ```rust // std::os::linux::net // sealed trait, implemented for std::net::TcpStream pub trait TcpStreamExt: Sealed{ fn quickack(&self) -> io::Result<bool>; fn set_quickack(&self, quickack: bool) -> io::Result<()>; } ``` Closes: https://github.com/rust-lang/rust/issues/96256
2025-06-06Add new Tier-3 targets: `loongarch32-unknown-none*`WANG Rui-0/+1
MCP: https://github.com/rust-lang/compiler-team/issues/865
2025-05-23Rollup merge of #141019 - ehuss:android-doctest-xcompile, r=Mark-SimulacrumMatthias Krüger-0/+15
Update std doctests for android This updates some doctests that fail to run on android. We will soon be supporting cross-compiled doctests, and the `arm-android` job fails to run these tests. In summary: - Android re-exports some traits from linux under a different path. - Android doesn't seem to have common unix utilities like `true`, `false`, or `whoami`, so these are disabled.
2025-05-21Apply suggestions from code reviewJosh Triplett-5/+5
Link `Command::current_dir`. Co-authored-by: Amanieu d'Antras <amanieu@gmail.com>
2025-05-20`CommandExt::chroot`: Add tracking issueJosh Triplett-1/+1
2025-05-20`CommandExt::chroot`: Document difference to underlying `chroot`Josh Triplett-3/+5
2025-05-20Add `std::os::unix::process::CommandExt::chroot` to safely chroot a child ↵Josh Triplett-0/+16
process This adds a `chroot` method to the `CommandExt` extension trait for the `Command` builder, to set a directory to chroot into. This will chroot the child process into that directory right before calling chdir for the `Command`'s working directory. To avoid allowing a process to have a working directory outside of the chroot, if the `Command` does not yet have a working directory set, `chroot` will set its working directory to "/".
2025-05-16Rollup merge of #141013 - federico-terzi:feat/command_startupinfo_windows, ↵Matthias Krüger-0/+36
r=joboet Implement methods to set STARTUPINFO flags for Command API on Windows Implements https://github.com/rust-lang/rust/issues/141010
2025-05-16Rollup merge of #140984 - mlowicki:patch-2, r=ibraheemdevMatthias Krüger-2/+2
fix doc for UnixStream Doc example was using `UdpSocket` instead of `UnixStream`.
2025-05-14Update std doctests for androidEric Huss-0/+15
This updates some doctests that fail to run on android. We will soon be supporting cross-compiled doctests, and the `arm-android` job fails to run these tests. In summary: - Android re-exports some traits from linux under a different path. - Android doesn't seem to have common unix utilities like `true`, `false`, or `whoami`, so these are disabled.
2025-05-14wire up startupinfo methodsFederico Terzi-0/+36
2025-05-13fix doc for UnixStreamMichał Łowicki-2/+2
2025-05-10Remove `stable` attribute from wasi fs (read_exact|write_all)_atPaolo Barbolini-2/+0
2025-04-27use generic Atomic type where possibleChristopher Durham-16/+16
in core/alloc/std only for now, and ignoring test files Co-authored-by: Pavel Grigorenko <GrigorenkoPV@ya.ru>
2025-04-23Impl new API `std::os::unix::fs::mkfifo` under feature `unix_fifo`Jiahao XU-0/+56
Tracking issue #139324 Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2025-04-09replace version placeholderBoxy-24/+24
2025-03-23Trusty: Fix build for anonymous pipes and std::sys::processThalia Archibald-4/+14
PRs #136842 (Add libstd support for Trusty targets), #137793 (Stablize anonymous pipe), and #136929 (std: move process implementations to `sys`) merged around the same time, so update Trusty to take them into account.
2025-03-17Rollup merge of #137793 - NobodyXu:stablise-annoymous-pipe, r=joshtriplettJacob Pratt-1/+171
Stablize anonymous pipe Since #135822 is staled, I create this PR to stablise anonymous pipe Closes #127154 try-job: test-various
2025-03-17Rollup merge of #137621 - Berrysoft:cygwin-std, r=joboetJacob Pratt-2/+122
Add std support to cygwin target
2025-03-14Rollup merge of #136001 - hkBst:patch-21, r=cuviperJacob Pratt-49/+75
Overhaul examples for PermissionsExt This fixes #91707 by including one overarching example, instead of the small examples that can be misleading.
2025-03-14Mv os-specific trait impl of `Pipe*` into `std::os::*`Jiahao XU-1/+171
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2025-03-13Rollup merge of #138162 - ehuss:library-2024, r=cuviperMatthias Krüger-1/+1
Update the standard library to Rust 2024 This updates the standard library to Rust 2024. This includes the following notable changes: - Macros are updated to use new expression fragment specifiers. This PR includes a test to illustrate the changes, primarily allowing `const {...}` expressions now. - Some tests show a change in MIR drop order. We do not believe this will be an observable change ([see zulip discussion](https://rust-lang.zulipchat.com/#narrow/channel/268952-edition/topic/standard.20library.20migration/near/500972873)). Fixes https://github.com/rust-lang/rust/issues/133081