fix(libc): reopen a stream onto /dev/random or /dev/urandom with freopen #10620

Merged
Retr0G28 merged 4 commits from upstream-pr/10620 into main 2026-11-02 10:23:30 +00:00
Retr0G28 commented 2026-10-24 13:19:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Retr0G28 on 2026-10-24T13:19:25Z.


What

fopen("/dev/urandom", "r") and fopen("/dev/random", "r") return a stream whose fread fills the buffer with host entropy, but freopen onto the same paths went through path resolution and failed with ENOENT, as the debt entry said. FreeBSD 11 freopen opens the path with _open as fopen does, so the two calls reach the same device.

freopen now checks for those exact paths before resolving the path, as fopen does. In a read mode it reopens the stream onto the host null device through FileStream::Reopen and marks it as a random device stream, so the stream behaves as one from fopen. A write or update mode throws, as fopen does for these paths. The null-device open is shared with fopen through OpenNullDevice, and the path check through IsRandomDevicePath. Reopen already clears the random device mark, so a later freopen onto a regular file reads that file.

The debt entry now names fopen and freopen, and the ENOENT sentence is removed.

Test: in the /dev/urandom and /dev/random loop of guest_filesystem, a stream opened on a regular file is reopened onto the device with r. Two 64-byte reads must differ, with no end-of-file or error indicator. Reopened onto the file with rb, it must read the file's bytes and then reach end of file. It is then reopened onto the device with rb and closed.

Tested

Windows 11, WinLibs MinGW-w64 GCC 15.2.0 r7, CMake + Ninja, Release, -DBUILD_TESTING=ON, rebased on main 6cd36e6517.

  • Before the rebase, on main a23f8fc9fb: with main's libc, the new guest_filesystem checks fail (exit 0xc0000409 from the failed Require). With this PR they pass, and guest_poll also passes.
  • After the rebase: guest_filesystem, file_streams, guest_freopen_host_standard, guest_random, guest_posix_random, guest_random_state and guest_sandbox_random_word pass.
  • After merging main 3a2b919816 (head e465f47d92), where the debt entry above this one was rewritten: guest_filesystem, file_streams, guest_freopen_host_standard, guest_random, guest_posix_random and guest_standard_streams pass.
  • After merging main 7ceda1326c (head 9586a81211), where a setvbuf and setbuf entry was added right after this one: the same six pass.
  • python tools/check_conventions.py --base origin/main reports no errors.
  • Not run on Linux, where the reopen goes through std::freopen("/dev/null") and the same test runs. No title or homebrew run.

