Skip to content

Fix getdomainname for SunOS#125053

Open
gwr wants to merge 1 commit intodotnet:mainfrom
gwr:gix-getdom
Open

Fix getdomainname for SunOS#125053
gwr wants to merge 1 commit intodotnet:mainfrom
gwr:gix-getdom

Conversation

@gwr
Copy link
Contributor

@gwr gwr commented Mar 2, 2026

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.

Copilot AI review requested due to automatic review settings March 2, 2026 14:03
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Mar 2, 2026
Copy link
Contributor

Copilot AI left a comment

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.

File Description
src/native/libs/configure.cmake SunOS-specific getdomainname detection with required link libraries and restoration of CMAKE_REQUIRED_LIBRARIES.
src/native/libs/System.Native/pal_networking.c Adds SunOS-only getdomainname forward declaration when the function is available.
src/native/libs/System.Native/extra_libs.cmake Ensures System.Native links socket and nsl on SunOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-System.Net community-contribution Indicates that the PR has been added by a community member os-SunOS SunOS, currently not officially supported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants