Make use of setrlimit conditional on ABC_NO_RLIMIT.

This is useful for POSIX-like platforms that do not have rlimit,
such as WASI.
This commit is contained in:
whitequark 2019-11-11 08:25:56 +00:00
parent f2316ab7c8
commit 8afd927d60
1 changed files with 2 additions and 2 deletions

View File

@ -132,7 +132,7 @@ int Abc_RealMain( int argc, char * argv[] )
break;
case 'm': {
#ifndef WIN32
#if !defined(WIN32) && !defined(ABC_NO_RLIMIT)
int maxMb = atoi(globalUtilOptarg);
printf("Limiting memory use to %d MB\n", maxMb);
struct rlimit limit = {
@ -144,7 +144,7 @@ int Abc_RealMain( int argc, char * argv[] )
break;
}
case 'l': {
#ifndef WIN32
#if !defined(WIN32) && !defined(ABC_NO_RLIMIT)
rlim_t maxTime = atoi(globalUtilOptarg);
printf("Limiting time to %d seconds\n", (int)maxTime);
struct rlimit limit = {