some windows rlimits

This commit is contained in:
Doug MacEachern 2005-07-08 01:49:18 +00:00
parent 6debd2fefa
commit d45e112ba4
1 changed files with 15 additions and 1 deletions

View File

@ -753,7 +753,21 @@ SIGAR_DECLARE(int) sigar_who_list_get(sigar_t *sigar,
SIGAR_DECLARE(int) sigar_resource_limit_get(sigar_t *sigar,
sigar_resource_limit_t *rlimit)
{
return SIGAR_ENOTIMPL;
MEMORY_BASIC_INFORMATION meminfo;
memset(rlimit, -1, sizeof(*rlimit));
if (VirtualQuery((LPCVOID)&meminfo, &meminfo, sizeof(meminfo))) {
rlimit->stack_cur =
(DWORD)&meminfo - (DWORD)meminfo.AllocationBase;
rlimit->stack_max =
((DWORD)meminfo.BaseAddress + meminfo.RegionSize) -
(DWORD)meminfo.AllocationBase;
}
rlimit->virtual_memory_max = rlimit->virtual_memory_cur =
0x80000000UL;
return SIGAR_OK;
}
#else