You've already forked linux-packaging-mono
Imported Upstream version 6.12.0.140
Former-commit-id: ed640e59d63de60be89ee9bbe5a6b63afcf639f5
This commit is contained in:
parent
611f410153
commit
3cbb9c7924
45
mcs/class/corlib/corefx/Interop.ReadDir.Mono.cs
Normal file
45
mcs/class/corlib/corefx/Interop.ReadDir.Mono.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
// 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.
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
internal static partial class Interop
|
||||
{
|
||||
internal static partial class Sys
|
||||
{
|
||||
[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_OpenDir", SetLastError = true)]
|
||||
internal static extern IntPtr OpenDir_native(string path);
|
||||
|
||||
[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadDirR", SetLastError = false)]
|
||||
internal static extern unsafe int ReadDirR_native(IntPtr dir, byte* buffer, int bufferSize, out DirectoryEntry outputEntry);
|
||||
|
||||
[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CloseDir", SetLastError = true)]
|
||||
internal static extern int CloseDir_native(IntPtr dir);
|
||||
|
||||
internal static IntPtr OpenDir (string path) {
|
||||
IntPtr result;
|
||||
do {
|
||||
result = OpenDir_native (path);
|
||||
} while (result == IntPtr.Zero && Marshal.GetLastWin32Error () == (int) Interop.Error.EINTR);
|
||||
return result;
|
||||
}
|
||||
|
||||
internal static int CloseDir (IntPtr dir) {
|
||||
int result;
|
||||
do {
|
||||
result = CloseDir_native (dir);
|
||||
} while (result < 0 && Marshal.GetLastWin32Error () == (int) Interop.Error.EINTR);
|
||||
return result;
|
||||
}
|
||||
|
||||
internal static unsafe int ReadDirR (IntPtr dir, byte* buffer, int bufferSize, out DirectoryEntry outputEntry) {
|
||||
int result;
|
||||
do {
|
||||
result = ReadDirR_native (dir, buffer, bufferSize, out outputEntry);
|
||||
} while (result == (int) Interop.Error.EINTR);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user