Skip to content

Commit 3ba86b1

Browse files
committed
more
1 parent ff3eeba commit 3ba86b1

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

src/libraries/System.Net.NameResolution/src/System.Net.NameResolution.csproj

+2
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@
100100
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'wasi'">
101101
<Compile Include="$(CommonPath)Interop\Wasi\System.Native\Interop.GetHostName.cs"
102102
Link="Common\Interop\Wasi\System.Native\Interop.GetHostName.cs" />
103+
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.ErrNo.cs"
104+
Link="Common\Interop\Unix\System.Native\Interop.ErrNo.cs"/>
103105

104106
<Compile Include="System\Net\NameResolutionPal.Unix.cs" />
105107
<Compile Include="$(CommonPath)System\Net\InteropIPAddressExtensions.Unix.cs"

src/libraries/System.Net.NameResolution/src/System/Net/NameResolutionPal.Wasi.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ private static SocketError GetSocketErrorForNativeError(int error)
4040
case (int)Interop.Sys.GetAddrInfoErrorFlags.EAI_MEMORY:
4141
throw new OutOfMemoryException();
4242
case (int)Interop.Sys.GetAddrInfoErrorFlags.EAI_SYSTEM:
43-
string message = Interop.Sys.GetLastErrorInfo().GetErrorMessage();
44-
throw new PlatformNotSupportedException(message);
43+
throw new PlatformNotSupportedException("__WASI_ERRNO_* " + Interop.Sys.GetErrNo());
4544
default:
4645
Debug.Fail($"Unexpected error: {error}");
4746
return SocketError.SocketError;

src/libraries/System.Net.NameResolution/tests/PalTests/System.Net.NameResolution.Pal.Tests.csproj

+2
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@
7777
Link="Common\Interop\Windows\WinSock\Interop.GetAddrInfoExW.cs" />
7878
</ItemGroup>
7979
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'unix' or '$(TargetPlatformIdentifier)' == 'wasi'">
80+
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.ErrNo.cs"
81+
Link="Common\Interop\Unix\System.Native\Interop.ErrNo.cs"/>
8082
<Compile Include="$(CommonPath)System\Net\SocketAddressPal.Unix.cs"
8183
Link="Common\System\Net\Internals\SocketAddressPal.Unix.cs" />
8284
<Compile Include="$(CommonPath)System\Net\InteropIPAddressExtensions.Unix.cs"

src/native/libs/System.Native/pal_networking.c

-1
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,6 @@ int32_t SystemNative_GetHostEntryForName(const uint8_t* address, int32_t address
379379
hint.ai_flags = AI_CANONNAME;
380380
hint.ai_family = platformFamily;
381381

382-
printf("getaddrinfo %s\n", address);
383382
int result = getaddrinfo((const char*)address, NULL, &hint, &info);
384383
if (result != 0)
385384
{

0 commit comments

Comments
 (0)