Skip to content
This repository was archived by the owner on Nov 1, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dependencies.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<RyuJITVersion Condition="'$(RyuJITVersion)' == ''">5.0.0-preview.5.20230.9</RyuJITVersion>
<ObjectWriterVersion Condition="'$(ObjectWriterVersion)' == ''">1.0.0-alpha-28820-01</ObjectWriterVersion>
<CoreDisToolsVersion Condition="'$(CoreDisToolsVersion)' == ''">1.0.1-prerelease-00005</CoreDisToolsVersion>
<RuntimeLibrariesVersion Condition="'$(RuntimeLibrariesVersion)' == ''">5.0.0-preview.2.20153.3</RuntimeLibrariesVersion>
<RuntimeLibrariesVersion Condition="'$(RuntimeLibrariesVersion)' == ''">5.0.0-preview.5.20263.12</RuntimeLibrariesVersion>
Copy link
Member Author

Choose a reason for hiding this comment

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

This is likely the last one libraries bump that we can do in CoreRT. Going further requires new Roslyn that requires new tools SDK. We will need to get the move to dotnet/runtimelab done for that.

<CoreFxUapVersion Condition="'$(CoreFxUapVersion)' == ''">4.7.0-preview6.19265.2</CoreFxUapVersion>
<MicrosoftNETCoreAppPackageVersion Condition="'$(MicrosoftNETCoreAppPackageVersion)' == ''">2.1.14</MicrosoftNETCoreAppPackageVersion>
<MicrosoftDotNetTestSdkVersion Condition="'$(MicrosoftDotNetTestSdkVersion)' == ''">15.8.0</MicrosoftDotNetTestSdkVersion>
Expand Down
12 changes: 6 additions & 6 deletions src/BuildIntegration/Microsoft.NETCore.Native.Unix.props
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ See the LICENSE file in the project root for more information.
<ItemGroup>
<NativeLibrary Include="$(IlcPath)/sdk/libSystem.Private.CoreLib.Native$(NativeLibraryExtension)" />
<NativeLibrary Condition="$(NativeCodeGen) == ''" Include="$(IlcPath)/sdk/libSystem.Private.TypeLoader.Native$(NativeLibraryExtension)" />
<NativeLibrary Include="$(IlcPath)/framework/System.Native$(NativeLibraryExtension)" />
<NativeLibrary Include="$(IlcPath)/framework/System.Globalization.Native$(NativeLibraryExtension)" />
<NativeLibrary Include="$(IlcPath)/framework/System.IO.Compression.Native$(NativeLibraryExtension)" />
<NativeLibrary Include="$(IlcPath)/framework/System.Net.Security.Native$(NativeLibraryExtension)" />
<NativeLibrary Include="$(IlcPath)/framework/System.Security.Cryptography.Native.Apple$(NativeLibraryExtension)" Condition="'$(TargetOS)' == 'OSX'"/>
<NativeLibrary Include="$(IlcPath)/framework/System.Security.Cryptography.Native.OpenSsl$(NativeLibraryExtension)" Condition="'$(TargetOS)' != 'OSX'"/>
<NativeLibrary Include="$(IlcPath)/framework/libSystem.Native$(NativeLibraryExtension)" />
<NativeLibrary Include="$(IlcPath)/framework/libSystem.Globalization.Native$(NativeLibraryExtension)" />
<NativeLibrary Include="$(IlcPath)/framework/libSystem.IO.Compression.Native$(NativeLibraryExtension)" />
<NativeLibrary Include="$(IlcPath)/framework/libSystem.Net.Security.Native$(NativeLibraryExtension)" />
<NativeLibrary Include="$(IlcPath)/framework/libSystem.Security.Cryptography.Native.Apple$(NativeLibraryExtension)" Condition="'$(TargetOS)' == 'OSX'"/>
<NativeLibrary Include="$(IlcPath)/framework/libSystem.Security.Cryptography.Native.OpenSsl$(NativeLibraryExtension)" Condition="'$(TargetOS)' != 'OSX'"/>
</ItemGroup>

<ItemGroup Condition="'$(TargetOS)' == 'OSX'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System;
using System.Globalization;
using System.Runtime.InteropServices;
using System.Text;

internal static partial class Interop
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Runtime.InteropServices;
using System.Security;
using System.Text;

internal static partial class Interop
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System;
using System.Globalization;
using System.Runtime.InteropServices;
using System.Security;

