Skip to content

Conversation

@trungnt2910
Copy link
Contributor

Add the UnsupportedOSPlatformAttribute for Haiku to managed network functions in System.Net.NetworkInformation to provide a consistent API on Haiku.

Part of #55803.

Copilot AI review requested due to automatic review settings November 21, 2025 14:46
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Nov 21, 2025
@trungnt2910
Copy link
Contributor Author

C/c @am11

This one should be quite simple.

@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Copilot finished reviewing on behalf of trungnt2910 November 21, 2025 14:48
@huoyaoyuan
Copy link
Member

We should also want the attributes in ref source https://github.com/dotnet/runtime/blob/main/src/libraries/System.Net.NetworkInformation/ref/System.Net.NetworkInformation.cs , which matches illumos and solaris.

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

This PR adds UnsupportedOSPlatform("haiku") attributes to network functions in System.Net.NetworkInformation that are not supported on the Haiku operating system, providing compile-time warnings to developers using these APIs on Haiku.

  • Adds Haiku platform annotations to match existing illumos/solaris unsupported APIs
  • Ensures consistent platform API surface across Unix-like operating systems
  • Part of broader effort to properly support Haiku platform (issue #55803)

Reviewed changes

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

Show a summary per file
File Description
UnixUnicastIPAddressInformation.cs Added Haiku unsupported attributes to 8 properties related to DNS eligibility, address lifetimes, DHCP, and address detection
UnixMulticastIPAddressInformation.cs Added Haiku unsupported attributes to 8 properties mirroring unicast address information properties
UnixIPGlobalProperties.cs Added Haiku unsupported attributes to DhcpScopeName and IsWinsProxy properties
NetworkInterfacePal.UnknownUnix.cs Added Haiku unsupported attributes to 4 PAL methods for network interface operations
NetworkInterface.cs Added Haiku unsupported attributes to 4 public static methods/properties for network interface access
NetworkAddressChange.Windows.cs Added Haiku unsupported attributes to 2 network change event handlers
NetworkAddressChange.UnknownUnix.cs Added Haiku unsupported attributes to 2 network change event handlers
NetworkAddressChange.Unix.cs Added Haiku unsupported attributes to 2 network change event handlers
NetworkAddressChange.OSX.cs Added Haiku unsupported attributes to 2 network change event handlers
NetworkAddressChange.Android.cs Added Haiku unsupported attributes to 2 network change event handlers
IPGlobalPropertiesPal.UnknownUnix.cs Added Haiku unsupported attribute to GetIPGlobalProperties PAL method
IPGlobalProperties.cs Added Haiku unsupported attribute to GetIPGlobalProperties public method

@am11
Copy link
Member

am11 commented Nov 21, 2025

@trungnt2910, I think it is ok to bypass the network info API for the time being, but please note that illumos has two/three arch-dependent libs left to port and NetworkInformation is one of them. Generally, it's better to follow FreeBSD's lead as it's more complete surface area when deciding what's ok to "skip" in the built SDK/shared framework.

@am11 am11 added the os-haiku label Nov 21, 2025
@trungnt2910
Copy link
Contributor Author

@trungnt2910, I think it is ok to bypass the network info API for the time being, but please note that illumos has two/three arch-dependent libs left to port and NetworkInformation is one of them. Generally, it's better to follow FreeBSD's lead as it's more complete surface area when deciding what's ok to "skip" in the built SDK/shared framework.

@am11 I am not blindly following illumos, at least in 2023 when I was porting the managed libraries. I tried to implement as many APIs relevant to Haiku as possible.

Haiku does not have the same kind of magic socket/socket options that Linux and FreeBSD have to fit into the current implementations in System.Native.

I made an attempt to squish what Haiku offers into the current codebase for NetworkInformation a while ago, but it didn't go quite well. To support this we will need some significant Haiku-specific implementations across System.Native and the managed libraries.

Add the `UnsupportedOSPlatformAttribute` for Haiku to managed network
functions in `System.Net.NetworkInformation` to provide a consistent
API on Haiku.
@trungnt2910 trungnt2910 force-pushed the dev/trungnt2910/haiku-lib-networkinformation branch from a3eb741 to 23addbb Compare November 21, 2025 15:39
@trungnt2910
Copy link
Contributor Author

Added the attributes in the reference source file.

Guard some advanced network APIs that are marked "unsupported" by Haiku
with compile time macros.
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-haiku

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants