Repository: rust
Issue: Fixing `unsafe_op_in_unsafe_fn` for `std::{os, sys}`
Labels: C-cleanup,A-lints,C-tracking-issue,T-libs,A-edition-2024,L-unsafe_op_in_unsafe_fn

In https://github.com/rust-lang/rust/pull/127744 we begin to `deny(unsafe_op_in_unsafe_fn)` in the standard library, but there are... many... platforms which all use unsafe code inside unsafe functions. **It is unreasonable to fix them all in one step**.

Even if it is technically possible to do this in one push that "fixes" it for all the platforms we run tier 1/2 CI on, **that would be extremely rude**. That would then *immediately* nuke all tier 3 platforms that aren't a variation on the tier 2 ones. We should at least try to allow people to respond before we do so. After all, we will eventually update the standard library to edition 2024 anyway.

To fix each platform, **one at a time**, `deny(unsafe_op_in_unsafe_fn)` should be moved into that platform's support modules (and even individual functions, if necessary). As we can see from the following [test sample](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=07adb0ddb8ae2ba818dc3a3040f0be12), you can have a deny, then an allow, then a deny, and it still works correctly. So we will keep the `allow`s at the top level of `std::os` and `std::sys` in place.

**For now.**

In order to not have one giant table of targets that make my eyes blur, I have split the categories in somewhat arbitrary ways. This is primarily based on the heuristic of "if other examples in this category are fixed, are the rest likely to also be fixed?" except for the "uniques" set, which I expect will *almost* all require individual attention.

## berkeley software descendants
- [ ] freebsd
- [ ] netbsd
- tier 3
  - [ ] dragonfly
  - [ ] openbsd

## darwinian
- [ ] macOS
- [ ] iOS
- tier 3
  - [ ] tvOS
  - [ ] visionOS
  - [ ] watchOS

## linuxen
- [ ] android
- [ ] linux-gnu
- [ ] linux-musl

## unixen
- [ ] illumos
- [ ] redox
- [ ] solaris
- tier 3
  - [ ] aix
  - [ ] haiku
  - [ ] hurd
  - [ ] nto
  - [x] vxworks - https://github.com/rust-lang/rust/pull/128539

## embedded unix + newlib
Unix-ish impls mostly intended for embedded-ish usage, all using [newlib](https://sourceware.org/newlib/).
- [ ] espidf
- [x] horizon - https://github.com/rust-lang/rust/pull/127996
- [x] vita - https://github.com/rust-lang/rust/pull/128315

## windows-y
- [x] windows-gnu
- [x] windows-gnullvm
- [x] windows-msvc
- [x] win7
- https://github.com/rust-lang/rust/pull/127750
- https://github.com/rust-lang/rust/pull/127763
- https://github.com/rust-lang/rust/pull/128131

## uniques
We have a grab bag of others here, some of which are "Unix family" but are... estranged cousins, if so.
- [ ] fuchsia
- [x] hermit - https://github.com/rust-lang/rust/pull/128433
- [x] kmc-solid - https://github.com/rust-lang/rust/pull/127873
- [ ] l4re
- [ ] sgx
- [x] teeos - https://github.com/rust-lang/rust/pull/127789
- [x] uefi - https://github.com/rust-lang/rust/pull/127836
- [ ] wasm-emscripten
- [x] wasm-unknown
- [x] wasm-wasi
- [x] wasm-wasi-threads
- [x] xous - https://github.com/rust-lang/rust/pull/127836
- [x] zkvm - https://github.com/rust-lang/rust/pull/127833