|
// <auto-generated/>
internal static unsafe partial class Interop
{
internal static unsafe partial class Sys
{
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_ConvertErrorPlatformToPal", ExactSpelling = true)]
internal static extern partial global::Interop.Error ConvertErrorPlatformToPal(int platformErrno);
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class Sys
{
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_ConvertErrorPalToPlatform", ExactSpelling = true)]
internal static extern partial int ConvertErrorPalToPlatform(global::Interop.Error error);
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class Sys
{
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_StrErrorR", ExactSpelling = true)]
private static unsafe extern partial byte* StrErrorR(int platformErrno, byte* buffer, int bufferSize);
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class Sys
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "42.42.42.42")]
internal static partial int Close(nint fd)
{
int __lastError;
int __retVal;
{
global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
__retVal = __PInvoke(fd);
__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
}
global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
return __retVal;
// Local P/Invoke
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_Close", ExactSpelling = true)]
static extern unsafe int __PInvoke(nint __fd_native);
}
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class Sys
{
internal static unsafe partial class Fcntl
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "42.42.42.42")]
internal static partial int DangerousSetIsNonBlocking(nint fd, int isNonBlocking)
{
int __lastError;
int __retVal;
{
global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
__retVal = __PInvoke(fd, isNonBlocking);
__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
}
global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
return __retVal;
// Local P/Invoke
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_FcntlSetIsNonBlocking", ExactSpelling = true)]
static extern unsafe int __PInvoke(nint __fd_native, int __isNonBlocking_native);
}
}
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class Sys
{
internal static unsafe partial class Fcntl
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "42.42.42.42")]
internal static partial int SetIsNonBlocking(global::System.Runtime.InteropServices.SafeHandle fd, int isNonBlocking)
{
int __lastError;
nint __fd_native = default;
int __retVal = default;
// Setup - Perform required setup.
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new();
try
{
// Marshal - Convert managed data to native data.
__fd_native__marshaller.FromManaged(fd);
{
// PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
__fd_native = __fd_native__marshaller.ToUnmanaged();
global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
__retVal = __PInvoke(__fd_native, isNonBlocking);
__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
}
}
finally
{
// CleanupCallerAllocated - Perform cleanup of caller allocated resources.
__fd_native__marshaller.Free();
}
global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
return __retVal;
// Local P/Invoke
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_FcntlSetIsNonBlocking", ExactSpelling = true)]
static extern unsafe int __PInvoke(nint __fd_native, int __isNonBlocking_native);
}
}
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class Sys
{
internal static unsafe partial class Fcntl
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "42.42.42.42")]
internal static partial int GetIsNonBlocking(global::System.Runtime.InteropServices.SafeHandle fd, out bool isNonBlocking)
{
int __lastError;
isNonBlocking = default;
nint __fd_native = default;
int __isNonBlocking_native = default;
int __retVal = default;
// Setup - Perform required setup.
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new();
try
{
// Marshal - Convert managed data to native data.
__fd_native__marshaller.FromManaged(fd);
{
// PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
__fd_native = __fd_native__marshaller.ToUnmanaged();
global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
__retVal = __PInvoke(__fd_native, &__isNonBlocking_native);
__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
}
// Unmarshal - Convert native data to managed data.
isNonBlocking = __isNonBlocking_native != 0;
}
finally
{
// CleanupCallerAllocated - Perform cleanup of caller allocated resources.
__fd_native__marshaller.Free();
}
global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
return __retVal;
// Local P/Invoke
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_FcntlGetIsNonBlocking", ExactSpelling = true)]
static extern unsafe int __PInvoke(nint __fd_native, int* __isNonBlocking_native);
}
}
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class Sys
{
internal static unsafe partial class Fcntl
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "42.42.42.42")]
internal static partial int SetFD(global::System.Runtime.InteropServices.SafeHandle fd, int flags)
{
int __lastError;
nint __fd_native = default;
int __retVal = default;
// Setup - Perform required setup.
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new();
try
{
// Marshal - Convert managed data to native data.
__fd_native__marshaller.FromManaged(fd);
{
// PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
__fd_native = __fd_native__marshaller.ToUnmanaged();
global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
__retVal = __PInvoke(__fd_native, flags);
__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
}
}
finally
{
// CleanupCallerAllocated - Perform cleanup of caller allocated resources.
__fd_native__marshaller.Free();
}
global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
return __retVal;
// Local P/Invoke
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_FcntlSetFD", ExactSpelling = true)]
static extern unsafe int __PInvoke(nint __fd_native, int __flags_native);
}
}
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class Sys
{
internal static unsafe partial class Fcntl
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "42.42.42.42")]
internal static partial int GetFD(global::System.Runtime.InteropServices.SafeHandle fd)
{
int __lastError;
nint __fd_native = default;
int __retVal = default;
// Setup - Perform required setup.
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new();
try
{
// Marshal - Convert managed data to native data.
__fd_native__marshaller.FromManaged(fd);
{
// PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
__fd_native = __fd_native__marshaller.ToUnmanaged();
global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
__retVal = __PInvoke(__fd_native);
__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
}
}
finally
{
// CleanupCallerAllocated - Perform cleanup of caller allocated resources.
__fd_native__marshaller.Free();
}
global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
return __retVal;
// Local P/Invoke
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_FcntlGetFD", ExactSpelling = true)]
static extern unsafe int __PInvoke(nint __fd_native);
}
}
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class Sys
{
internal static unsafe partial class Fcntl
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "42.42.42.42")]
internal static partial int GetFD(nint fd)
{
int __lastError;
int __retVal;
{
global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
__retVal = __PInvoke(fd);
__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
}
global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
return __retVal;
// Local P/Invoke
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_FcntlGetFD", ExactSpelling = true)]
static extern unsafe int __PInvoke(nint __fd_native);
}
}
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class Sys
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "42.42.42.42")]
internal static partial nint MMap(nint addr, ulong len, global::Interop.Sys.MemoryMappedProtections prot, global::Interop.Sys.MemoryMappedFlags flags, global::Microsoft.Win32.SafeHandles.SafeFileHandle fd, long offset)
{
int __lastError;
nint __fd_native = default;
nint __retVal = default;
// Setup - Perform required setup.
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeFileHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new();
try
{
// Marshal - Convert managed data to native data.
__fd_native__marshaller.FromManaged(fd);
{
// PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
__fd_native = __fd_native__marshaller.ToUnmanaged();
global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
__retVal = __PInvoke(addr, len, prot, flags, __fd_native, offset);
__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
}
}
finally
{
// CleanupCallerAllocated - Perform cleanup of caller allocated resources.
__fd_native__marshaller.Free();
}
global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
return __retVal;
// Local P/Invoke
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_MMap", ExactSpelling = true)]
static extern unsafe nint __PInvoke(nint __addr_native, ulong __len_native, global::Interop.Sys.MemoryMappedProtections __prot_native, global::Interop.Sys.MemoryMappedFlags __flags_native, nint __fd_native, long __offset_native);
}
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class Sys
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "42.42.42.42")]
internal static partial nint MMap(nint addr, ulong len, global::Interop.Sys.MemoryMappedProtections prot, global::Interop.Sys.MemoryMappedFlags flags, nint fd, long offset)
{
int __lastError;
nint __retVal;
{
global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
__retVal = __PInvoke(addr, len, prot, flags, fd, offset);
__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
}
global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
return __retVal;
// Local P/Invoke
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_MMap", ExactSpelling = true)]
static extern unsafe nint __PInvoke(nint __addr_native, ulong __len_native, global::Interop.Sys.MemoryMappedProtections __prot_native, global::Interop.Sys.MemoryMappedFlags __flags_native, nint __fd_native, long __offset_native);
}
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class Sys
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "42.42.42.42")]
internal static partial int MUnmap(nint addr, ulong len)
{
int __lastError;
int __retVal;
{
global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
__retVal = __PInvoke(addr, len);
__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
}
global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
return __retVal;
// Local P/Invoke
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_MUnmap", ExactSpelling = true)]
static extern unsafe int __PInvoke(nint __addr_native, ulong __len_native);
}
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class Sys
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "42.42.42.42")]
internal static partial int MSync(nint addr, ulong len, global::Interop.Sys.MemoryMappedSyncFlags flags)
{
int __lastError;
int __retVal;
{
global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
__retVal = __PInvoke(addr, len, flags);
__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
}
global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
return __retVal;
// Local P/Invoke
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_MSync", ExactSpelling = true)]
static extern unsafe int __PInvoke(nint __addr_native, ulong __len_native, global::Interop.Sys.MemoryMappedSyncFlags __flags_native);
}
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class Sys
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "42.42.42.42")]
internal static partial global::Microsoft.Win32.SafeHandles.SafeFileHandle Open(string filename, global::Interop.Sys.OpenFlags flags, int mode)
{
int __lastError;
bool __invokeSucceeded = default;
byte* __filename_native = default;
global::Microsoft.Win32.SafeHandles.SafeFileHandle __retVal = default;
nint __retVal_native = default;
// Setup - Perform required setup.
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeFileHandle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
scoped global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn __filename_native__marshaller = new();
try
{
// Marshal - Convert managed data to native data.
__filename_native__marshaller.FromManaged(filename, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize]);
{
// PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
__filename_native = __filename_native__marshaller.ToUnmanaged();
global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
__retVal_native = __PInvoke(__filename_native, flags, mode);
__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
}
__invokeSucceeded = true;
// UnmarshalCapture - Capture the native data into marshaller instances in case conversion to managed data throws an exception.
__retVal_native__marshaller.FromUnmanaged(__retVal_native);
// Unmarshal - Convert native data to managed data.
__retVal = __retVal_native__marshaller.ToManaged();
}
finally
{
if (__invokeSucceeded)
{
// CleanupCalleeAllocated - Perform cleanup of callee allocated resources.
__retVal_native__marshaller.Free();
}
// CleanupCallerAllocated - Perform cleanup of caller allocated resources.
__filename_native__marshaller.Free();
}
global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
return __retVal;
// Local P/Invoke
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_Open", ExactSpelling = true)]
static extern unsafe nint __PInvoke(byte* __filename_native, global::Interop.Sys.OpenFlags __flags_native, int __mode_native);
}
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class Sys
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "42.42.42.42")]
internal static partial int FStat(global::System.Runtime.InteropServices.SafeHandle fd, out global::Interop.Sys.FileStatus output)
{
int __lastError;
output = default;
nint __fd_native = default;
int __retVal = default;
// Setup - Perform required setup.
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new();
try
{
// Marshal - Convert managed data to native data.
__fd_native__marshaller.FromManaged(fd);
// Pin - Pin data in preparation for calling the P/Invoke.
fixed (global::Interop.Sys.FileStatus* __output_native = &output)
{
// PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
__fd_native = __fd_native__marshaller.ToUnmanaged();
global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
__retVal = __PInvoke(__fd_native, __output_native);
__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
}
}
finally
{
// CleanupCallerAllocated - Perform cleanup of caller allocated resources.
__fd_native__marshaller.Free();
}
global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
return __retVal;
// Local P/Invoke
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_FStat", ExactSpelling = true)]
static extern unsafe int __PInvoke(nint __fd_native, global::Interop.Sys.FileStatus* __output_native);
}
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class Sys
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "42.42.42.42")]
internal static partial int Stat(string path, out global::Interop.Sys.FileStatus output)
{
int __lastError;
output = default;
byte* __path_native = default;
int __retVal = default;
// Setup - Perform required setup.
scoped global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn __path_native__marshaller = new();
try
{
// Marshal - Convert managed data to native data.
__path_native__marshaller.FromManaged(path, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize]);
// Pin - Pin data in preparation for calling the P/Invoke.
fixed (global::Interop.Sys.FileStatus* __output_native = &output)
{
// PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
__path_native = __path_native__marshaller.ToUnmanaged();
global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
__retVal = __PInvoke(__path_native, __output_native);
__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
}
}
finally
{
// CleanupCallerAllocated - Perform cleanup of caller allocated resources.
__path_native__marshaller.Free();
}
global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
return __retVal;
// Local P/Invoke
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_Stat", ExactSpelling = true)]
static extern unsafe int __PInvoke(byte* __path_native, global::Interop.Sys.FileStatus* __output_native);
}
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class Sys
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "42.42.42.42")]
internal static partial int LStat(string path, out global::Interop.Sys.FileStatus output)
{
int __lastError;
output = default;
byte* __path_native = default;
int __retVal = default;
// Setup - Perform required setup.
scoped global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn __path_native__marshaller = new();
try
{
// Marshal - Convert managed data to native data.
__path_native__marshaller.FromManaged(path, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize]);
// Pin - Pin data in preparation for calling the P/Invoke.
fixed (global::Interop.Sys.FileStatus* __output_native = &output)
{
// PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
__path_native = __path_native__marshaller.ToUnmanaged();
global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
__retVal = __PInvoke(__path_native, __output_native);
__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
}
}
finally
{
// CleanupCallerAllocated - Perform cleanup of caller allocated resources.
__path_native__marshaller.Free();
}
global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
return __retVal;
// Local P/Invoke
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_LStat", ExactSpelling = true)]
static extern unsafe int __PInvoke(byte* __path_native, global::Interop.Sys.FileStatus* __output_native);
}
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class Sys
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "42.42.42.42")]
internal static partial long SysConf(global::Interop.Sys.SysConfName name)
{
int __lastError;
long __retVal;
{
global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
__retVal = __PInvoke(name);
__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
}
global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
return __retVal;
// Local P/Invoke
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_SysConf", ExactSpelling = true)]
static extern unsafe long __PInvoke(global::Interop.Sys.SysConfName __name_native);
}
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class Sys
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "42.42.42.42")]
internal static partial int FTruncate(global::Microsoft.Win32.SafeHandles.SafeFileHandle fd, long length)
{
int __lastError;
nint __fd_native = default;
int __retVal = default;
// Setup - Perform required setup.
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeFileHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new();
try
{
// Marshal - Convert managed data to native data.
__fd_native__marshaller.FromManaged(fd);
{
// PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
__fd_native = __fd_native__marshaller.ToUnmanaged();
global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
__retVal = __PInvoke(__fd_native, length);
__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
}
}
finally
{
// CleanupCallerAllocated - Perform cleanup of caller allocated resources.
__fd_native__marshaller.Free();
}
global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
return __retVal;
// Local P/Invoke
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_FTruncate", ExactSpelling = true)]
static extern unsafe int __PInvoke(nint __fd_native, long __length_native);
}
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class Sys
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "42.42.42.42")]
internal static partial int MAdvise(nint addr, ulong length, global::Interop.Sys.MemoryAdvice advice)
{
int __lastError;
int __retVal;
{
global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
__retVal = __PInvoke(addr, length, advice);
__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
}
global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
return __retVal;
// Local P/Invoke
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_MAdvise", ExactSpelling = true)]
static extern unsafe int __PInvoke(nint __addr_native, ulong __length_native, global::Interop.Sys.MemoryAdvice __advice_native);
}
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class Sys
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "42.42.42.42")]
internal static partial global::Microsoft.Win32.SafeHandles.SafeFileHandle ShmOpen(string name, global::Interop.Sys.OpenFlags flags, int mode)
{
int __lastError;
bool __invokeSucceeded = default;
byte* __name_native = default;
global::Microsoft.Win32.SafeHandles.SafeFileHandle __retVal = default;
nint __retVal_native = default;
// Setup - Perform required setup.
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeFileHandle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
scoped global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn __name_native__marshaller = new();
try
{
// Marshal - Convert managed data to native data.
__name_native__marshaller.FromManaged(name, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize]);
{
// PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
__name_native = __name_native__marshaller.ToUnmanaged();
global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
__retVal_native = __PInvoke(__name_native, flags, mode);
__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
}
__invokeSucceeded = true;
// UnmarshalCapture - Capture the native data into marshaller instances in case conversion to managed data throws an exception.
__retVal_native__marshaller.FromUnmanaged(__retVal_native);
// Unmarshal - Convert native data to managed data.
__retVal = __retVal_native__marshaller.ToManaged();
}
finally
{
if (__invokeSucceeded)
{
// CleanupCalleeAllocated - Perform cleanup of callee allocated resources.
__retVal_native__marshaller.Free();
}
// CleanupCallerAllocated - Perform cleanup of caller allocated resources.
__name_native__marshaller.Free();
}
global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
return __retVal;
// Local P/Invoke
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_ShmOpen", ExactSpelling = true)]
static extern unsafe nint __PInvoke(byte* __name_native, global::Interop.Sys.OpenFlags __flags_native, int __mode_native);
}
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class Sys
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "42.42.42.42")]
internal static partial int ShmUnlink(string name)
{
int __lastError;
byte* __name_native = default;
int __retVal = default;
// Setup - Perform required setup.
scoped global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn __name_native__marshaller = new();
try
{
// Marshal - Convert managed data to native data.
__name_native__marshaller.FromManaged(name, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize]);
{
// PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
__name_native = __name_native__marshaller.ToUnmanaged();
global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
__retVal = __PInvoke(__name_native);
__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
}
}
finally
{
// CleanupCallerAllocated - Perform cleanup of caller allocated resources.
__name_native__marshaller.Free();
}
global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
return __retVal;
// Local P/Invoke
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_ShmUnlink", ExactSpelling = true)]
static extern unsafe int __PInvoke(byte* __name_native);
}
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class Sys
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "42.42.42.42")]
internal static partial global::Microsoft.Win32.SafeHandles.SafeFileHandle MemfdCreate(string name, int isReadonly)
{
int __lastError;
bool __invokeSucceeded = default;
byte* __name_native = default;
global::Microsoft.Win32.SafeHandles.SafeFileHandle __retVal = default;
nint __retVal_native = default;
// Setup - Perform required setup.
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeFileHandle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
scoped global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn __name_native__marshaller = new();
try
{
// Marshal - Convert managed data to native data.
__name_native__marshaller.FromManaged(name, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize]);
{
// PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
__name_native = __name_native__marshaller.ToUnmanaged();
global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
__retVal_native = __PInvoke(__name_native, isReadonly);
__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
}
__invokeSucceeded = true;
// UnmarshalCapture - Capture the native data into marshaller instances in case conversion to managed data throws an exception.
__retVal_native__marshaller.FromUnmanaged(__retVal_native);
// Unmarshal - Convert native data to managed data.
__retVal = __retVal_native__marshaller.ToManaged();
}
finally
{
if (__invokeSucceeded)
{
// CleanupCalleeAllocated - Perform cleanup of callee allocated resources.
__retVal_native__marshaller.Free();
}
// CleanupCallerAllocated - Perform cleanup of caller allocated resources.
__name_native__marshaller.Free();
}
global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
return __retVal;
// Local P/Invoke
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_MemfdCreate", ExactSpelling = true)]
static extern unsafe nint __PInvoke(byte* __name_native, int __isReadonly_native);
}
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class Sys
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "42.42.42.42")]
private static partial int MemfdSupportedImpl()
{
int __lastError;
int __retVal;
{
global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
__retVal = __PInvoke();
__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
}
global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
return __retVal;
// Local P/Invoke
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_IsMemfdSupported", ExactSpelling = true)]
static extern unsafe int __PInvoke();
}
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class Sys
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "42.42.42.42")]
internal static partial int Unlink(string pathname)
{
int __lastError;
byte* __pathname_native = default;
int __retVal = default;
// Setup - Perform required setup.
scoped global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn __pathname_native__marshaller = new();
try
{
// Marshal - Convert managed data to native data.
__pathname_native__marshaller.FromManaged(pathname, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize]);
{
// PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
__pathname_native = __pathname_native__marshaller.ToUnmanaged();
global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
__retVal = __PInvoke(__pathname_native);
__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
}
}
finally
{
// CleanupCallerAllocated - Perform cleanup of caller allocated resources.
__pathname_native__marshaller.Free();
}
global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
return __retVal;
// Local P/Invoke
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_Unlink", ExactSpelling = true)]
static extern unsafe int __PInvoke(byte* __pathname_native);
}
}
}
|