Skip to content

Fix getdomainname for SunOS - #125053

Merged
rzikm merged 3 commits into
dotnet:mainfrom
gwr:gix-getdom
Mar 17, 2026
Merged

Fix getdomainname for SunOS#125053
rzikm merged 3 commits into
dotnet:mainfrom
gwr:gix-getdom

Conversation

@gwr

@gwrgwr commented Mar 2, 2026

Copy link
Copy Markdown
Contributor

The tests (System.Net.NetworkInformation.Functional.Tests) being used to validate the work in #124728 need getdomainname() to work or else the test will abort and dump core. This fixes that for SunOS.

CopilotAI review requested due to automatic review settings March 2, 2026 14:03
@dotnet-policy-servicedotnet-policy-serviceBot added the community-contribution Indicates that the PR has been added by a community member label Mar 2, 2026

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes getdomainname() availability on SunOS so System.Net.NetworkInformation.Functional.Tests can run without aborting, by correctly detecting and linking the required SunOS libraries and adding a missing declaration.

Changes:

  • Update CMake configuration to detect getdomainname on SunOS via check_function_exists while linking against socket/nsl.
  • Add an explicit getdomainname prototype for SunOS builds where no header declares it.
  • Link System.Native against libnsl on SunOS.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

FileDescription
src/native/libs/configure.cmakeSunOS-specific getdomainname detection with required link libraries and restoration of CMAKE_REQUIRED_LIBRARIES.
src/native/libs/System.Native/pal_networking.cAdds SunOS-only getdomainname forward declaration when the function is available.
src/native/libs/System.Native/extra_libs.cmakeEnsures System.Native links socket and nsl on SunOS.

Comment threadsrc/native/libs/configure.cmake

@rzikmrzikm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thanks!

CopilotAI review requested due to automatic review settings March 16, 2026 08:10
@rzikm
rzikm enabled auto-merge (squash) March 16, 2026 08:12

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


You can also share your feedback on Copilot code review. Take the survey.

Comment threadsrc/native/libs/configure.cmake Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
CopilotAI review requested due to automatic review settings March 16, 2026 10:53

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.


You can also share your feedback on Copilot code review. Take the survey.

@rzikm

Copy link
Copy Markdown
Member

/ba-g test failure is unrelated

@rzikm
rzikm merged commit e2415a7 into dotnet:mainMar 17, 2026
119 of 125 checks passed
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Apr 17, 2026
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Netcommunity-contributionIndicates that the PR has been added by a community memberos-SunOSSunOS, currently not officially supported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@gwr@rzikm@jkotas