diff options
-rw-r--r-- | include/win/unistd.h | 3 | ||||
-rw-r--r-- | src/win/pal-single-threaded.c | 12 |
2 files changed, 15 insertions, 0 deletions
diff --git a/include/win/unistd.h b/include/win/unistd.h index 1a3aee5d..d4ff2278 100644 --- a/include/win/unistd.h +++ b/include/win/unistd.h @@ -24,5 +24,8 @@ int getpagesize(void); int open(const char *, int, ...); ssize_t read(int fd, void *buf, size_t count); ssize_t write(int, const void *, size_t); +long sysconf(int name); + +#define _SC_PAGESIZE 11 #endif // _MSC_VER diff --git a/src/win/pal-single-threaded.c b/src/win/pal-single-threaded.c index e504d50c..8c8921e0 100644 --- a/src/win/pal-single-threaded.c +++ b/src/win/pal-single-threaded.c @@ -32,6 +32,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include <sys/mman.h> #include <sys/stat.h> #include <unistd.h> +#include <errno.h> #include "libunwind_i.h" #include "compiler.h" @@ -42,6 +43,17 @@ int getpagesize(void) return 4096; } +long sysconf(int name) +{ + if (name == _SC_PAGESIZE) + { + return getpagesize(); + } + + errno = EINVAL; + return -1; +} + void* mmap(void *addr, size_t length, int prot, int flags, int fd, size_t offset) { // We shouldn't be doing anything other than anonymous mappings |