| Age | Commit message (Collapse) | Author | Lines |
|
|
|
std::net: update tcp deferaccept delay type to Duration.
See comment [here](https://github.com/rust-lang/rust/issues/119639#issuecomment-2839330337).
|
|
|
|
|
|
|
|
|
|
|
|
Add socket extensions for cygwin
r? `@joboet`
* Abstract name uds addr
* quickack
* passcred
|
|
|
|
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*`
|
|
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`
|
|
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`
|
|
|
|
A small oversight in 0cb69dec57f I noticed while reading.
|
|
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.
|
|
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`.
|
|
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>
|
|
|
|
|
|
Clarify doc comment on unix OpenOptions
|
|
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
|
|
#![feature(rustc_private)]
|
|
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.
|
|
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*`
|
|
|
|
https://github.com/rust-lang/rust/issues/139956
fix
|
|
This allows UTF-8 characters to be printed without escapes, rather than
just ASCII.
|
|
allows to have a tigher control over the binding exclusivness of the
socket.
|
|
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
|
|
MCP: https://github.com/rust-lang/compiler-team/issues/865
|
|
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.
|
|
Link `Command::current_dir`.
Co-authored-by: Amanieu d'Antras <amanieu@gmail.com>
|
|
|
|
|
|
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 "/".
|
|
r=joboet
Implement methods to set STARTUPINFO flags for Command API on Windows
Implements https://github.com/rust-lang/rust/issues/141010
|
|
fix doc for UnixStream
Doc example was using `UdpSocket` instead of `UnixStream`.
|
|
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.
|
|
|
|
|
|
|
|
in core/alloc/std only for now, and ignoring test files
Co-authored-by: Pavel Grigorenko <GrigorenkoPV@ya.ru>
|
|
Tracking issue #139324
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
|
|
|
|
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.
|
|
Stablize anonymous pipe
Since #135822 is staled, I create this PR to stablise anonymous pipe
Closes #127154
try-job: test-various
|
|
Add std support to cygwin target
|
|
Overhaul examples for PermissionsExt
This fixes #91707 by including one overarching example, instead of the small examples that can be misleading.
|
|
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
|
|
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
|