Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

[System.Native] Exclude ReadDir pinvoke wrappers on Mono; handle EINTR #410

Merged
merged 1 commit into from
Apr 17, 2021

Conversation

lambdageek
Copy link
Member

@lambdageek lambdageek commented Apr 16, 2021

For Mono we must loop in managed when opendir/readdir/closedir return EINTR in
order to handle Thread.Abort.

This is because while a thread abort will break syscalls with EINTR, throwing the
ThreadAbortException will only happen when the pinvoke returns.

(Although opendir/readdir/clsoedir are not documented to return EINTR, they do
so on macOS Big Sur under certain conditions, so we will need to add managed looping)

Related to mono/mono#20799

This is needed by mono/mono#21016

For Mono we must loop in managed when opendir/readdir/closedir return EINTR in
order to handle Thread.Abort.

This is because while a thread abort will break syscalls with EINTR, throwing the
ThreadAbortException will only happen when the pinvoke returns.

(Although opendir/readdir/clsoedir are not documented to return EINTR, they do
so on macOS Big Sur under certain conditions, so we will need to add managed looping)

Related to mono/mono#20799
@lambdageek lambdageek merged commit 9174bbe into mono:main Apr 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants