[Mono.Posix] Import from monodroid/8974297a (#51)

Import monodroid/src/Mono.Posix from monodroid/8974297a
This commit is contained in:
Marek Habersack 2016-05-30 17:57:48 +02:00 коммит произвёл Jonathan Pryor
Родитель 260a43c93e
Коммит d1bf26459c
6 изменённых файлов: 345 добавлений и 0 удалений

Просмотреть файл

@ -19,6 +19,8 @@
<AndroidSdkDirectory>$(AndroidToolchainDirectory)\sdk</AndroidSdkDirectory>
<AndroidNdkDirectory>$(AndroidToolchainDirectory)\ndk</AndroidNdkDirectory>
<AndroidSupportedAbis Condition=" '$(AndroidSupportedAbis)' == '' ">armeabi-v7a</AndroidSupportedAbis>
<MonoSourceDirectory>$(MSBuildThisFileDirectory)external\mono</MonoSourceDirectory>
<XamarinAndroidSourcePath>$(MSBuildThisFileDirectory)</XamarinAndroidSourcePath>
</PropertyGroup>
<!--
"Fixup" $(AndroidSupportedAbis) so that Condition attributes elsewhere

Просмотреть файл

@ -63,6 +63,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.Android.Build.Tests
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Android-Tests", "src\Mono.Android\Test\Mono.Android-Tests.csproj", "{40EAD437-216B-4DF4-8258-3F47E1672C3A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Posix", "src\Mono.Posix\Mono.Posix.csproj", "{83F00D30-0AC6-40D8-834B-DD39B6CAA8B3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|AnyCPU = Debug|AnyCPU
@ -252,6 +254,18 @@ Global
{40EAD437-216B-4DF4-8258-3F47E1672C3A}.XAIntegrationDebug|AnyCPU.Build.0 = Debug|Any CPU
{40EAD437-216B-4DF4-8258-3F47E1672C3A}.XAIntegrationRelease|AnyCPU.ActiveCfg = Debug|Any CPU
{40EAD437-216B-4DF4-8258-3F47E1672C3A}.XAIntegrationRelease|AnyCPU.Build.0 = Debug|Any CPU
{83F00D30-0AC6-40D8-834B-DD39B6CAA8B3}.Debug|AnyCPU.ActiveCfg = Debug|Any CPU
{83F00D30-0AC6-40D8-834B-DD39B6CAA8B3}.Debug|AnyCPU.Build.0 = Debug|Any CPU
{83F00D30-0AC6-40D8-834B-DD39B6CAA8B3}.Release|AnyCPU.ActiveCfg = Release|Any CPU
{83F00D30-0AC6-40D8-834B-DD39B6CAA8B3}.Release|AnyCPU.Build.0 = Release|Any CPU
{83F00D30-0AC6-40D8-834B-DD39B6CAA8B3}.XAIntegrationDebug|Any CPU.ActiveCfg = Debug|Any CPU
{83F00D30-0AC6-40D8-834B-DD39B6CAA8B3}.XAIntegrationDebug|Any CPU.Build.0 = Debug|Any CPU
{83F00D30-0AC6-40D8-834B-DD39B6CAA8B3}.XAIntegrationRelease|Any CPU.ActiveCfg = Debug|Any CPU
{83F00D30-0AC6-40D8-834B-DD39B6CAA8B3}.XAIntegrationRelease|Any CPU.Build.0 = Debug|Any CPU
{83F00D30-0AC6-40D8-834B-DD39B6CAA8B3}.XAIntegrationDebug|AnyCPU.ActiveCfg = Debug|Any CPU
{83F00D30-0AC6-40D8-834B-DD39B6CAA8B3}.XAIntegrationDebug|AnyCPU.Build.0 = Debug|Any CPU
{83F00D30-0AC6-40D8-834B-DD39B6CAA8B3}.XAIntegrationRelease|AnyCPU.ActiveCfg = Debug|Any CPU
{83F00D30-0AC6-40D8-834B-DD39B6CAA8B3}.XAIntegrationRelease|AnyCPU.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{8FF78EB6-6FC8-46A7-8A15-EBBA9045C5FA} = {E351F97D-EA4F-4E7F-AAA0-8EBB1F2A4A62}
@ -281,6 +295,7 @@ Global
{2DD1EE75-6D8D-4653-A800-0A24367F7F38} = {CAB438D8-B0F5-4AF0-BEBD-9E2ADBD7B483}
{53E4ABF0-1085-45F9-B964-DCAE4B819998} = {CAB438D8-B0F5-4AF0-BEBD-9E2ADBD7B483}
{40EAD437-216B-4DF4-8258-3F47E1672C3A} = {CAB438D8-B0F5-4AF0-BEBD-9E2ADBD7B483}
{83F00D30-0AC6-40D8-834B-DD39B6CAA8B3} = {04E3E11E-B47D-4599-8AFC-50515A95E715}
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
Policies = $0

Просмотреть файл

@ -0,0 +1,262 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ProjectGuid>{1A4B041A-842F-40B3-A50D-49E01D30BD18}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>Mono.Posix</RootNamespace>
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<AndroidResgenClass>Resource</AndroidResgenClass>
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
<AndroidUseLatestPlatformSdk>True</AndroidUseLatestPlatformSdk>
<AssemblyName>Mono.Posix</AssemblyName>
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\bin\$(Configuration)\lib\xbuild-frameworks\MonoAndroid\v1.0</OutputPath>
<DefineConstants>DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;MONODROID</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidLinkMode>None</AndroidLinkMode>
<ConsolePause>false</ConsolePause>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>..\..\bin\$(Configuration)\lib\xbuild-frameworks\MonoAndroid\v1.0</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
<ConsolePause>false</ConsolePause>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DefineConstants>NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;MONODROID</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Reference Include="mscorlib">
<HintPath>$(OutputPath)..\v1.0\mscorlib.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System">
<HintPath>$(OutputPath)..\v1.0\System.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Core">
<HintPath>$(OutputPath)..\v1.0\System.Core.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Xml">
<HintPath>$(OutputPath)..\v1.0\System.Xml.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<Import Project="..\..\Configuration.props" />
<ItemGroup>
<Compile Include="Mono.Unix.Native\NativeConvert.Android.cs" />
<Compile Include="Mono.Unix.Android\AndroidUtils.cs" />
<Compile Include="$(XamarinAndroidSourcePath)\src\Mono.Android\Android.Runtime\CPUArchitecture.cs">
<Link>Android.Runtime\CPUArchitecture.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Assembly\AssemblyInfo.cs">
<Link>Assembly\AssemblyInfo.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Remoting.Channels.Unix\UnixBinaryClientFormatterSink.cs">
<Link>Mono.Remoting.Channels.Unix\UnixBinaryClientFormatterSink.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Remoting.Channels.Unix\UnixBinaryClientFormatterSinkProvider.cs">
<Link>Mono.Remoting.Channels.Unix\UnixBinaryClientFormatterSinkProvider.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Remoting.Channels.Unix\UnixBinaryCore.cs">
<Link>Mono.Remoting.Channels.Unix\UnixBinaryCore.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Remoting.Channels.Unix\UnixBinaryServerFormatterSink.cs">
<Link>Mono.Remoting.Channels.Unix\UnixBinaryServerFormatterSink.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Remoting.Channels.Unix\UnixBinaryServerFormatterSinkProvider.cs">
<Link>Mono.Remoting.Channels.Unix\UnixBinaryServerFormatterSinkProvider.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Remoting.Channels.Unix\UnixChannel.cs">
<Link>Mono.Remoting.Channels.Unix\UnixChannel.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Remoting.Channels.Unix\UnixClientChannel.cs">
<Link>Mono.Remoting.Channels.Unix\UnixClientChannel.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Remoting.Channels.Unix\UnixClientTransportSink.cs">
<Link>Mono.Remoting.Channels.Unix\UnixClientTransportSink.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Remoting.Channels.Unix\UnixClientTransportSinkProvider.cs">
<Link>Mono.Remoting.Channels.Unix\UnixClientTransportSinkProvider.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Remoting.Channels.Unix\UnixConnectionPool.cs">
<Link>Mono.Remoting.Channels.Unix\UnixConnectionPool.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Remoting.Channels.Unix\UnixMessageIO.cs">
<Link>Mono.Remoting.Channels.Unix\UnixMessageIO.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Remoting.Channels.Unix\UnixServerChannel.cs">
<Link>Mono.Remoting.Channels.Unix\UnixServerChannel.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Remoting.Channels.Unix\UnixServerTransportSink.cs">
<Link>Mono.Remoting.Channels.Unix\UnixServerTransportSink.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Unix.Native\CdeclFunction.cs">
<Link>Mono.Unix.Native\CdeclFunction.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Unix.Native\FileNameMarshaler.cs">
<Link>Mono.Unix.Native\FileNameMarshaler.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Unix.Native\MapAttribute.cs">
<Link>Mono.Unix.Native\MapAttribute.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Unix.Native\NativeConvert.cs">
<Link>Mono.Unix.Native\NativeConvert.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Unix.Native\NativeConvert.generated.cs">
<Link>Mono.Unix.Native\NativeConvert.generated.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Unix.Native\RealTimeSignum.cs">
<Link>Mono.Unix.Native\RealTimeSignum.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Unix.Native\Stdlib.cs">
<Link>Mono.Unix.Native\Stdlib.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Unix.Native\Syscall.cs">
<Link>Mono.Unix.Native\Syscall.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Unix.Native\TypeAttributes.cs">
<Link>Mono.Unix.Native\TypeAttributes.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Unix\AbstractUnixEndPoint.cs">
<Link>Mono.Unix\AbstractUnixEndPoint.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Unix\Catalog.cs">
<Link>Mono.Unix\Catalog.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Unix\FileAccessPattern.cs">
<Link>Mono.Unix\FileAccessPattern.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Unix\FileAccessPermissions.cs">
<Link>Mono.Unix\FileAccessPermissions.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Unix\FileHandleOperations.cs">
<Link>Mono.Unix\FileHandleOperations.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Unix\FileSpecialAttributes.cs">
<Link>Mono.Unix\FileSpecialAttributes.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Unix\FileTypes.cs">
<Link>Mono.Unix\FileTypes.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Unix\PeerCred.cs">
<Link>Mono.Unix\PeerCred.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Unix\StdioFileStream.cs">
<Link>Mono.Unix\StdioFileStream.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Unix\UnixClient.cs">
<Link>Mono.Unix\UnixClient.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Unix\UnixDirectoryInfo.cs">
<Link>Mono.Unix\UnixDirectoryInfo.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Unix\UnixDriveInfo.cs">
<Link>Mono.Unix\UnixDriveInfo.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Unix\UnixEncoding.cs">
<Link>Mono.Unix\UnixEncoding.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Unix\UnixEndPoint.cs">
<Link>Mono.Unix\UnixEndPoint.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Unix\UnixEnvironment.cs">
<Link>Mono.Unix\UnixEnvironment.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Unix\UnixFileInfo.cs">
<Link>Mono.Unix\UnixFileInfo.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Unix\UnixFileSystemInfo.cs">
<Link>Mono.Unix\UnixFileSystemInfo.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Unix\UnixGroupInfo.cs">
<Link>Mono.Unix\UnixGroupInfo.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Unix\UnixIOException.cs">
<Link>Mono.Unix\UnixIOException.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Unix\UnixListener.cs">
<Link>Mono.Unix\UnixListener.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Unix\UnixMarshal.cs">
<Link>Mono.Unix\UnixMarshal.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Unix\UnixPath.cs">
<Link>Mono.Unix\UnixPath.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Unix\UnixPipes.cs">
<Link>Mono.Unix\UnixPipes.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Unix\UnixProcess.cs">
<Link>Mono.Unix\UnixProcess.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Unix\UnixSignal.cs">
<Link>Mono.Unix\UnixSignal.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Unix\UnixStream.cs">
<Link>Mono.Unix\UnixStream.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Unix\UnixSymbolicLinkInfo.cs">
<Link>Mono.Unix\UnixSymbolicLinkInfo.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\class\Mono.Posix\Mono.Unix\UnixUserInfo.cs">
<Link>Mono.Unix\UnixUserInfo.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\build\common\Locale.cs">
<Link>Locale.cs</Link>
</Compile>
<Compile Include="$(MonoSourceDirectory)\mcs\build\common\Consts.cs">
<Link>Consts.cs</Link>
</Compile>
</ItemGroup>
<Import Project="$(OutputPath)\..\..\..\xbuild\Xamarin\Android\Xamarin.Android.CSharp.targets" />
<ItemGroup>
<Folder Include="MonoPosixHelper\" />
<Folder Include="Assembly\" />
<Folder Include="Mono.Posix\" />
<Folder Include="Mono.Remoting.Channels.Unix\" />
<Folder Include="Mono.Unix.Native\" />
<Folder Include="Mono.Unix\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Mono.Android\Mono.Android.csproj">
<Project>{66CF299A-CE95-4131-BCD8-DB66E30C4BF7}</Project>
<Name>Mono.Android</Name>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<PropertyGroup>
<XANativeLibsDir>$(OutputPath)\..\..\..\xbuild\Xamarin\Android\lib</XANativeLibsDir>
</PropertyGroup>
<ItemGroup>
<EmbeddedNativeLibrary Include="$(XANativeLibsDir)\arm64-v8a\libMonoPosixHelper.so" Condition="$(AndroidSupportedAbisForConditionalChecks.Contains (',arm64-v8a,'))">
<Link>MonoPosixHelper\arm64-v8a\libMonoPosixHelper.so</Link>
</EmbeddedNativeLibrary>
<EmbeddedNativeLibrary Include="$(XANativeLibsDir)\armeabi\libMonoPosixHelper.so" Condition="$(AndroidSupportedAbisForConditionalChecks.Contains (',armeabi,'))">
<Link>MonoPosixHelper\armeabi\libMonoPosixHelper.so</Link>
</EmbeddedNativeLibrary>
<EmbeddedNativeLibrary Include="$(XANativeLibsDir)\armeabi-v7a\libMonoPosixHelper.so" Condition="$(AndroidSupportedAbisForConditionalChecks.Contains (',armeabi-v7a,'))">
<Link>MonoPosixHelper\armeabi-v7a\libMonoPosixHelper.so</Link>
</EmbeddedNativeLibrary>
<EmbeddedNativeLibrary Include="$(XANativeLibsDir)\x86\libMonoPosixHelper.so" Condition="$(AndroidSupportedAbisForConditionalChecks.Contains (',x86,'))">
<Link>MonoPosixHelper\x86\libMonoPosixHelper.so</Link>
</EmbeddedNativeLibrary>
<EmbeddedNativeLibrary Include="$(XANativeLibsDir)\x86_64\libMonoPosixHelper.so" Condition="$(AndroidSupportedAbisForConditionalChecks.Contains (',x86_64,'))">
<Link>MonoPosixHelper\x86_64\libMonoPosixHelper.so</Link>
</EmbeddedNativeLibrary>
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,45 @@
using System;
using System.Reflection;
using Android.Runtime;
using Android.Util;
namespace Mono.Unix.Android
{
sealed class AndroidUtils
{
const string TAG = "Mono.Posix";
delegate void DetectCPUAndArchitecture (out ushort builtForCPU, out ushort runningOnCPU, out bool is64bit);
readonly static DetectCPUAndArchitecture detectCPUAndArchitecture;
static AndroidUtils ()
{
MethodInfo mi = typeof(AndroidEnvironment).GetMethod ("DetectCPUAndArchitecture", BindingFlags.NonPublic | BindingFlags.Static);
detectCPUAndArchitecture = (DetectCPUAndArchitecture) Delegate.CreateDelegate (typeof(DetectCPUAndArchitecture), mi);
}
public static bool AreRealTimeSignalsSafe ()
{
ushort built_for_cpu;
ushort running_on_cpu;
bool is64bit;
detectCPUAndArchitecture (out built_for_cpu, out running_on_cpu, out is64bit);
CPUArchitecture builtForCPU = Enum.IsDefined (typeof (CPUArchitecture), built_for_cpu) ? (CPUArchitecture)built_for_cpu : CPUArchitecture.Unknown;
CPUArchitecture runningOnCPU = Enum.IsDefined (typeof (CPUArchitecture), running_on_cpu) ? (CPUArchitecture)running_on_cpu : CPUArchitecture.Unknown;
Log.Info (TAG, " Built for CPU: {0}", builtForCPU);
Log.Info (TAG, "Running on CPU: {0}", runningOnCPU);
Log.Info (TAG, "64-bit process: {0}", is64bit ? "yes" : "no");
// For now real-time signals aren't safe at all, alas
bool safe = false;
Log.Info (TAG, "Real-time signals are {0}safe on this platform", safe ? String.Empty : "not ");
return safe;
}
}
}

Просмотреть файл

@ -0,0 +1,20 @@
using System;
using System.Runtime.InteropServices;
using Mono.Unix.Android;
namespace Mono.Unix.Native
{
partial class NativeConvert
{
[DllImport (LIB, EntryPoint="Mono_Posix_FromRealTimeSignum")]
static extern int HelperFromRealTimeSignum (Int32 offset, out Int32 rval);
static int FromRealTimeSignum (Int32 offset, out Int32 rval)
{
if (!AndroidUtils.AreRealTimeSignalsSafe ())
throw new PlatformNotSupportedException ("Real-time signals are not supported on this Android architecture");
return HelperFromRealTimeSignum (offset, out rval);
}
}
}

1
src/mono.pub Symbolic link
Просмотреть файл

@ -0,0 +1 @@
../external/mono/mcs/class/mono.pub