Skip to content

Commit de8dd0d

Browse files
authored
Fix posix Task for cases where _SC_PAGESIZE is undefined (nasa#2995)
1 parent 6d42c26 commit de8dd0d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Os/Posix/Task.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,13 @@ namespace Task {
3232
PlatformIntType set_stack_size(pthread_attr_t& attributes, const Os::Task::Arguments& arguments) {
3333
PlatformIntType status = PosixTaskHandle::SUCCESS;
3434
FwSizeType stack = arguments.m_stackSize;
35-
// Check for stack size multiple of page size
35+
// Check for stack size multiple of page size or skip when the function
36+
// is unavailable.
37+
#ifdef _SC_PAGESIZE
3638
long page_size = sysconf(_SC_PAGESIZE);
39+
#else
40+
long page_size = -1; // Force skip and warning
41+
#endif
3742
if (page_size <= 0) {
3843
Fw::Logger::log(
3944
"[WARNING] %s could not determine page size %s. Skipping stack-size check.\n",

0 commit comments

Comments
 (0)