Skip to content

Commit

Permalink
Add VxWorks7 user space and kernel space support
Browse files Browse the repository at this point in the history
  • Loading branch information
wenshan1 committed May 30, 2023
1 parent bd39345 commit 530d959
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/os.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@

# ifndef _WIN32
# include <unistd.h>
# ifdef _WRS_KERNEL //added VxWorks7 kernel support
# include <ioLib.h>
# endif
# else
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
Expand Down Expand Up @@ -351,7 +354,12 @@ long getpagesize() {
GetSystemInfo(&si);
return si.dwPageSize;
# else
# ifdef _WRS_KERNEL
long size = FMT_POSIX_CALL(getpagesize());
# else
long size = FMT_POSIX_CALL(sysconf(_SC_PAGESIZE));
# endif

if (size < 0)
FMT_THROW(system_error(errno, FMT_STRING("cannot get memory page size")));
return size;
Expand Down

0 comments on commit 530d959

Please sign in to comment.