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 31, 2023
1 parent bd39345 commit cbfbe89
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/os.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
# include <sys/stat.h>
# include <sys/types.h>

# ifdef _WRS_KERNEL //added VxWorks7 kernel support
# include <ioLib.h> // header file for getpagesize()
# endif

# ifndef _WIN32
# include <unistd.h>
# else
Expand Down Expand Up @@ -351,7 +355,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 cbfbe89

Please sign in to comment.