about summary refs log tree commit diff
path: root/library/std/src/os
AgeCommit message (Collapse)AuthorLines
2024-09-11chore: remove struct detailsJulius Liu-2/+2
2024-09-11docs: remove struct infoJulius Liu-1/+1
2024-09-09chore: removing supporting links in favor of existing doc-comment styleJulius Liu-13/+6
2024-09-09maint: update docs for change_time ext and doc linksJulius Liu-9/+20
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/+415
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.
2024-08-22Rollup merge of #128432 - g0djan:godjan/wasi_prohibit_implicit_unsafe, ↵Matthias Krüger-2/+2
r=tgross35 WASI: forbid `unsafe_op_in_unsafe_fn` for `std::{os, sys}` Part of https://github.com/rust-lang/rust/issues/127747 for WASI try-job: test-various
2024-08-15proposal to expand (a subset of) linux specific socket capabilities.David Carlier-10/+8
to stabilise the quickack part for now, tcp_deferaccept had been added at a later stage.
2024-08-14CommandExt::before_exec: deprecate safety in edition 2024Ralf Jung-3/+11
2024-08-13Make `std::os::darwin` publicMads Marquart-15/+37
This includes `std::os::darwin::fs`, which is re-exported under `std::os::macos::fs` and `std::os::ios::fs`. `std::os::darwin::raw` is not exposed, which means that `MetadataExt::as_raw_stat` isn't available on tvOS, visionOS and watchOS.
2024-08-07Rollup merge of #128539 - biabbas:deny_unsafe, r=workingjubileeMatthias Krüger-0/+1
Forbid unused unsafe in vxworks-specific std modules Tracking issue #127747 Adding deny(unsafe_op_in_unsafe_fn) in VxWorks specific files did not cause any error. Most of VxWorks falls back on Unix libraries. So we'll have to wait for Unix changes. r? ```@workingjubilee```
2024-08-05WASI fixing unsafe_op_in_unsafe_fn for std::{os, sys}Georgii Rylov-2/+2
2024-08-03Rollup merge of #127586 - zachs18:more-must-use, r=cuviperMatthias Krüger-0/+4
Add `#[must_use]` to some `into_raw*` functions. cc #121287 r? ``@cuviper`` Adds `#[must_use = "losing the pointer will leak memory"]`[^1] to `Box::into_raw(_with_allocator)`, `Vec::into_raw_parts(_with_alloc)`, `String::into_raw_parts`[^2], and `rc::{Rc, Weak}::into_raw_with_allocator` (Rc's normal `into_raw` and all of `Arc`'s `into_raw*`s are already `must_use`). Adds `#[must_use = "losing the raw <resource name may leak resources"]` to `IntoRawFd::into_raw_fd`, `IntoRawSocket::into_raw_socket`, and `IntoRawHandle::into_raw_handle`. [^1]: "*will* leak memory" may be too-strong wording (since `Box`/`Vec`/`String`/`rc::Weak` might not have a backing allocation), but I left it as-is for simplicity and consistency. [^2]: `String::into_raw_parts`'s `must_use` message is changed from the previous (possibly misleading) "`self` will be dropped if the result is not used".
2024-08-03Forbid unsafe_op_in_unsafe_fn in vxworks specific os and sys filesB I Mohammed Abbas-0/+1
2024-08-01fix(os/hermit): `deny(unsafe_op_in_unsafe_fn)`Martin Kröning-0/+1
Signed-off-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
2024-07-30Rollup merge of #128315 - zetanumbers:psvita-unsafe-in-unsafe, r=workingjubileeMatthias Krüger-37/+1
Fix vita build of std and forbid unsafe in unsafe in the os/vita module See #127747 r? `@workingjubilee` `@pheki` `@nikarh`
2024-07-29Reformat `use` declarations.Nicholas Nethercote-146/+101
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-28Add forbid(unsafe_op_in_unsafe_fn)Daria Sukhonina-0/+1
2024-07-28Rollup merge of #127765 - bitfield:fix_stdlib_doc_nits, r=dtolnayGuillaume Gomez-83/+92
Fix doc nits Many tiny changes to stdlib doc comments to make them consistent (for example "Returns foo", rather than "Return foo"), adding missing periods, paragraph breaks, backticks for monospace style, and other minor nits.
2024-07-28fix: psvita's std codeDaria Sukhonina-37/+0
2024-07-27[illumos/solaris] set MSG_NOSIGNAL while writing to socketsRain-0/+4
Both these platforms have MSG_NOSIGNAL available, and we should set it for socket writes in the event that the SIGPIPE handler has been reset to SIG_DFL (i.e. terminate the process). I've verified via a quick program at https://github.com/sunshowers/msg-nosignal-test/ that even when the SIGPIPE handler is reset to SIG_DFL, writes to closed sockets now error out with EPIPE. (Under ordinary circumstances UDP writes won't cause MSG_NOSIGNAL.)
2024-07-26Fix doc nitsJohn Arundel-83/+92
Many tiny changes to stdlib doc comments to make them consistent (for example "Returns foo", rather than "Return foo", per RFC1574), adding missing periods, paragraph breaks, backticks for monospace style, and other minor nits. https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md#appendix-a-full-conventions-text
2024-07-24Rollup merge of #127733 - GrigorenkoPV:don't-forget, r=AmanieuMatthias Krüger-17/+8
Replace some `mem::forget`'s with `ManuallyDrop` > but I would like to see a larger effort to replace all uses of `mem::forget`. _Originally posted by `@saethlin` in https://github.com/rust-lang/rust/issues/127584#issuecomment-2226087767_ So, r? `@saethlin` Sorry, I have finished writing all of this before I got your response.
2024-07-24Rollup merge of #127480 - biabbas:vxworks, r=workingjubileeMatthias Krüger-1/+1
Fix build failure on vxworks #127084 PR to address issue #127084 . 1. Skip `reset_segpipe` for vxworks 2. Return unimplemented error for vxworks from settimes and lchown 3. Temporarily skip dirfd for vxworks 4. Add allow unused unsafe on read_at and write_at functions in unix/fs.rs 5. Using cfg disable ON_BROKEN_PIPE_FLAG_USED and on_broken_pipe_flag_used() for vxworks 6. Remove old crate::syscommon::thread::min_stack() reference from process_vxworks.rs and update to set stack size of rtpthread Thank you.
2024-07-24Add chroot unsupported implementation for VxWorksB I Mohammed Abbas-1/+1
2024-07-22Rollup merge of #127996 - ↵许杰友 Jieyou Xu (Joe)-0/+2
ian-h-chamberlain:fix/horizon-warnings-unsafe-in-unsafe, r=tgross35 Clean up warnings + `unsafe_op_in_unsafe_fn` when building std for armv6k-nintendo-3ds See #127747 ping `@AzureMarker` `@Meziu` I could only find one instance needing an extra `unsafe` that was not also shared with many other `unix` targets (presumably these will get covered in larger sweeping changes, I didn't want to introduce churn that would potentially conflict with those). The one codepath I found is shared with `vita` however, so also pinging `@nikarh` `@pheki` `@zetanumbers` just to make sure they're aware of this change. Also removed one unused import from `process_unsupported` which should simply fix the warning for any target that uses it.
2024-07-21Fix warnings when checking armv6k-nintendo-3dsIan Chamberlain-0/+2
Also fix one instance of unsafe_op_in_unsafe_fn that's specific to horizon + vita - most others should be common with other code.
2024-07-20Rollup merge of #127873 - workingjubilee:forbid-unsafe-ops-for-kmc-solid, ↵Matthias Krüger-1/+1
r=Amanieu kmc-solid: `#![forbid(unsafe_op_in_unsafe_fn)]` The path logic _should_ handle the forbiddance in the itron sources correctly, despite them being an "out-of-line" module.
2024-07-19kmc-solid: forbid(unsafe_op_in_unsafe_fn)Jubilee Young-1/+1
2024-07-19Rollup merge of #112328 - juliusl:pr/windows-add-change-time, r=ChrisDentonMatthias Krüger-0/+10
Feat. adding ext that returns change_time Addresses #112327
2024-07-17feat: adding ext that returns change_time for WindowsJulius Liu-0/+10
2024-07-17Mention how you can go from `BorrowedFd` to `OwnedFd` and backTobias Bucher-0/+5
2024-07-17Make language around `ToOwned` for `BorrowedFd` more preciseTobias Bucher-3/+5
2024-07-16Rollup merge of #127836 - workingjubilee:forbid-unsafe-ops-in-xous-uefi, ↵Trevor Gross-0/+2
r=tgross35 std: Forbid unwrapped unsafe ops in xous and uefi modules
2024-07-16Rollup merge of #126776 - nnethercote:rustfmt-use-pre-cleanups-2, r=cuviperTrevor Gross-1/+0
Clean up more comments near use declarations #125443 will reformat all use declarations in the repository. There are a few edge cases involving comments on use declarations that require care. This PR fixes them up so #125443 can go ahead with a simple `x fmt --all`. A follow-up to #126717. r? ``@cuviper``
2024-07-16uefi: Forbid unwrapped unsafe in platform modulesJubilee Young-0/+1
2024-07-16xous: Forbid unwrapped unsafe in platform modulesJubilee Young-0/+1
2024-07-17Avoid comments that describe multiple `use` items.Nicholas Nethercote-1/+0
There are some comments describing multiple subsequent `use` items. When the big `use` reformatting happens some of these `use` items will be reordered, possibly moving them away from the comment. With this additional level of formatting it's not really feasible to have comments of this type. This commit removes them in various ways: - merging separate `use` items when appropriate; - inserting blank lines between the comment and the first `use` item; - outright deletion (for comments that are relatively low-value); - adding a separate "top-level" comment. We also entirely skip formatting for four library files that contain nothing but `pub use` re-exports, where reordering would be painful.
2024-07-15lib: replace some `mem::forget`'s with `ManuallyDrop`Pavel Grigorenko-17/+8
2024-07-15Rollup merge of #127750 - ChrisDenton:safe-unsafe-unsafe, r=workingjubileeJubilee-15/+26
Make os/windows and pal/windows default to `#![deny(unsafe_op_in_unsafe_fn)]` This is to prevent regressions in modules that currently pass. I did also fix up a few trivial places where the module contained only one or two simple wrappers. In more complex cases we should try to ensure the `unsafe` blocks are appropriately scoped and have any appropriate safety comments. This does not fix the windows bits of #127747 but it should help prevent regressions until that is done and also make it more obvious specifically which modules need attention.
2024-07-15Make os/windows default to deny unsafe in unsafeChris Denton-15/+26
2024-07-14std: deny(unsafe_op_in_unsafe_fn) but allow sitesJubilee Young-0/+1
This provides a list of locations to hunt down issues in.
2024-07-14Auto merge of #125935 - madsmtm:merge-os-apple, r=workingjubileebors-777/+83
Merge Apple `std::os` extensions modules into `std::os::darwin` The functionality available on Apple platforms are very similar, and were (basically) duplicated for each platform. This PR rectifies that by merging the code into one module. Ultimately, I've done this to fix `./x build library --target=aarch64-apple-tvos,aarch64-apple-watchos,aarch64-apple-visionos`, as that currently fails because of dead code warnings. Publically exposing these to tvOS/watchOS/visionOS targets is considered in https://github.com/rust-lang/rust/pull/123723, but that seems to be dragging out, and in any case I think it makes sense to do the refactor separately from stabilization. r? libs Fixes https://github.com/rust-lang/rust/issues/121640 and https://github.com/rust-lang/rust/issues/124825.
2024-07-14Merge Apple `std::os` extensions modules into `std::os::darwin`Mads Marquart-777/+83
The functionality available on Apple platforms are very similar, and were duplicated for each platform. Additionally, this fixes a warning when compiling the standard library for tvOS, watchOS and visionOS by marking the corresponding code as dead code.
2024-07-10Add `must_use` to IntoRawFd/IntoRawSocket/IntoRawHandle's methods.Zachary S-0/+4
2024-07-09Fixed doc linksAndres Olivares-2/+2
2024-07-09Few changes to doc comments. Added tracking issue number.Andres Olivares-4/+5