Skip to content

Add OpenBSD support in CPalThread#129057

Merged
jkotas merged 3 commits into
dotnet:mainfrom
sethjackson:feature/add-openbsd-support-for-cpalthread
Jun 6, 2026
Merged

Add OpenBSD support in CPalThread#129057
jkotas merged 3 commits into
dotnet:mainfrom
sethjackson:feature/add-openbsd-support-for-cpalthread

Conversation

@sethjackson
Copy link
Copy Markdown
Contributor

Add OpenBSD support for CPalThread::GetStackBase() and CPalThread::GetStackLimit().

OpenBSD does not have pthread_attr_get_np or pthread_getattr_np to get the current thread's stack attributes.

Instead there is a standalone function pthread_stackseg_np that does the same via stack_t. Since we do not actually need a standard pthread attr in this case I put this case inside a TARGET_OPENBSD check similar to macOS.

I know that the preferred means of upstreaming the rest of OpenBSD support is to do it all at once but I'm fairly stuck now and you can see my most recent comments here.

So I decided to send this PR for now while I try to figure out next steps for the port.

Contributes to #124911

@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Jun 5, 2026
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @VSadov
See info in area-owners.md if you want to be subscribed.

Comment thread src/coreclr/pal/src/thread/thread.cpp Outdated
Comment thread src/coreclr/pal/src/thread/thread.cpp Outdated
sethjackson and others added 2 commits June 5, 2026 22:33
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
@jkotas jkotas merged commit af215ca into dotnet:main Jun 6, 2026
113 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-System.Threading community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants