Skip to content

Commit cc9ccb3

Browse files
committed
Rename OHOS identifiers to OPENHARMONY per review feedback
1 parent 9551262 commit cc9ccb3

6 files changed

Lines changed: 11 additions & 11 deletions

File tree

‎src/coreclr/gc/unix/numasupport.cpp‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include <limits.h>
1313
#include <minipal/utils.h>
1414

15-
#if defined(TARGET_LINUX) && !defined(TARGET_ANDROID) && !defined(TARGET_OHOS)
15+
#if defined(TARGET_LINUX) && !defined(TARGET_ANDROID) && !defined(TARGET_OPENHARMONY)
1616
#include <sys/syscall.h>
1717
#endif
1818

@@ -21,7 +21,7 @@ int g_highestNumaNode = 0;
2121
// Is numa available
2222
bool g_numaAvailable = false;
2323

24-
#if defined(TARGET_LINUX) && !defined(TARGET_ANDROID) && !defined(TARGET_OHOS)
24+
#if defined(TARGET_LINUX) && !defined(TARGET_ANDROID) && !defined(TARGET_OPENHARMONY)
2525
static int GetNodeNum(const char* path, bool firstOnly)
2626
{
2727
DIR *dir;
@@ -56,7 +56,7 @@ static int GetNodeNum(const char* path, bool firstOnly)
5656

5757
void NUMASupportInitialize()
5858
{
59-
#if defined(TARGET_LINUX) && !defined(TARGET_ANDROID) && !defined(TARGET_OHOS)
59+
#if defined(TARGET_LINUX) && !defined(TARGET_ANDROID) && !defined(TARGET_OPENHARMONY)
6060
if (syscall(__NR_get_mempolicy, NULL, NULL, 0, 0, 0) < 0)
6161
return;
6262

@@ -72,7 +72,7 @@ void NUMASupportInitialize()
7272

7373
int GetNumaNodeNumByCpu(int cpu)
7474
{
75-
#if defined(TARGET_LINUX) && !defined(TARGET_ANDROID) && !defined(TARGET_OHOS)
75+
#if defined(TARGET_LINUX) && !defined(TARGET_ANDROID) && !defined(TARGET_OPENHARMONY)
7676
char path[64];
7777
if (snprintf(path, sizeof(path), "/sys/devices/system/cpu/cpu%d", cpu) < 0)
7878
return -1;
@@ -85,7 +85,7 @@ int GetNumaNodeNumByCpu(int cpu)
8585

8686
long BindMemoryPolicy(void* start, unsigned long len, const unsigned long* nodemask, unsigned long maxnode)
8787
{
88-
#if defined(TARGET_LINUX) && !defined(TARGET_ANDROID) && !defined(TARGET_OHOS)
88+
#if defined(TARGET_LINUX) && !defined(TARGET_ANDROID) && !defined(TARGET_OPENHARMONY)
8989
return syscall(__NR_mbind, (long)start, len, 1, (long)nodemask, maxnode, 0);
9090
#else
9191
return -1;

‎src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
<DefineConstants Condition="'$(Targetsillumos)' == 'true'">$(DefineConstants);TARGET_ILLUMOS</DefineConstants>
5555
<DefineConstants Condition="'$(TargetsSolaris)' == 'true'">$(DefineConstants);TARGET_SOLARIS</DefineConstants>
5656
<DefineConstants Condition="'$(TargetsHaiku)' == 'true'">$(DefineConstants);TARGET_HAIKU</DefineConstants>
57-
<DefineConstants Condition="'$(TargetsOhos)' == 'true'">$(DefineConstants);TARGET_OHOS</DefineConstants>
57+
<DefineConstants Condition="'$(TargetOpenHarmony)' == 'true'">$(DefineConstants);TARGET_OPENHARMONY</DefineConstants>
5858
</PropertyGroup>
5959
<PropertyGroup>
6060
<DefineConstants Condition="'$(FeatureCrossProcessMutex)' == 'true'">$(DefineConstants);FEATURE_CROSS_PROCESS_MUTEX</DefineConstants>

‎src/libraries/System.Private.CoreLib/src/System/IO/SharedMemoryManager.Unix.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ private static string InitalizeSharedFilesPath()
415415
}
416416

417417
// On non-Apple platforms, shared memory files live under the process temp directory.
418-
#if TARGET_OHOS
418+
#if TARGET_OPENHARMONY
419419
// HarmonyOS (OpenHarmony) app sandboxes mount /tmp read-only, so use the process temp
420420
// directory (which honors TMPDIR on Unix and falls back to /tmp) for the .NET shared
421421
// memory files (named mutexes, etc.).

‎src/libraries/System.Private.CoreLib/src/System/OperatingSystem.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,8 @@ internal static bool IsHaiku() =>
224224
/// Indicates whether the current application is running on HarmonyOS (OpenHarmony).
225225
/// </summary>
226226
[NonVersionable]
227-
internal static bool IsOhos() =>
228-
#if TARGET_OHOS
227+
internal static bool IsOpenHarmony() =>
228+
#if TARGET_OPENHARMONY
229229
true;
230230
#else
231231
false;

‎src/libraries/System.Private.CoreLib/src/System/Threading/NamedMutex.Unix.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ internal abstract class NamedMutexProcessDataBase(SharedMemoryProcessDataHeader<
8282
// independently by the processes involved. See https://github.com/dotnet/runtime/issues/10519.
8383
// On OpenBSD, cross process mutexes are not supported in the pthread implementation. See https://github.com/dotnet/runtime/pull/125089.
8484
// On Haiku, robust mutexes are WIP. See https://github.com/dotnet/runtime/pull/126701#issuecomment-4334338213.
85-
private static bool UsePThreadMutexes => !OperatingSystem.IsApplePlatform() && !OperatingSystem.IsFreeBSD() && !OperatingSystem.IsOpenBSD() && !OperatingSystem.IsHaiku() && !OperatingSystem.IsOhos();
85+
private static bool UsePThreadMutexes => !OperatingSystem.IsApplePlatform() && !OperatingSystem.IsFreeBSD() && !OperatingSystem.IsOpenBSD() && !OperatingSystem.IsHaiku() && !OperatingSystem.IsOpenHarmony();
8686

8787
private readonly SharedMemoryProcessDataHeader<NamedMutexProcessDataBase> _processDataHeader = header;
8888
protected nuint _lockCount;

‎src/libraries/System.Threading/tests/MutexTests.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1044,7 +1044,7 @@ public void NamedMutex_OtherEvent_NotCompatible()
10441044
// on HarmonyOS, where it honors TMPDIR. Mirror the runtime's derivation so these tests
10451045
// always target the same directory the runtime uses.
10461046
private static string GlobalSharedMemoryDirectory =>
1047-
#if TARGET_OHOS
1047+
#if TARGET_OPENHARMONY
10481048
Path.Combine(Path.GetTempPath(), ".dotnet", "shm", "global");
10491049
#else
10501050
"/tmp/.dotnet/shm/global";

0 commit comments

Comments
 (0)