commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r1098954 - in /commons/sandbox/runtime/trunk/src/main/native/os: unix/platform.c win32/platform.c
Date Tue, 03 May 2011 07:59:30 GMT
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);
 }
 



Mime
View raw message