mirror of
https://github.com/fmtlib/fmt.git
synced 2025-07-30 10:47:35 +02:00
Add VxWorks7 user space and kernel space support (#3467)
This commit is contained in:
@ -18,6 +18,10 @@
|
|||||||
# include <sys/stat.h>
|
# include <sys/stat.h>
|
||||||
# include <sys/types.h>
|
# include <sys/types.h>
|
||||||
|
|
||||||
|
# ifdef _WRS_KERNEL //added VxWorks7 kernel support
|
||||||
|
# include <ioLib.h> // header file for getpagesize()
|
||||||
|
# endif
|
||||||
|
|
||||||
# ifndef _WIN32
|
# ifndef _WIN32
|
||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
# else
|
# else
|
||||||
@ -351,7 +355,12 @@ long getpagesize() {
|
|||||||
GetSystemInfo(&si);
|
GetSystemInfo(&si);
|
||||||
return si.dwPageSize;
|
return si.dwPageSize;
|
||||||
# else
|
# else
|
||||||
|
# ifdef _WRS_KERNEL
|
||||||
|
long size = FMT_POSIX_CALL(getpagesize());
|
||||||
|
# else
|
||||||
long size = FMT_POSIX_CALL(sysconf(_SC_PAGESIZE));
|
long size = FMT_POSIX_CALL(sysconf(_SC_PAGESIZE));
|
||||||
|
# endif
|
||||||
|
|
||||||
if (size < 0)
|
if (size < 0)
|
||||||
FMT_THROW(system_error(errno, FMT_STRING("cannot get memory page size")));
|
FMT_THROW(system_error(errno, FMT_STRING("cannot get memory page size")));
|
||||||
return size;
|
return size;
|
||||||
|
Reference in New Issue
Block a user