This commit is contained in:
2019-12-04 18:57:18 +01:00
parent 4692422c9a
commit 6263791dff
225 changed files with 33065 additions and 2 deletions
+17
View File
@@ -0,0 +1,17 @@
namespace Unosquare.RaspberryIO.Native
{
using System.Runtime.InteropServices;
internal static class Standard
{
internal const string LibCLibrary = "libc";
/// <summary>
/// Fills in the structure with information about the system.
/// </summary>
/// <param name="name">The name.</param>
/// <returns>The result.</returns>
[DllImport(LibCLibrary, EntryPoint = "uname", SetLastError = true)]
public static extern int Uname(out SystemName name);
}
}
@@ -0,0 +1,47 @@
namespace Unosquare.RaspberryIO.Native
{
using System.Runtime.InteropServices;
/// <summary>
/// OS uname structure.
/// </summary>
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct SystemName
{
/// <summary>
/// System name.
/// </summary>
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 65)]
public string SysName;
/// <summary>
/// Node name.
/// </summary>
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 65)]
public string NodeName;
/// <summary>
/// Release level.
/// </summary>
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 65)]
public string Release;
/// <summary>
/// Version level.
/// </summary>
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 65)]
public string Version;
/// <summary>
/// Hardware level.
/// </summary>
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 65)]
public string Machine;
/// <summary>
/// Domain name.
/// </summary>
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 65)]
public string DomainName;
}
}