summaryrefslogtreecommitdiffstats
path: root/lib/base/systhr.cpp
diff options
context:
space:
mode:
authorNoriko Hosoi <nhosoi@redhat.com>2006-02-28 03:00:14 +0000
committerNoriko Hosoi <nhosoi@redhat.com>2006-02-28 03:00:14 +0000
commit2ab1b4d64d3d2a718bade5161c2ec2c834111f7b (patch)
tree7458e68e56824d534f349c87bc51c3c23caeee16 /lib/base/systhr.cpp
parent0402bb5e22f9c422ce2942d0c07735aee76fe1f4 (diff)
downloadds-2ab1b4d64d3d2a718bade5161c2ec2c834111f7b.tar.gz
ds-2ab1b4d64d3d2a718bade5161c2ec2c834111f7b.tar.xz
ds-2ab1b4d64d3d2a718bade5161c2ec2c834111f7b.zip
Fixing nightly build
Changes: 1) NSPR_RELDATE: v4.6.1 --> v4.6 2) ICU_LIB_VERSION: 34 --> 24 This is a temporary degrade to adjust the version to match the one in adminutil.Once adminutil is built with icu 3.4 and pushed to /s/b/c, we'd go back to 3.4. 3) lib/base/systhr.cpp: Applied NSPR sysfd table patch 4) DS version: 7.1 --> 7.2
Diffstat (limited to 'lib/base/systhr.cpp')
-rw-r--r--lib/base/systhr.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/lib/base/systhr.cpp b/lib/base/systhr.cpp
index 8bbfc55f..1f611fb3 100644
--- a/lib/base/systhr.cpp
+++ b/lib/base/systhr.cpp
@@ -47,11 +47,19 @@
#ifdef USE_NSPR
#include "nspr.h"
#include "private/prpriv.h"
+#ifdef LINUX
+# include <sys/time.h>
+# include <sys/resource.h>
+#else
+/* This declaration should be removed when NSPR newer than v4.6 is picked up,
+ which should have the fix for bug 326110
+ */
extern "C" {
int32 PR_GetSysfdTableMax(void);
int32 PR_SetSysfdTableSize(int table_size);
}
#endif
+#endif
#include "systems.h"
#ifdef THREAD_WIN32
@@ -161,9 +169,25 @@ NSAPI_PUBLIC void systhread_init(char *name)
{
PR_Init(PR_USER_THREAD, PR_PRIORITY_NORMAL, 256);
#ifdef XP_UNIX
- /* XXXrobm allocate all the fd's we can... */
+#ifdef LINUX
+ /*
+ * NSPR 4.6 does not export PR_SetSysfdTableSize
+ * and PR_GetSysfdTableMax by mistake (NSPR Bugzilla
+ * bug 326110) on platforms that use GCC with symbol
+ * visibility, so we have to call the system calls
+ * directly.
+ */
+ {
+ struct rlimit rlim;
+ if (getrlimit(RLIMIT_NOFILE, &rlim) < 0)
+ return;
+ rlim.rlim_cur = rlim.rlim_max;
+ (void) setrlimit(RLIMIT_NOFILE, &rlim);
+ }
+#else
PR_SetSysfdTableSize(PR_GetSysfdTableMax());
#endif
+#endif
}