Init...
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user