about summary refs log tree commit diff
path: root/library/std/src/os/unix
AgeCommit message (Collapse)AuthorLines
2025-09-30std: merge address family computationjoboet-5/+5
2025-09-19Fix test suite in iOS/tvOS/watchOS/visionOS simulatorMads Marquart-0/+2
2025-09-06Rollup merge of #139524 - Berrysoft:cygwin-socket-ext, r=tgross35Trevor Gross-47/+103
Add socket extensions for cygwin r? `@joboet` * Abstract name uds addr * quickack * passcred
2025-09-06Add socket extensions for cygwinBerrysoft-47/+103
2025-09-04Rollup merge of #140459 - niklasf:feature/read-buf-at, r=tgross35Stuart Cook-0/+89
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/+89
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-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-06-29Rollup merge of #142889 - nabijaczleweli:rusts, r=Mark-SimulacrumMatthias Krüger-7/+5
Clarify doc comment on unix OpenOptions
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-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 #140984 - mlowicki:patch-2, r=ibraheemdevMatthias Krüger-2/+2
fix doc for UnixStream Doc example was using `UdpSocket` instead of `UnixStream`.
2025-05-13fix doc for UnixStreamMichał Łowicki-2/+2
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-03-17Rollup merge of #137621 - Berrysoft:cygwin-std, r=joboetJacob Pratt-2/+10
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-10Fix building for cygwin王宇逸-0/+1
2025-03-10Initial STD support for Cygwin王宇逸-2/+9
Signed-off-by: Ookiineko <chiisaineko@protonmail.com>
2025-03-06library: Use size_of from the prelude instead of importedThalia Archibald-10/+9
Use `std::mem::{size_of, size_of_val, align_of, align_of_val}` from the prelude instead of importing or qualifying them. These functions were added to all preludes in Rust 1.80.
2025-02-07std: get rid of `sys_common::io`joboet-3/+3
2025-01-27Overhaul examples for PermissionsExtMarijn Schouten-49/+75
This fixes #91707 by including one overarching example, instead of the small examples that can be misleading.
2024-11-28Rollup merge of #129409 - grinapo:patch-1, r=AmanieuGuillaume Gomez-0/+5
Expand std::os::unix::fs::chown() doc with a warning Include warning about losing setuid/gid when chowning, per POSIX. It is about the underlying system call but it is rather useful to mention it in the help in case someone accidentally forgets (don't look at me :)).
2024-11-26std: update internal uses of `io::const_error!`joboet-4/+4
2024-11-14Remove one stray space.Peter Gervai-1/+1
2024-11-04docs: fix grammar in doc comment at unix/process.rsNotWearingPants-1/+1
2024-11-03Auto merge of #123723 - madsmtm:apple-std-os, r=dtolnaybors-1/+1
Make `std::os::darwin` public I'm not sure of the reasoning behind them not being public before, but I think they should be, just like `std::os::ios` and `std::os::macos` are public. Additionally, I've merged their source code, as it was otherwise just a bunch of unnecessary duplication. Ultimately, I've done this PR to fix `./x build library --target=aarch64-apple-tvos,aarch64-apple-watchos,aarch64-apple-visionos`, as that currently fails because of dead code warnings. Since you reviewed https://github.com/rust-lang/rust/pull/121419 r? davidtwco Fixes https://github.com/rust-lang/rust/issues/121640. `@rustbot` label O-tvos O-watchos O-visionos
2024-10-25library: consistently use American spelling for 'behavior'Ralf Jung-1/+1
2024-10-17Add must_use to CommandExt::execCallum Ryan-0/+1
2024-09-27Rollup merge of #130861 - cuviper:sun-path-offset, r=ibraheemdevGuillaume Gomez-12/+9
Use `mem::offset_of!` for `sockaddr_un.sun_path` We don't need manual pointer math here anymore! try-job: dist-i686-msvc
2024-09-26Add `sun_path` to the fake doc `sockaddr_un`Josh Stone-1/+3
2024-09-25Use `&raw` in the standard libraryJosh Stone-20/+16
Since the stabilization in #127679 has reached stage0, 1.82-beta, we can start using `&raw` freely, and even the soft-deprecated `ptr::addr_of!` and `ptr::addr_of_mut!` can stop allowing the unstable feature. I intentionally did not change any documentation or tests, but the rest of those macro uses are all now using `&raw const` or `&raw mut` in the standard library.
2024-09-25Use `mem::offset_of!` for `sockaddr_un.sun_path`Josh Stone-11/+6
2024-09-24Initial std library support for NuttXHuang Qi-0/+2
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-10/+10
2024-09-19[Clippy] Swap `non_octal_unix_permissions` to use diagnostic item instead of ↵GnomedDev-0/+1
path
2024-09-07Auto merge of #129941 - BoxyUwU:bump-boostrap, r=albertlarsan68bors-5/+1
Bump boostrap compiler to new beta Accidentally left some comments on the update cfgs commit directly xd
2024-09-05update cfgsBoxy-5/+1
2024-09-03Port std library to RTEMSJan Sommer-0/+2
2024-08-22Update chown help with a link and adding cap warningPeter Gervai-1/+2
Linked to chown(2) manpage on the web which expands on chown call behaviour.
2024-08-22Expand std::os::unix::fs::chown() doc with a warningPeter Gervai-0/+4
Include warning about losing setuid/gid when chowning, per POSIX.