Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit f09c828

Browse files
committed
Rename System.IO.Native to System.Native
Rationale: Moving forward, we'll use System.Native for anything that is specified as part of POSIX.
1 parent c47d44a commit f09c828

File tree

12 files changed

+33
-38
lines changed

12 files changed

+33
-38
lines changed

src/Common/src/Interop/Linux/libc/Interop.inotify.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ internal static int inotify_rm_watch(int fd, int wd)
2222
int result = Interop.libc.inotify_rm_watch_extern(fd, wd);
2323
if (result < 0)
2424
{
25-
int hr = System.Runtime.InteropServices.Marshal.GetLastWin32Error();
25+
int hr = global::System.Runtime.InteropServices.Marshal.GetLastWin32Error();
2626
if (hr == Interop.Errors.EINVAL)
2727
{
2828
// This specific case means that there was a deleted event in the queue that was not processed
@@ -32,7 +32,7 @@ internal static int inotify_rm_watch(int fd, int wd)
3232
}
3333
else
3434
{
35-
System.Diagnostics.Debug.Fail("inotify_rm_watch failed with " + hr);
35+
global::System.Diagnostics.Debug.Fail("inotify_rm_watch failed with " + hr);
3636
}
3737
}
3838

src/Common/src/Interop/Unix/Interop.Libraries.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ internal static partial class Interop
66
private static partial class Libraries
77
{
88
internal const string CryptoInterop = "System.Security.Cryptography.Native";
9-
internal const string IOInterop = "System.IO.Native";
109
internal const string Libc = "libc"; // C library
1110
internal const string LibCoreClr= "libcoreclr"; // CoreCLR runtime
1211
internal const string LibCrypto = "libcrypto"; // OpenSSL crypto library
1312
internal const string LibCurl = "libcurl"; // Curl HTTP client library
1413
internal const string Zlib = "libz"; // zlib compression library
14+
internal const string SystemNative = "System.Native";
1515
}
1616
}

src/Common/src/Interop/Unix/System.IO.Native/Interop.NativeIO.cs renamed to src/Common/src/Interop/Unix/System.Native/Interop.Stat.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
internal static partial class Interop
88
{
9-
internal static partial class NativeIO
9+
internal static partial class System
1010
{
1111
internal struct FileStats
1212
{
@@ -38,13 +38,13 @@ internal enum FileStatsFlags
3838
HasCreationTime = 1,
3939
}
4040

41-
[DllImport(Libraries.IOInterop, SetLastError = true)]
41+
[DllImport(Libraries.SystemNative, SetLastError = true)]
4242
internal static extern int FStat(int fileDescriptor, out FileStats output);
4343

44-
[DllImport(Libraries.IOInterop, SetLastError = true)]
44+
[DllImport(Libraries.SystemNative, SetLastError = true)]
4545
internal static extern int Stat(string path, out FileStats output);
4646

47-
[DllImport(Libraries.IOInterop, SetLastError = true)]
47+
[DllImport(Libraries.SystemNative, SetLastError = true)]
4848
internal static extern int LStat(string path, out FileStats output);
4949
}
5050
}

src/Native/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ endif ()
3333

3434
include(configure.cmake)
3535

36-
add_subdirectory(System.IO.Native)
36+
add_subdirectory(System.Native)
3737
add_subdirectory(System.Security.Cryptography.Native)

src/Native/System.IO.Native/CMakeLists.txt

Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
project(System.Native)
2+
3+
set(NATIVE_SOURCES
4+
pal_stat.cpp
5+
)
6+
7+
add_library(System.Native
8+
SHARED
9+
${NATIVE_SOURCES}
10+
)
11+
12+
install (TARGETS System.Native DESTINATION .)

src/Native/System.IO.Native/nativeio.cpp renamed to src/Native/System.Native/pal_stat.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55

66
#include "../config.h"
7-
#include "nativeio.h"
7+
#include "pal_stat.h"
88
#include <sys/stat.h>
99

1010
#if HAVE_STAT64

src/Native/System.IO.Native/nativeio.h renamed to src/Native/System.Native/pal_stat.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
//
21
// Copyright (c) Microsoft. All rights reserved.
32
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
4-
//
53

64
#pragma once
75

src/System.Console/src/System.Console.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@
138138
<Compile Include="$(CommonPath)\Interop\Unix\libcoreclr\Interop.GetFileInformation.cs">
139139
<Link>Common\Interop\Unix\Interop.GetFileInformation.cs"</Link>
140140
</Compile>
141-
<Compile Include="$(CommonPath)\Interop\Unix\System.IO.Native\Interop.NativeIO.cs">
142-
<Link>Common\Interop\Unix\Interop.NativeIO.cs"</Link>
141+
<Compile Include="$(CommonPath)\Interop\Unix\System.Native\Interop.Stat.cs">
142+
<Link>Common\Interop\Unix\Interop.Stat.cs</Link>
143143
</Compile>
144144
<Compile Include="$(CommonPath)\Interop\Unix\libcoreclr\Interop.SetConsoleCtrlHandler.cs">
145145
<Link>Common\Interop\Unix\Interop.SetConsoleCtrlHandler.cs"</Link>

src/System.Console/src/System/ConsolePal.Unix.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ private static bool ConsoleOutIsTerminal
9191
UnixConsoleStream ucs = sw.BaseStream as UnixConsoleStream;
9292
if (ucs != null)
9393
{
94-
return ucs._handleType == Interop.NativeIO.FileTypes.S_IFCHR;
94+
return ucs._handleType == Interop.System.FileTypes.S_IFCHR;
9595
}
9696
}
9797
}
@@ -378,11 +378,11 @@ internal UnixConsoleStream(string devPath, FileAccess access)
378378
try
379379
{
380380
_handle.DangerousAddRef(ref gotFd);
381-
Interop.NativeIO.FileStats buf;
381+
Interop.System.FileStats buf;
382382
_handleType =
383-
Interop.NativeIO.FStat((int)_handle.DangerousGetHandle(), out buf) == 0 ?
384-
(buf.Mode & Interop.NativeIO.FileTypes.S_IFMT) :
385-
Interop.NativeIO.FileTypes.S_IFREG; // if something goes wrong, don't fail, just say it's a regular file
383+
Interop.System.FStat((int)_handle.DangerousGetHandle(), out buf) == 0 ?
384+
(buf.Mode & Interop.System.FileTypes.S_IFMT) :
385+
Interop.System.FileTypes.S_IFREG; // if something goes wrong, don't fail, just say it's a regular file
386386
}
387387
finally
388388
{

0 commit comments

Comments
 (0)