summaryrefslogtreecommitdiff
path: root/src/mscorlib/corefx/Interop/Unix/System.Native
diff options
context:
space:
mode:
authorJiyoung Yun <jy910.yun@samsung.com>2017-04-13 14:17:19 +0900
committerJiyoung Yun <jy910.yun@samsung.com>2017-04-13 14:17:19 +0900
commita56e30c8d33048216567753d9d3fefc2152af8ac (patch)
tree7e5d979695fc4a431740982eb1cfecc2898b23a5 /src/mscorlib/corefx/Interop/Unix/System.Native
parent4b11dc566a5bbfa1378d6266525c281b028abcc8 (diff)
downloadcoreclr-a56e30c8d33048216567753d9d3fefc2152af8ac.tar.gz
coreclr-a56e30c8d33048216567753d9d3fefc2152af8ac.tar.bz2
coreclr-a56e30c8d33048216567753d9d3fefc2152af8ac.zip
Imported Upstream version 2.0.0.11353upstream/2.0.0.11353
Diffstat (limited to 'src/mscorlib/corefx/Interop/Unix/System.Native')
-rw-r--r--src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Close.cs15
-rw-r--r--src/mscorlib/corefx/Interop/Unix/System.Native/Interop.FLock.cs31
-rw-r--r--src/mscorlib/corefx/Interop/Unix/System.Native/Interop.FSync.cs15
-rw-r--r--src/mscorlib/corefx/Interop/Unix/System.Native/Interop.FTruncate.cs15
-rw-r--r--src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Fcntl.cs21
-rw-r--r--src/mscorlib/corefx/Interop/Unix/System.Native/Interop.GetCwd.cs74
-rw-r--r--src/mscorlib/corefx/Interop/Unix/System.Native/Interop.GetUnixName.cs21
-rw-r--r--src/mscorlib/corefx/Interop/Unix/System.Native/Interop.LSeek.cs22
-rw-r--r--src/mscorlib/corefx/Interop/Unix/System.Native/Interop.MksTemps.cs17
-rw-r--r--src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Open.cs15
-rw-r--r--src/mscorlib/corefx/Interop/Unix/System.Native/Interop.OpenFlags.cs27
-rw-r--r--src/mscorlib/corefx/Interop/Unix/System.Native/Interop.PathConf.cs73
-rw-r--r--src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Permissions.cs32
-rw-r--r--src/mscorlib/corefx/Interop/Unix/System.Native/Interop.PosixFAdvise.cs36
-rw-r--r--src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Read.cs25
-rw-r--r--src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Stat.cs59
-rw-r--r--src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Unlink.cs15
-rw-r--r--src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Write.cs27
18 files changed, 0 insertions, 540 deletions
diff --git a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Close.cs b/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Close.cs
deleted file mode 100644
index 8d192398a0..0000000000
--- a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Close.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-// 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_Close", SetLastError = true)]
- internal static extern int Close(IntPtr fd);
- }
-}
diff --git a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.FLock.cs b/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.FLock.cs
deleted file mode 100644
index 22934a3e77..0000000000
--- a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.FLock.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-// 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;
-using Microsoft.Win32.SafeHandles;
-
-internal static partial class Interop
-{
- internal static partial class Sys
- {
- internal enum LockOperations : int
- {
- LOCK_SH = 1, /* shared lock */
- LOCK_EX = 2, /* exclusive lock */
- LOCK_NB = 4, /* don't block when locking*/
- LOCK_UN = 8, /* unlock */
- }
-
- [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FLock", SetLastError = true)]
- internal static extern int FLock(SafeFileHandle fd, LockOperations operation);
-
- /// <summary>
- /// Exposing this for SafeFileHandle.ReleaseHandle() to call.
- /// Normal callers should use FLock(SafeFileHandle fd).
- /// </summary>
- [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FLock", SetLastError = true)]
- internal static extern int FLock(IntPtr fd, LockOperations operation);
- }
-}
diff --git a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.FSync.cs b/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.FSync.cs
deleted file mode 100644
index e3ab970931..0000000000
--- a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.FSync.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-// 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.Runtime.InteropServices;
-using Microsoft.Win32.SafeHandles;
-
-internal static partial class Interop
-{
- internal static partial class Sys
- {
- [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FSync", SetLastError = true)]
- internal static extern int FSync(SafeFileHandle fd);
- }
-}
diff --git a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.FTruncate.cs b/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.FTruncate.cs
deleted file mode 100644
index 5dad650362..0000000000
--- a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.FTruncate.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-// 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.Runtime.InteropServices;
-using Microsoft.Win32.SafeHandles;
-
-internal static partial class Interop
-{
- internal static partial class Sys
- {
- [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FTruncate", SetLastError = true)]
- internal static extern int FTruncate(SafeFileHandle fd, long length);
- }
-}
diff --git a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Fcntl.cs b/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Fcntl.cs
deleted file mode 100644
index 23b48a4f5d..0000000000
--- a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Fcntl.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-// 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
- {
- internal enum LockType : short
- {
- F_WRLCK = 1, // exclusive or write lock
- F_UNLCK = 2 // unlock
- }
-
- [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LockFileRegion", SetLastError=true)]
- internal static extern int LockFileRegion(SafeHandle fd, long offset, long length, LockType lockType);
- }
-}
diff --git a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.GetCwd.cs b/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.GetCwd.cs
deleted file mode 100644
index 724e342342..0000000000
--- a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.GetCwd.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-// 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_GetCwd", SetLastError = true)]
- private static unsafe extern byte* GetCwd(byte* buffer, int bufferLength);
-
- internal static unsafe string GetCwd()
- {
- const int StackLimit = 256;
-
- // First try to get the path into a buffer on the stack
- byte* stackBuf = stackalloc byte[StackLimit];
- string result = GetCwdHelper(stackBuf, StackLimit);
- if (result != null)
- {
- return result;
- }
-
- // If that was too small, try increasing large buffer sizes
- // until we get one that works or until we hit MaxPath.
- int maxPath = Interop.Sys.MaxPath;
- if (StackLimit < maxPath)
- {
- int bufferSize = StackLimit;
- do
- {
- checked { bufferSize *= 2; }
- var buf = new byte[Math.Min(bufferSize, maxPath)];
- fixed (byte* ptr = buf)
- {
- result = GetCwdHelper(ptr, buf.Length);
- if (result != null)
- {
- return result;
- }
- }
- }
- while (bufferSize < maxPath);
- }
-
- // If we couldn't get the cwd with a MaxPath-sized buffer, something's wrong.
- throw Interop.GetExceptionForIoErrno(new ErrorInfo(Interop.Error.ENAMETOOLONG));
- }
-
- private static unsafe string GetCwdHelper(byte* ptr, int bufferSize)
- {
- // Call the real getcwd
- byte* result = GetCwd(ptr, bufferSize);
-
- // If it returned non-null, the null-terminated path is in the buffer
- if (result != null)
- {
- return Marshal.PtrToStringAnsi((IntPtr)ptr);
- }
-
- // Otherwise, if it failed due to the buffer being too small, return null;
- // for anything else, throw.
- ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo();
- if (errorInfo.Error == Interop.Error.ERANGE)
- {
- return null;
- }
- throw Interop.GetExceptionForIoErrno(errorInfo);
- }
- }
-}
diff --git a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.GetUnixName.cs b/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.GetUnixName.cs
deleted file mode 100644
index 33664c4d39..0000000000
--- a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.GetUnixName.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-// 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_GetUnixName")]
- private static extern IntPtr GetUnixNamePrivate();
-
- internal static string GetUnixName()
- {
- IntPtr ptr = GetUnixNamePrivate();
- return Marshal.PtrToStringAnsi(ptr);
- }
- }
-}
diff --git a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.LSeek.cs b/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.LSeek.cs
deleted file mode 100644
index 7f8df7c6bf..0000000000
--- a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.LSeek.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-// 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.Runtime.InteropServices;
-using Microsoft.Win32.SafeHandles;
-
-internal static partial class Interop
-{
- internal static partial class Sys
- {
- internal enum SeekWhence
- {
- SEEK_SET = 0,
- SEEK_CUR = 1,
- SEEK_END = 2
- }
-
- [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LSeek", SetLastError = true)]
- internal static extern long LSeek(SafeFileHandle fd, long offset, SeekWhence whence);
- }
-}
diff --git a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.MksTemps.cs b/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.MksTemps.cs
deleted file mode 100644
index b8694d9007..0000000000
--- a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.MksTemps.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-// 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_MksTemps", SetLastError = true)]
- internal static extern IntPtr MksTemps(
- byte[] template,
- int suffixlen);
- }
-}
diff --git a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Open.cs b/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Open.cs
deleted file mode 100644
index a9a994c78c..0000000000
--- a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Open.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-// 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.Runtime.InteropServices;
-using Microsoft.Win32.SafeHandles;
-
-internal static partial class Interop
-{
- internal static partial class Sys
- {
- [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Open", SetLastError = true)]
- internal static extern SafeFileHandle Open(string filename, OpenFlags flags, int mode);
- }
-}
diff --git a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.OpenFlags.cs b/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.OpenFlags.cs
deleted file mode 100644
index f9e54c3cbc..0000000000
--- a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.OpenFlags.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-// 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;
-
-internal static partial class Interop
-{
- internal static partial class Sys
- {
- [Flags]
- internal enum OpenFlags
- {
- // Access modes (mutually exclusive)
- O_RDONLY = 0x0000,
- O_WRONLY = 0x0001,
- O_RDWR = 0x0002,
-
- // Flags (combinable)
- O_CLOEXEC = 0x0010,
- O_CREAT = 0x0020,
- O_EXCL = 0x0040,
- O_TRUNC = 0x0080,
- O_SYNC = 0x0100,
- }
- }
-}
diff --git a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.PathConf.cs b/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.PathConf.cs
deleted file mode 100644
index 4a1fcf67d0..0000000000
--- a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.PathConf.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-// 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
- {
- internal static int DEFAULT_PC_NAME_MAX = 255;
-
- internal enum PathConfName : int
- {
- PC_LINK_MAX = 1,
- PC_MAX_CANON = 2,
- PC_MAX_INPUT = 3,
- PC_NAME_MAX = 4,
- PC_PATH_MAX = 5,
- PC_PIPE_BUF = 6,
- PC_CHOWN_RESTRICTED = 7,
- PC_NO_TRUNC = 8,
- PC_VDISABLE = 9,
- }
-
- /// <summary>The maximum path length for the system. -1 if it hasn't yet been initialized.</summary>
- private static int s_maxPath = -1;
-
- /// <summary>The maximum name length for the system. -1 if it hasn't yet been initialized.</summary>
- private static int s_maxName = -1;
-
- internal static int MaxPath
- {
- get
- {
- // Benign race condition on cached value
- if (s_maxPath < 0)
- {
- // GetMaximumPath returns a long from PathConf
- // but our callers expect an int so we need to convert.
- long temp = GetMaximumPath();
- if (temp > int.MaxValue)
- s_maxPath = int.MaxValue;
- else
- s_maxPath = Convert.ToInt32(temp);
- }
- return s_maxPath;
- }
- }
-
- internal static int MaxName
- {
- get
- {
- // Benign race condition on cached value
- if (s_maxName < 0)
- {
- int result = PathConf("/", PathConfName.PC_NAME_MAX);
- s_maxName = result >= 0 ? result : DEFAULT_PC_NAME_MAX;
- }
-
- return s_maxName;
- }
- }
-
- [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_PathConf", SetLastError = true)]
- private static extern int PathConf(string path, PathConfName name);
-
- [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetMaximumPath")]
- private static extern long GetMaximumPath();
- }
-}
diff --git a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Permissions.cs b/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Permissions.cs
deleted file mode 100644
index f1d13787d2..0000000000
--- a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Permissions.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-// 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;
-
-internal static partial class Interop
-{
- internal static partial class Sys
- {
- [Flags]
- internal enum Permissions
- {
- Mask = S_IRWXU | S_IRWXG | S_IRWXO,
-
- S_IRWXU = S_IRUSR | S_IWUSR | S_IXUSR,
- S_IRUSR = 0x100,
- S_IWUSR = 0x80,
- S_IXUSR = 0x40,
-
- S_IRWXG = S_IRGRP | S_IWGRP | S_IXGRP,
- S_IRGRP = 0x20,
- S_IWGRP = 0x10,
- S_IXGRP = 0x8,
-
- S_IRWXO = S_IROTH | S_IWOTH | S_IXOTH,
- S_IROTH = 0x4,
- S_IWOTH = 0x2,
- S_IXOTH = 0x1,
- }
- }
-}
diff --git a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.PosixFAdvise.cs b/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.PosixFAdvise.cs
deleted file mode 100644
index 69e39b30d2..0000000000
--- a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.PosixFAdvise.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-// 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.Runtime.InteropServices;
-using Microsoft.Win32.SafeHandles;
-
-internal static partial class Interop
-{
- internal static partial class Sys
- {
- internal enum FileAdvice : int
- {
- POSIX_FADV_NORMAL = 0, /* no special advice, the default value */
- POSIX_FADV_RANDOM = 1, /* random I/O access */
- POSIX_FADV_SEQUENTIAL = 2, /* sequential I/O access */
- POSIX_FADV_WILLNEED = 3, /* will need specified pages */
- POSIX_FADV_DONTNEED = 4, /* don't need the specified pages */
- POSIX_FADV_NOREUSE = 5, /* data will only be acessed once */
- }
-
- /// <summary>
- /// Notifies the OS kernel that the specified file will be accessed in a particular way soon; this allows the kernel to
- /// potentially optimize the access pattern of the file.
- /// </summary>
- /// <param name="fd">The file descriptor of the file</param>
- /// <param name="offset">The start of the region to advise about</param>
- /// <param name="length">The number of bytes of the region (until the end of the file if 0)</param>
- /// <param name="advice">The type of advice to give the kernel about the specified region</param>
- /// <returns>
- /// Returns 0 on success; otherwise, the error code is returned
- /// </returns>
- [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_PosixFAdvise", SetLastError = false /* this is explicitly called out in the man page */)]
- internal static extern int PosixFAdvise(SafeFileHandle fd, long offset, long length, FileAdvice advice);
- }
-}
diff --git a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Read.cs b/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Read.cs
deleted file mode 100644
index 812ae348dc..0000000000
--- a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Read.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-// 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.Runtime.InteropServices;
-using Microsoft.Win32.SafeHandles;
-
-internal static partial class Interop
-{
- internal static partial class Sys
- {
- /// <summary>
- /// Reads a number of bytes from an open file descriptor into a specified buffer.
- /// </summary>
- /// <param name="fd">The open file descriptor to try to read from</param>
- /// <param name="buffer">The buffer to read info into</param>
- /// <param name="count">The size of the buffer</param>
- /// <returns>
- /// Returns the number of bytes read on success; otherwise, -1 is returned
- /// Note - on fail. the position of the stream may change depending on the platform; consult man 2 read for more info
- /// </returns>
- [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Read", SetLastError = true)]
- internal static unsafe extern int Read(SafeFileHandle fd, byte* buffer, int count);
- }
-}
diff --git a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Stat.cs b/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Stat.cs
deleted file mode 100644
index a8bc2ec7d1..0000000000
--- a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Stat.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-// 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;
-using Microsoft.Win32.SafeHandles;
-
-internal static partial class Interop
-{
- internal static partial class Sys
- {
- // Even though csc will by default use a sequential layout, a CS0649 warning as error
- // is produced for un-assigned fields when no StructLayout is specified.
- //
- // Explicitly saying Sequential disables that warning/error for consumers which only
- // use Stat in debug builds.
- [StructLayout(LayoutKind.Sequential)]
- internal struct FileStatus
- {
- internal FileStatusFlags Flags;
- internal int Mode;
- internal uint Uid;
- internal uint Gid;
- internal long Size;
- internal long ATime;
- internal long MTime;
- internal long CTime;
- internal long BirthTime;
- }
-
- internal static class FileTypes
- {
- internal const int S_IFMT = 0xF000;
- internal const int S_IFIFO = 0x1000;
- internal const int S_IFCHR = 0x2000;
- internal const int S_IFDIR = 0x4000;
- internal const int S_IFREG = 0x8000;
- internal const int S_IFLNK = 0xA000;
- internal const int S_IFSOCK = 0xC000;
- }
-
- [Flags]
- internal enum FileStatusFlags
- {
- None = 0,
- HasBirthTime = 1,
- }
-
- [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FStat", SetLastError = true)]
- internal static extern int FStat(SafeFileHandle fd, out FileStatus output);
-
- [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Stat", SetLastError = true)]
- internal static extern int Stat(string path, out FileStatus output);
-
- [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LStat", SetLastError = true)]
- internal static extern int LStat(string path, out FileStatus output);
- }
-}
diff --git a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Unlink.cs b/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Unlink.cs
deleted file mode 100644
index 829210fa7e..0000000000
--- a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Unlink.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-// 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_Unlink", SetLastError = true)]
- internal static extern int Unlink(string pathname);
- }
-}
diff --git a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Write.cs b/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Write.cs
deleted file mode 100644
index c14fc26263..0000000000
--- a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Write.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-// 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.Runtime.InteropServices;
-using Microsoft.Win32.SafeHandles;
-
-internal static partial class Interop
-{
- internal static partial class Sys
- {
- /// <summary>
- /// Writes the specified buffer to the provided open file descriptor
- /// </summary>
- /// <param name="fd">The file descriptor to try and write to</param>
- /// <param name="buffer">The data to attempt to write</param>
- /// <param name="bufferSize">The amount of data to write, in bytes</param>
- /// <returns>
- /// Returns the number of bytes written on success; otherwise, returns -1 and sets errno
- /// </returns>
- [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Write", SetLastError = true)]
- internal static unsafe extern int Write(SafeFileHandle fd, byte* buffer, int bufferSize);
-
- [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Write", SetLastError = true)]
- internal static unsafe extern int Write(int fd, byte* buffer, int bufferSize);
- }
-}