diff options
author | Jon Purdy <evincarofautumn@gmail.com> | 2017-10-03 04:07:14 +0300 |
---|---|---|
committer | Jon Purdy <evincarofautumn@gmail.com> | 2017-10-24 20:37:29 +0300 |
commit | 847aec71671c92699d39ca7d40c650ae67a34efa (patch) | |
tree | 0f6b668feac957b03e7802742b9c2890b5ec656d /mcs | |
parent | 0de5f203757e26d1ad73babf64df8109342c391b (diff) |
[coop-handles] System.IO.MonoIO.Open
Diffstat (limited to 'mcs')
-rw-r--r-- | mcs/class/corlib/System.IO/MonoIO.cs | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/mcs/class/corlib/System.IO/MonoIO.cs b/mcs/class/corlib/System.IO/MonoIO.cs index fb5423b88e5..e30460ca948 100644 --- a/mcs/class/corlib/System.IO/MonoIO.cs +++ b/mcs/class/corlib/System.IO/MonoIO.cs @@ -361,12 +361,26 @@ namespace System.IO // handle methods [MethodImplAttribute (MethodImplOptions.InternalCall)] - public extern static IntPtr Open (string filename, - FileMode mode, - FileAccess access, - FileShare share, - FileOptions options, - out MonoIOError error); + private unsafe extern static IntPtr Open (char* filename, + FileMode mode, + FileAccess access, + FileShare share, + FileOptions options, + out MonoIOError error); + + public static IntPtr Open (string filename, + FileMode mode, + FileAccess access, + FileShare share, + FileOptions options, + out MonoIOError error) + { + unsafe { + fixed (char* filenameChars = filename) { + return Open (filenameChars, mode, access, share, options, out error); + } + } + } [MethodImplAttribute (MethodImplOptions.InternalCall)] public extern static bool Close (IntPtr handle, |