You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2011/05/03 09:59:30 UTC
svn commit: r1098954 - in /commons/sandbox/runtime/trunk/src/main/native/os:
unix/platform.c win32/platform.c
Author: mturk
Date: Tue May 3 07:59:30 2011
New Revision: 1098954
URL: http://svn.apache.org/viewvc?rev=1098954&view=rev
Log:
Get info about rlimit NOFILE
Modified:
commons/sandbox/runtime/trunk/src/main/native/os/unix/platform.c
commons/sandbox/runtime/trunk/src/main/native/os/win32/platform.c
Modified: commons/sandbox/runtime/trunk/src/main/native/os/unix/platform.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/unix/platform.c?rev=1098954&r1=1098953&r2=1098954&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/unix/platform.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/unix/platform.c Tue May 3 07:59:30 2011
@@ -25,6 +25,10 @@ extern int acr_native_codepage;
ACR_JNI_EXPORT(void, Platform, init0)(JNI_STDARGS, jint cp, jlongArray p)
{
jlong sa[16];
+#if HAVE_SETRLIMIT
+ struct rlimit r;
+#endif
+
UNREFERENCED_STDARGS;
acr_native_codepage = cp;
@@ -58,6 +62,15 @@ ACR_JNI_EXPORT(void, Platform, init0)(JN
#else
sa[12] = SIZE_T_MAX;
#endif
+#if HAVE_SETRLIMIT
+#ifdef RLIMIT_NOFILE
+ if (getrlimit(RLIMIT_NOFILE, &r) == 0)
+ sa[13] = r.rlim_max;
+ else
+#endif
+ sa[13] = 0;
+#endif
+
(*env)->SetLongArrayRegion(env, p, 0, 16, sa);
}
Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/platform.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/platform.c?rev=1098954&r1=1098953&r2=1098954&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/platform.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/platform.c Tue May 3 07:59:30 2011
@@ -51,7 +51,7 @@ ACR_JNI_EXPORT(void, Platform, init0)(JN
sa[10] = SIZE_T_MAX;
sa[11] = sa[8];
sa[12] = SIZE_T_MAX;
-
+ sa[13] = 0;
(*env)->SetLongArrayRegion(env, p, 0, 16, sa);
}