Skip to content

Commit

Permalink
Fix posix Task for cases where _SC_PAGESIZE is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
LeStarch committed Oct 17, 2024
1 parent 3c5fd74 commit 26c520d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Os/Posix/Task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,13 @@ namespace Task {
PlatformIntType set_stack_size(pthread_attr_t& attributes, const Os::Task::Arguments& arguments) {
PlatformIntType status = PosixTaskHandle::SUCCESS;
FwSizeType stack = arguments.m_stackSize;
// Check for stack size multiple of page size
// Check for stack size multiple of page size or skip when the function
// is unavailable.
#ifdef _SC_PAGESIZE
long page_size = sysconf(_SC_PAGESIZE);
#else
long page_size = -1; // Force skip and warning
#endif
if (page_size <= 0) {
Fw::Logger::log(
"[WARNING] %s could not determine page size %s. Skipping stack-size check.\n",
Expand Down

0 comments on commit 26c520d

Please sign in to comment.