Solaris 2.x does not have RLIMIT_RSS, check for this symbol (analog NetBSD below...
[oota-llvm.git] / lib / System / Unix / Program.inc
index 1fe25861e1e74fe5851f7fb2caf826e2b2341a3c..896e8090e707d767676dec3ac36642ab0445f9ff 100644 (file)
@@ -119,17 +119,19 @@ static void SetMemoryLimits (unsigned size)
   getrlimit (RLIMIT_DATA, &r);
   r.rlim_cur = limit;
   setrlimit (RLIMIT_DATA, &r);
-#ifndef __CYGWIN__
+#ifdef RLIMIT_RSS
   // Resident set size.
   getrlimit (RLIMIT_RSS, &r);
   r.rlim_cur = limit;
   setrlimit (RLIMIT_RSS, &r);
 #endif
+#ifdef RLIMIT_AS  // e.g. NetBSD doesn't have it.
   // Virtual memory.
   getrlimit (RLIMIT_AS, &r);
   r.rlim_cur = limit;
   setrlimit (RLIMIT_AS, &r);
 #endif
+#endif
 }
 
 int