Overlap: tools/pr_overlap.py finds no open PR that conflicts on the changed lines. Of the PRs it could not compare:

  • #8150 rewrites the same /dev/random debt entry, to add fgetc and the other single-byte reads on the stream, and keeps the sentence "freopen onto these paths still fails with ENOENT". Its conflicts in StandardStreams.cpp and FileStreams.cpp are with current main: git merge-tree --write-tree origin/main on its head reports them, and this PR touches neither file. A stream from this PR's freopen gets the same MarkRandomDevice() mark as one from fopen, so #8150's IsRandomDevice() branch in fgetc and getc_unlocked covers it. Proposed order, posted on #8150: this PR first, since it merges cleanly into main, then #8150 with the combined debt entry given there. If #8150's author prefers to go first, I will rebase this PR and switch Depends on to #8150.
  • #9527 adds freopen_s, which calls freopen, so it would pick this up. Its conflicts in GuestStdioVariadic.cpp and at the end of libc.md are also with current main, and it changes none of this PR's lines, so neither needs the other first (noted on #9527). #9526 adds _Random_device and does not change the fopen path. #7081 and #7201 touch FileAndHeap.cpp elsewhere.
  • #12057 rewrites the Writes on an update stream entry, the line just above this PR's /dev/random entry in libc.md, so the two conflict on neighbouring lines. Agreed with its author: #12057 first, then this PR rebases onto it, keeping #12057's wording for that entry and its own /dev/random entry.
  • #10433 (also mine) changes freopen of a directory in the same FileAndHeap.cpp and libc.md. git merge-tree of the two heads reports no conflict, so either can merge first.
  • The other PRs listed only change other entries of libc.md, or other parts of GuestFilesystem.cpp.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: #12057
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4995730416 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10620). Originally posted by [Retr0G28](https://github.com/Retr0G28) on 2026-10-24T13:19:25Z. --- ### What `fopen("/dev/urandom", "r")` and `fopen("/dev/random", "r")` return a stream whose `fread` fills the buffer with host entropy, but `freopen` onto the same paths went through path resolution and failed with `ENOENT`, as the debt entry said. FreeBSD 11 [`freopen`](https://github.com/freebsd/freebsd-src/blob/8c639945a44588f6cfdddfb057bb5aad88735da0/lib/libc/stdio/freopen.c#L153-L161) opens the path with `_open` as `fopen` does, so the two calls reach the same device. `freopen` now checks for those exact paths before resolving the path, as `fopen` does. In a read mode it reopens the stream onto the host null device through `FileStream::Reopen` and marks it as a random device stream, so the stream behaves as one from `fopen`. A write or update mode throws, as `fopen` does for these paths. The null-device open is shared with `fopen` through `OpenNullDevice`, and the path check through `IsRandomDevicePath`. `Reopen` already clears the random device mark, so a later `freopen` onto a regular file reads that file. The debt entry now names `fopen` and `freopen`, and the `ENOENT` sentence is removed. Test: in the `/dev/urandom` and `/dev/random` loop of `guest_filesystem`, a stream opened on a regular file is reopened onto the device with `r`. Two 64-byte reads must differ, with no end-of-file or error indicator. Reopened onto the file with `rb`, it must read the file's bytes and then reach end of file. It is then reopened onto the device with `rb` and closed. ### Tested Windows 11, WinLibs MinGW-w64 GCC 15.2.0 r7, CMake + Ninja, Release, `-DBUILD_TESTING=ON`, rebased on `main` 6cd36e6517. - Before the rebase, on `main` a23f8fc9fb: with `main`'s libc, the new `guest_filesystem` checks fail (exit 0xc0000409 from the failed `Require`). With this PR they pass, and `guest_poll` also passes. - After the rebase: `guest_filesystem`, `file_streams`, `guest_freopen_host_standard`, `guest_random`, `guest_posix_random`, `guest_random_state` and `guest_sandbox_random_word` pass. - After merging `main` 3a2b919816 (head e465f47d92), where the debt entry above this one was rewritten: `guest_filesystem`, `file_streams`, `guest_freopen_host_standard`, `guest_random`, `guest_posix_random` and `guest_standard_streams` pass. - After merging `main` 7ceda1326c (head 9586a81211), where a `setvbuf and setbuf` entry was added right after this one: the same six pass. - `python tools/check_conventions.py --base origin/main` reports no errors. - Not run on Linux, where the reopen goes through `std::freopen("/dev/null")` and the same test runs. No title or homebrew run. Overlap: `tools/pr_overlap.py` finds no open PR that conflicts on the changed lines. Of the PRs it could not compare: - #8150 rewrites the same `/dev/random` debt entry, to add `fgetc` and the other single-byte reads on the stream, and keeps the sentence "`freopen` onto these paths still fails with `ENOENT`". Its conflicts in `StandardStreams.cpp` and `FileStreams.cpp` are with current `main`: `git merge-tree --write-tree origin/main` on its head reports them, and this PR touches neither file. A stream from this PR's `freopen` gets the same `MarkRandomDevice()` mark as one from `fopen`, so #8150's `IsRandomDevice()` branch in `fgetc` and `getc_unlocked` covers it. Proposed order, posted on #8150: this PR first, since it merges cleanly into `main`, then #8150 with the combined debt entry given there. If #8150's author prefers to go first, I will rebase this PR and switch `Depends on` to #8150. - #9527 adds `freopen_s`, which calls `freopen`, so it would pick this up. Its conflicts in `GuestStdioVariadic.cpp` and at the end of `libc.md` are also with current `main`, and it changes none of this PR's lines, so neither needs the other first (noted on #9527). #9526 adds `_Random_device` and does not change the `fopen` path. #7081 and #7201 touch `FileAndHeap.cpp` elsewhere. - #12057 rewrites the `Writes on an update stream` entry, the line just above this PR's `/dev/random` entry in `libc.md`, so the two conflict on neighbouring lines. Agreed with its author: #12057 first, then this PR rebases onto it, keeping #12057's wording for that entry and its own `/dev/random` entry. - #10433 (also mine) changes `freopen` of a directory in the same `FileAndHeap.cpp` and `libc.md`. `git merge-tree` of the two heads reports no conflict, so either can merge first. - The other PRs listed only change other entries of `libc.md`, or other parts of `GuestFilesystem.cpp`. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: #12057 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-24 13:21:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T13:21:45Z.

Review: APPROVED


Reviewed exact head fbf7004b7d3fc94c7c2107b4cd49cfb5871d3b33. The special paths are handled before guest path resolution, read modes reopen through the same null-device helper used by fopen, and the random-device marker is restored only after a successful reopen; regular-file reopen clears that marker through FileStream::Reopen. The test covers fresh entropy reads, status flags, a subsequent regular-file read, and rejecting update mode. On the exact head, FileAndHeap.cpp passes GCC 12.2 C++20 -Wall -Wextra -fsyntax-only; conventions and git diff --check upstream/main...HEAD pass. The PR reports focused Windows tests, but I did not independently run the guest filesystem runtime test; hosted product test legs were skipped by eligibility.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5638396042 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10620#pullrequestreview-5638396042). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-24T13:21:45Z. **Review:** APPROVED --- Reviewed exact head `fbf7004b7d3fc94c7c2107b4cd49cfb5871d3b33`. The special paths are handled before guest path resolution, read modes reopen through the same null-device helper used by `fopen`, and the random-device marker is restored only after a successful reopen; regular-file reopen clears that marker through `FileStream::Reopen`. The test covers fresh entropy reads, status flags, a subsequent regular-file read, and rejecting update mode. On the exact head, `FileAndHeap.cpp` passes GCC 12.2 C++20 `-Wall -Wextra -fsyntax-only`; conventions and `git diff --check upstream/main...HEAD` pass. The PR reports focused Windows tests, but I did not independently run the guest filesystem runtime test; hosted product test legs were skipped by eligibility.
MarcZX10 commented 2026-10-24 13:57:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T13:57:28Z.

Review: CHANGES_REQUESTED


Follow-up review of exact head fbf7004b7d3fc94c7c2107b4cd49cfb5871d3b33: the implementation and focused test review from my prior approval still apply, and the hosted relinker/register-context/write-watch matrix is now green. Product jobs remain skipped by eligibility.

I manually compared the current open PR heads with git merge-tree. The overlap with #8150 is larger than the debt-line rebase described in this PR body: the merge conflicts in StandardStreams.cpp, FileStreams.cpp, and docs/dev/debt/libc.md. In particular, #8150 adds entropy-aware fgetc/getc_unlocked handling while this PR adds read-mode stream-state handling around freopen; the combined functions must preserve both behaviors. Please agree merge order with #8150's author, resolve all three conflicts while retaining both tests and debt descriptions, and update Depends on if one must land first.

#9527's freopen_s wrapper delegates to freopen, so the behavior is compatible, but the current merge-tree also conflicts in GuestStdioVariadic.cpp and docs/dev/debt/libc.md. Please retain both test/debt changes and coordinate merge order under the repository overlap rule.

This is a merge-coordination request; I found no standalone defect in the reviewed implementation. The existing exact-head Windows test evidence remains author-reported, and I did not independently run the guest filesystem runtime tests.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5638498850 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10620#pullrequestreview-5638498850). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-24T13:57:28Z. **Review:** CHANGES_REQUESTED --- Follow-up review of exact head `fbf7004b7d3fc94c7c2107b4cd49cfb5871d3b33`: the implementation and focused test review from my prior approval still apply, and the hosted relinker/register-context/write-watch matrix is now green. Product jobs remain skipped by eligibility. I manually compared the current open PR heads with `git merge-tree`. The overlap with #8150 is larger than the debt-line rebase described in this PR body: the merge conflicts in `StandardStreams.cpp`, `FileStreams.cpp`, and `docs/dev/debt/libc.md`. In particular, #8150 adds entropy-aware `fgetc`/`getc_unlocked` handling while this PR adds read-mode stream-state handling around `freopen`; the combined functions must preserve both behaviors. Please agree merge order with #8150's author, resolve all three conflicts while retaining both tests and debt descriptions, and update `Depends on` if one must land first. #9527's `freopen_s` wrapper delegates to `freopen`, so the behavior is compatible, but the current merge-tree also conflicts in `GuestStdioVariadic.cpp` and `docs/dev/debt/libc.md`. Please retain both test/debt changes and coordinate merge order under the repository overlap rule. This is a merge-coordination request; I found no standalone defect in the reviewed implementation. The existing exact-head Windows test evidence remains author-reported, and I did not independently run the guest filesystem runtime tests.
MarcZX10 commented 2026-10-24 14:04:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T14:04:24Z.

Review: COMMENTED


Correction to my previous review: after rechecking each branch against current upstream/main and comparing the actual base-relative patches, the StandardStreams.cpp, FileStreams.cpp, and GuestStdioVariadic.cpp conflicts I reported are inherited conflicts with main, not conflicts caused by combining those changes with this PR. The source changes in this PR do not overlap #8150 or #9527. The real shared change is the /dev/random debt entry with #8150; your proposed order and combined wording address it. My earlier merge-coordination request overstated the code/test conflicts. The exact-head implementation and test review remains as in my earlier approval, and I found no blocking issue in this PR.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5638523392 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10620#pullrequestreview-5638523392). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-24T14:04:24Z. **Review:** COMMENTED --- Correction to my previous review: after rechecking each branch against current `upstream/main` and comparing the actual base-relative patches, the `StandardStreams.cpp`, `FileStreams.cpp`, and `GuestStdioVariadic.cpp` conflicts I reported are inherited conflicts with `main`, not conflicts caused by combining those changes with this PR. The source changes in this PR do not overlap #8150 or #9527. The real shared change is the `/dev/random` debt entry with #8150; your proposed order and combined wording address it. My earlier merge-coordination request overstated the code/test conflicts. The exact-head implementation and test review remains as in my earlier approval, and I found no blocking issue in this PR.
MarcZX10 commented 2026-10-24 14:04:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T14:04:25Z.

Review: APPROVED


Re-reviewed exact head fbf7004b7d3fc94c7c2107b4cd49cfb5871d3b33. I withdraw the merge-coordination blocker from my prior review: it came from comparing old PR refs against each other rather than evaluating their patches on current main. The only material overlap is the shared /dev/random debt entry with #8150, and the PR body records an order and combined wording. The freopen special-path handling restores the random-device marker after successful reopen; normal file reopen behavior and error handling remain intact. The added guest filesystem test covers entropy reads, status, re-opening a regular file, and rejecting update mode. I did not independently run the guest filesystem runtime test; product jobs are skipped by eligibility. No blocking issue remains.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5638523497 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10620#pullrequestreview-5638523497). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-24T14:04:25Z. **Review:** APPROVED --- Re-reviewed exact head `fbf7004b7d3fc94c7c2107b4cd49cfb5871d3b33`. I withdraw the merge-coordination blocker from my prior review: it came from comparing old PR refs against each other rather than evaluating their patches on current `main`. The only material overlap is the shared `/dev/random` debt entry with #8150, and the PR body records an order and combined wording. The `freopen` special-path handling restores the random-device marker after successful reopen; normal file reopen behavior and error handling remain intact. The added guest filesystem test covers entropy reads, status, re-opening a regular file, and rejecting update mode. I did not independently run the guest filesystem runtime test; product jobs are skipped by eligibility. No blocking issue remains.
MarcZX10 commented 2026-10-29 00:13:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T00:13:16Z.

Review: APPROVED


Re-checked — new head, looks good

The current head retains the previously reviewed implementation, removes an unmeasured device-mode assertion, and records the agreed overlap order with #12057.

What I ran

Reviewed exact head e465f47d929d32f850d6b9e31ab49c12c9f74eb7 on current main 3a2b91981651569163768854a1fcdc7193b6667b; the merge preview is clean. Compared the new PR patch with the previously approved patch: FileAndHeap.cpp is unchanged, and the only code/test delta is removal of the unsupported freopen(device, "r+") throw assertion. Environment: Linux x86-64, Git and GitHub CLI. I did not run a local Windows or guest runtime build.

git diff --check refs/review/main-20261029...refs/review/pr-10620-20261029
python3 tools/check_conventions.py --base refs/review/main-20261029 --head refs/review/pr-10620-20261029
git merge-tree --write-tree refs/review/main-20261029 refs/review/pr-10620-20261029
git diff --stat 3a2b91981651569163768854a1fcdc7193b6667b...e465f47d929d32f850d6b9e31ab49c12c9f74eb7
git range-diff 6cd36e651724f42b7b564544640187948e80c8cb..fbf7004b7d3fc94c7c2107b4cd49cfb5871d3b33 refs/review/main-20261029..refs/review/pr-10620-20261029

Results

Check Result
Current-main merge preview Pass; clean
Conventions Pass
Diff check Pass
Patch comparison to previously reviewed head Production FileAndHeap.cpp patch unchanged; one test-only commit removes the unsupported assertion
Exact-head focused Windows tests Author reports guest_filesystem, file_streams, guest_freopen_host_standard, guest_random, guest_posix_random, and guest_standard_streams pass
Hosted checks Windows, Ubuntu/Windows relinker, ASan, conventions and policy checks pass; macOS relinker and specialized checks are queued; Linux product is skipped
Command output
All conventions checks passed.
3a7b7c6914d0b90340fcd6a40a124c1da772f4e5
core/libs/prx/libc/src/FileAndHeap.cpp | 33 +++++++++++++++++++++++++++------
core/libs/tests/GuestFilesystem.cpp    | 11 +++++++++++
docs/dev/debt/libc.md                  |  2 +-
1: fbf7004b7d = 1: fbf7004b7d fix(libc): reopen a stream onto /dev/random or /dev/urandom with freopen
-: ---------- > 2: 2a999da21f test(libc): drop the freopen check that pins a write mode on a random device to throwing

Negative control

Assertion Change to code under test Outcome
The new random-device reopen behavior is distinct from the previous implementation Prior reviewed run substituted main's FileAndHeap.cpp while keeping the PR test The test failed on the base source; I did not rerun this control on the new head. The implementation file is identical to the previously approved head.

Findings

Blocking

  • None.

Non-blocking

  • The PR now records that #12057 lands first and #10620 follows it. #10620 lists Depends on: #12057; this is consistent with the shared debt-file edit.

Sources

Not verified

  • I did not run local Windows, Linux or console execution. The exact-head Windows focused results are author-reported; hosted Windows CI passes and Linux product CI is skipped.
  • The queued macOS specialized jobs have not completed.

To get this to a good state

No further code change is needed for this review. The documented order keeps #12057 ahead of this PR; if another code head is pushed, I will repeat the same merge, conventions, diff and source review on it.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5691326657 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10620#pullrequestreview-5691326657). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T00:13:16Z. **Review:** APPROVED --- # Re-checked — new head, looks good The current head retains the previously reviewed implementation, removes an unmeasured device-mode assertion, and records the agreed overlap order with #12057. ## What I ran Reviewed exact head `e465f47d929d32f850d6b9e31ab49c12c9f74eb7` on current `main` `3a2b91981651569163768854a1fcdc7193b6667b`; the merge preview is clean. Compared the new PR patch with the previously approved patch: `FileAndHeap.cpp` is unchanged, and the only code/test delta is removal of the unsupported `freopen(device, "r+")` throw assertion. Environment: Linux x86-64, Git and GitHub CLI. I did not run a local Windows or guest runtime build. ```sh git diff --check refs/review/main-20261029...refs/review/pr-10620-20261029 python3 tools/check_conventions.py --base refs/review/main-20261029 --head refs/review/pr-10620-20261029 git merge-tree --write-tree refs/review/main-20261029 refs/review/pr-10620-20261029 git diff --stat 3a2b91981651569163768854a1fcdc7193b6667b...e465f47d929d32f850d6b9e31ab49c12c9f74eb7 git range-diff 6cd36e651724f42b7b564544640187948e80c8cb..fbf7004b7d3fc94c7c2107b4cd49cfb5871d3b33 refs/review/main-20261029..refs/review/pr-10620-20261029 ``` ## Results | Check | Result | |---|---| | Current-main merge preview | Pass; clean | | Conventions | Pass | | Diff check | Pass | | Patch comparison to previously reviewed head | Production `FileAndHeap.cpp` patch unchanged; one test-only commit removes the unsupported assertion | | Exact-head focused Windows tests | Author reports `guest_filesystem`, `file_streams`, `guest_freopen_host_standard`, `guest_random`, `guest_posix_random`, and `guest_standard_streams` pass | | Hosted checks | Windows, Ubuntu/Windows relinker, ASan, conventions and policy checks pass; macOS relinker and specialized checks are queued; Linux product is skipped | <details> <summary>Command output</summary> ```text All conventions checks passed. 3a7b7c6914d0b90340fcd6a40a124c1da772f4e5 core/libs/prx/libc/src/FileAndHeap.cpp | 33 +++++++++++++++++++++++++++------ core/libs/tests/GuestFilesystem.cpp | 11 +++++++++++ docs/dev/debt/libc.md | 2 +- 1: fbf7004b7d = 1: fbf7004b7d fix(libc): reopen a stream onto /dev/random or /dev/urandom with freopen -: ---------- > 2: 2a999da21f test(libc): drop the freopen check that pins a write mode on a random device to throwing ``` </details> ## Negative control | Assertion | Change to code under test | Outcome | |---|---|---| | The new random-device reopen behavior is distinct from the previous implementation | Prior reviewed run substituted `main`'s `FileAndHeap.cpp` while keeping the PR test | The test failed on the base source; I did not rerun this control on the new head. The implementation file is identical to the previously approved head. | ## Findings ### Blocking - None. ### Non-blocking - The PR now records that #12057 lands first and #10620 follows it. #10620 lists `Depends on: #12057`; this is consistent with the shared debt-file edit. ## Sources - [Current implementation at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/e465f47d929d32f850d6b9e31ab49c12c9f74eb7/core/libs/prx/libc/src/FileAndHeap.cpp) - [Current tests at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/e465f47d929d32f850d6b9e31ab49c12c9f74eb7/core/libs/tests/GuestFilesystem.cpp) - [Recorded dependency on #12057](https://github.com/boykopovar/AnyPS5/blob/e465f47d929d32f850d6b9e31ab49c12c9f74eb7/.github/pull_request_template.md) ## Not verified - I did not run local Windows, Linux or console execution. The exact-head Windows focused results are author-reported; hosted Windows CI passes and Linux product CI is skipped. - The queued macOS specialized jobs have not completed. ## To get this to a good state No further code change is needed for this review. The documented order keeps #12057 ahead of this PR; if another code head is pushed, I will repeat the same merge, conventions, diff and source review on it.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!10620
No description provided.