1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-02-04 13:32:19 +00:00

(win32) Add getpagesize() and getregionsize() implementations

This commit is contained in:
Mukund Sivaraman 2008-09-05 14:32:32 +00:00
parent 07101de87e
commit c149fc1d27

View file

@ -661,6 +661,27 @@ static int slrelease (LONG *sl) {
return 0;
}
/* getpagesize for windows */
static long getpagesize (void) {
static long g_pagesize = 0;
if (! g_pagesize) {
SYSTEM_INFO system_info;
GetSystemInfo (&system_info);
g_pagesize = system_info.dwPageSize;
}
return g_pagesize;
}
static long getregionsize (void) {
static long g_regionsize = 0;
if (! g_regionsize) {
SYSTEM_INFO system_info;
GetSystemInfo (&system_info);
g_regionsize = system_info.dwAllocationGranularity;
}
return g_regionsize;
}
void *mmap (void *ptr, long size, long prot, long type, long handle, long arg) {
static long g_pagesize;
static long g_regionsize;