Skip to content

Remove assertions from ToFileDescriptor - #2226

Open
kg-unity3d wants to merge 1 commit into
unity-mainfrom
tofiledescriptor-assertions
Open

Remove assertions from ToFileDescriptor#2226
kg-unity3d wants to merge 1 commit into
unity-mainfrom
tofiledescriptor-assertions

Conversation

@kg-unity3d

Copy link
Copy Markdown

The fd < sysconf(_SC_OPEN_MAX) assertion is wrong (_SC_OPEN_MAX can be changed at runtime, stranding valid fds above the limit) and the 0 <= fd is correct but not especially useful - we would pass the negative fd through to the kernel and get back a meaningful errno anyway, which would generate a managed exception that can be handled instead of asserting and unconditionally tearing down the process.

  • Should this pull request have release notes?
    • Yes
    • No
  • Do these changes need to be back ported?
    • Yes
    • No
  • Do these changes need to be upstreamed to mono/mono or dotnet/runtime repositories?
    • Yes
    • No

Reviewers: please consider these questions as well! ❤️

Release notes

Changed UUM-145761 @kg-unity3d:
Mono: Remove assertions from ToFileDescriptor

@cla-assistant-unity

cla-assistant-unity Bot commented Jul 30, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@kg-unity3d
kg-unity3d requested a review from joncham July 30, 2026 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant