-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define _REENTRANT for SUNOS #104527
Define _REENTRANT for SUNOS #104527
Conversation
I hope you won't take it the wrong way, and I am happy this port is moving forward. I think it'd be better to port something sizeable, such as one of the remaining runtime library needed to complete shared framework, rather than many teeny tiny patches. Otherwise, we would be burdening the maintainers which will slow down the port process / interest. Thanks for pushing it forward. |
No offense taken. My intention in making these small PRs was to make them easier to review, not more difficult. I can conceive that that per PR overhead for maintainers like evaluating Build Analysis of the flaky CI system can add up. Please let me know if there is a better way to collaborate on this port. For what it's worth, this PR and #104448 make it possible to run library tests without the test runner dying in asserts or memory corruption. I expect future PRs to implement larger swaths of missing functionality in the libraries. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, it is aligning with mono:
runtime/src/mono/CMakeLists.txt
Line 295 in 9882188
add_definitions(-DGC_SOLARIS_THREADS -DGC_SOLARIS_PTHREADS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_MMAP -DUSE_MUNMAP -DHOST_SOLARIS -D__EXTENSIONS__ -D_XPG4_2) |
This is required to make errno a thread-local variable. See the manpages for errno(3c) and threads(7).
03fbb88
to
f635415
Compare
Now that .NET 9 has branched, I rebased this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
This matches mono. This is required to make errno a thread-local variable. This fixes problems where calls into
libSystem.Native
return failure but the theerrno
is 0. This was causing all kinds of odd asserts in System.IO.Tests and other libraries tests.See the man page for errno(3c):
Since
-mt
is presumably specific to an old Sun compiler, the threads(7) man page says:Contributes to #34944