internal static partial class Interop
{
Expand All @@ -24,7 +23,7 @@ internal static partial class Globalization
internal static extern unsafe int IndexOf(IntPtr sortHandle, char* target, int cwTargetLength, char* pSource, int cwSourceLength, CompareOptions options, int* matchLengthPtr);

[DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_LastIndexOf")]
internal static extern unsafe int LastIndexOf(IntPtr sortHandle, char* target, int cwTargetLength, char* pSource, int cwSourceLength, CompareOptions options);
internal static extern unsafe int LastIndexOf(IntPtr sortHandle, char* target, int cwTargetLength, char* pSource, int cwSourceLength, CompareOptions options, int* matchLengthPtr);

[DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_IndexOfOrdinalIgnoreCase")]
internal static extern unsafe int IndexOfOrdinalIgnoreCase(string target, int cwTargetLength, char* pSource, int cwSourceLength, bool findLast);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;

internal static partial class Interop
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Runtime.InteropServices;

internal static partial class Interop
Expand Down
11 changes: 11 additions & 0 deletions src/Common/src/Interop/Interop.Libraries.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

internal static partial class Interop
{
internal static partial class Libraries
{
internal const string GlobalizationNative = "libSystem.Globalization.Native";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Runtime.InteropServices;

internal static partial class Interop
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Runtime.InteropServices;
using System.Text;

Expand All @@ -11,9 +10,9 @@ internal static partial class Interop
internal static partial class Globalization
{
[DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_IsNormalized")]
internal static extern int IsNormalized(NormalizationForm normalizationForm, string src, int srcLen);
internal static extern unsafe int IsNormalized(NormalizationForm normalizationForm, char* src, int srcLen);

[DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_NormalizeString")]
internal static extern int NormalizeString(NormalizationForm normalizationForm, string src, int srcLen, [Out] char[] dstBuffer, int dstBufferCapacity);
internal static extern unsafe int NormalizeString(NormalizationForm normalizationForm, char* src, int srcLen, char* dstBuffer, int dstBufferCapacity);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// See the LICENSE file in the project root for more information.

using System.Runtime.InteropServices;
using System.Text;

internal static partial class Interop
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
// See the LICENSE file in the project root for more information.

using System;
using System.Diagnostics;
using System.Buffers;
using System.Text;

internal static partial class Interop
{
Expand Down
2 changes: 1 addition & 1 deletion src/Common/src/Interop/Unix/Interop.Errors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ internal enum Error
// Represents a platform-agnostic Error and underlying platform-specific errno
internal struct ErrorInfo
{
private Error _error;
private readonly Error _error;
private int _rawErrno;

internal ErrorInfo(int errno)
Expand Down
12 changes: 6 additions & 6 deletions src/Common/src/Interop/Unix/Interop.Libraries.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ internal static partial class Interop
internal static partial class Libraries
{
// Shims
internal const string SystemNative = "System.Native";
internal const string GlobalizationNative = "System.Globalization.Native";
internal const string NetSecurityNative = "System.Net.Security.Native";
internal const string CryptoNative = "System.Security.Cryptography.Native.OpenSsl";
internal const string CompressionNative = "System.IO.Compression.Native";
internal const string IOPortsNative = "System.IO.Ports.Native";
internal const string SystemNative = "libSystem.Native";
internal const string NetSecurityNative = "libSystem.Net.Security.Native";
internal const string CryptoNative = "libSystem.Security.Cryptography.Native.OpenSsl";
internal const string CompressionNative = "libSystem.IO.Compression.Native";
internal const string IOPortsNative = "libSystem.IO.Ports.Native";
internal const string Libdl = "libdl";
internal const string HostPolicy = "libhostpolicy";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Runtime.InteropServices;

internal static partial class Interop
Expand Down
1 change: 0 additions & 1 deletion src/Common/src/Interop/Unix/System.Native/Interop.ChDir.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Runtime.InteropServices;

internal static partial class Interop
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ public unsafe struct NetworkInterfaceInfo
[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_EnumerateInterfaceAddresses")]
public static extern int EnumerateInterfaceAddresses(
IPv4AddressDiscoveredCallback ipv4Found,
IPv6AddressDiscoveredCallback ipv6Found,
LinkLayerAddressDiscoveredCallback linkLayerFound);
IPv6AddressDiscoveredCallback? ipv6Found,
LinkLayerAddressDiscoveredCallback? linkLayerFound);

[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_EnumerateGatewayAddressesForInterface")]
public static extern int EnumerateGatewayAddressesForInterface(uint interfaceIndex, DnsAddessDiscoveredCallback onGatewayFound);
Expand Down
3 changes: 3 additions & 0 deletions src/Common/src/Interop/Unix/System.Native/Interop.Fcntl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ internal static partial class Fcntl
[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlSetIsNonBlocking", SetLastError=true)]
internal static extern int SetIsNonBlocking(SafeHandle fd, int isNonBlocking);

[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlGetIsNonBlocking", SetLastError = true)]
internal static extern int GetIsNonBlocking(SafeHandle fd, out bool isNonBlocking);

[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlSetFD", SetLastError=true)]
internal static extern int SetFD(SafeHandle fd, int flags);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

internal static partial class Interop
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Runtime.InteropServices;

internal static partial class Interop
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Runtime.InteropServices;

internal static partial class Interop
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Runtime.InteropServices;

internal static partial class Interop
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Diagnostics;
using System.Runtime.InteropServices;

internal static partial class Interop
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@ internal static partial class Sys

[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSockOpt")]
internal static extern unsafe Error GetSockOpt(IntPtr socket, SocketOptionLevel optionLevel, SocketOptionName optionName, byte* optionValue, int* optionLen);

[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetRawSockOpt")]
internal static extern unsafe Error GetRawSockOpt(SafeHandle socket, int optionLevel, int optionName, byte* optionValue, int* optionLen);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Runtime.InteropServices;

internal static partial class Interop
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ internal enum UnixFileSystemTypes : long
bdevfs = 0x62646576,
bfs = 0x1BADFACE,
binfmt_misc = 0x42494E4D,
bootfs = 0xA56D3FF9,
btrfs = 0x9123683E,
ceph = 0x00C36400,
cgroupfs = 0x0027E0EB,
Expand All @@ -65,6 +66,7 @@ internal enum UnixFileSystemTypes : long
ext3 = 0xEF53,
ext4 = 0xEF53,
fat = 0x4006,
fd = 0xF00D1E,
fhgfs = 0x19830326,
fuse = 0x65735546,
fuseblk = 0x65735546,
Expand All @@ -86,6 +88,7 @@ internal enum UnixFileSystemTypes : long
jffs2 = 0x72B6,
jfs = 0x3153464A,
kafs = 0x6B414653,
lofs = 0xEF53, /* loopback filesystem, magic same as ext2 */
logfs = 0xC97E8168,
lustre = 0x0BD00BD0,
minix_old = 0x137F, /* orig. minix */
Expand Down Expand Up @@ -227,6 +230,7 @@ private static DriveType GetDriveType(string fileSystemName)
case "bdevfs":
case "befs":
case "bfs":
case "bootfs":
case "bpf_fs":
case "btrfs":
case "btrfs_test":
Expand Down Expand Up @@ -261,6 +265,7 @@ private static DriveType GetDriveType(string fileSystemName)
case "jffs":
case "jffs2":
case "jfs":
case "lofs":
case "logfs":
case "lxfs":
case "minix (30 char.)":
Expand Down Expand Up @@ -384,25 +389,30 @@ private static DriveType GetDriveType(string fileSystemName)
case "cgroupfs":
case "cgroup2fs":
case "configfs":
case "cpuset":
case "cramfs":
case "cramfs-wend":
case "cryptkeeper":
case "cpuset":
case "ctfs":
case "debugfs":
case "dev":
case "devfs":
case "devpts":
case "devtmpfs":
case "encfs":
case "fd":
case "fdesc":
case "fuse.gvfsd-fuse":
case "fusectl":
case "futexfs":
case "hugetlbfs":
case "libpam-encfs":
case "ibpam-mount":
case "mntfs":
case "mqueue":
case "mtpfs":
case "mythtvfs":
case "mqueue":
case "objfs":
case "openprom":
case "openpromfs":
case "pipefs":
Expand All @@ -417,6 +427,7 @@ private static DriveType GetDriveType(string fileSystemName)
case "securityfs":
case "selinux":
case "selinuxfs":
case "sharefs":
case "sockfs":
case "sysfs":
case "tmpfs":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// See the LICENSE file in the project root for more information.

using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;

internal static partial class Interop
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Runtime.InteropServices;

internal static partial class Interop
Expand Down
1 change: 0 additions & 1 deletion src/Common/src/Interop/Unix/System.Native/Interop.Read.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// See the LICENSE file in the project root for more information.

using System.Runtime.InteropServices;
using Microsoft.Win32.SafeHandles;

internal static partial class Interop
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@ internal static partial class Sys

[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetSockOpt")]
internal static extern unsafe Error SetSockOpt(IntPtr socket, SocketOptionLevel optionLevel, SocketOptionName optionName, byte* optionValue, int optionLen);

[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetRawSockOpt")]
internal static extern unsafe Error SetRawSockOpt(SafeHandle socket, int optionLevel, int optionName, byte* optionValue, int optionLen);
}
}
2 changes: 1 addition & 1 deletion src/Common/src/Interop/Unix/System.Native/Interop.Stat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ internal enum FileStatusFlags
}

[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FStat", SetLastError = true)]
internal static extern int FStat(SafeFileHandle fd, out FileStatus output);
internal static extern int FStat(SafeHandle fd, out FileStatus output);

[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Stat", SetLastError = true)]
internal static extern int Stat(string path, out FileStatus output);
Expand Down
Loading