Skip to content

Commit 6c1ea12

Browse files
authored
Fix tests on QNX (#1865)
1 parent 47d2b2c commit 6c1ea12

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

test/common/memory_usage.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
2-
Copyright (c) 2005-2022 Intel Corporation
2+
Copyright (c) 2005-2025 Intel Corporation
3+
Copyright (c) 2025 UXL Foundation Contributors
34
45
Licensed under the Apache License, Version 2.0 (the "License");
56
you may not use this file except in compliance with the License.
@@ -93,7 +94,7 @@ namespace utils {
9394
bool status = GetProcessMemoryInfo(GetCurrentProcess(), &mem, sizeof(mem)) != 0;
9495
ASSERT(status, nullptr);
9596
return stat == currentUsage ? mem.PagefileUsage : mem.PeakPagefileUsage;
96-
#elif __unix__
97+
#elif __unix__ && !defined(__QNX__)
9798
long unsigned size = 0;
9899
FILE* fst = fopen("/proc/self/status", "r");
99100
ASSERT(fst != nullptr, nullptr);

test/conformance/conformance_resumable_tasks.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
2-
Copyright (c) 2020-2021 Intel Corporation
2+
Copyright (c) 2020-2025 Intel Corporation
3+
Copyright (c) 2025 UXL Foundation Contributors
34
45
Licensed under the Apache License, Version 2.0 (the "License");
56
you may not use this file except in compliance with the License.
@@ -16,7 +17,8 @@
1617

1718
#include "common/test.h"
1819

19-
#if (!__TBB_WIN8UI_SUPPORT && !defined(WINAPI_FAMILY) && !__ANDROID__)
20+
#if (!__TBB_WIN8UI_SUPPORT && !defined(WINAPI_FAMILY) && !__ANDROID__ \
21+
&& !__QNX__)
2022

2123
#include "oneapi/tbb/task.h"
2224
#include "oneapi/tbb/task_group.h"

test/tbb/test_eh_thread.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
22
Copyright (c) 2020-2025 Intel Corporation
3+
Copyright (c) 2025 UXL Foundation Contributors
34
45
Licensed under the Apache License, Version 2.0 (the "License");
56
you may not use this file except in compliance with the License.
@@ -45,19 +46,31 @@ void limitThreads(size_t limit)
4546
{
4647
rlimit rlim;
4748

49+
# ifdef __QNX__
50+
int ret = getrlimit(RLIMIT_NTHR, &rlim);
51+
# else
4852
int ret = getrlimit(RLIMIT_NPROC, &rlim);
53+
# endif
4954
CHECK_MESSAGE(0 == ret, "getrlimit has returned an error");
5055

5156
rlim.rlim_cur = (rlim.rlim_max == (rlim_t)RLIM_INFINITY) ? limit : utils::min((rlim_t)limit, rlim.rlim_max);
5257

58+
# ifdef __QNX__
59+
ret = setrlimit(RLIMIT_NTHR, &rlim);
60+
# else
5361
ret = setrlimit(RLIMIT_NPROC, &rlim);
62+
# endif
5463
CHECK_MESSAGE(0 == ret, "setrlimit has returned an error");
5564
}
5665

5766
size_t getThreadLimit() {
5867
rlimit rlim;
5968

69+
# ifdef __QNX__
70+
int ret = getrlimit(RLIMIT_NTHR, &rlim);
71+
# else
6072
int ret = getrlimit(RLIMIT_NPROC, &rlim);
73+
# endif
6174
CHECK_MESSAGE(0 == ret, "getrlimit has returned an error");
6275
return rlim.rlim_cur;
6376
}

0 commit comments

Comments
 (0)