HADOOP-11954. Solaris does not support RLIMIT_MEMLOCK as in Linux (Alan Burlison via aw)

This commit is contained in:
Allen Wittenauer 2015-11-24 12:44:58 -08:00
parent 15ecbc95bf
commit 38f8952c4d
2 changed files with 6 additions and 3 deletions

View File

@ -735,6 +735,9 @@ Release 2.8.0 - UNRELEASED
HADOOP-9822. Create constant MAX_CAPACITY in RetryCache rather than HADOOP-9822. Create constant MAX_CAPACITY in RetryCache rather than
hard-coding 16 in RetryCache constructor. (Tsuyoshi Ozawa via wheat9) hard-coding 16 in RetryCache constructor. (Tsuyoshi Ozawa via wheat9)
HADOOP-11954. Solaris does not support RLIMIT_MEMLOCK as in Linux
(Alan Burlison via aw)
OPTIMIZATIONS OPTIMIZATIONS
HADOOP-12051. ProtobufRpcEngine.invoke() should use Exception.toString() HADOOP-12051. ProtobufRpcEngine.invoke() should use Exception.toString()

View File

@ -1255,9 +1255,7 @@ JNIEXPORT jlong JNICALL
Java_org_apache_hadoop_io_nativeio_NativeIO_getMemlockLimit0( Java_org_apache_hadoop_io_nativeio_NativeIO_getMemlockLimit0(
JNIEnv *env, jclass clazz) JNIEnv *env, jclass clazz)
{ {
#ifdef WINDOWS #ifdef RLIMIT_MEMLOCK
return 0;
#else
struct rlimit rlim; struct rlimit rlim;
int rc = getrlimit(RLIMIT_MEMLOCK, &rlim); int rc = getrlimit(RLIMIT_MEMLOCK, &rlim);
if (rc != 0) { if (rc != 0) {
@ -1266,6 +1264,8 @@ JNIEnv *env, jclass clazz)
} }
return (rlim.rlim_cur == RLIM_INFINITY) ? return (rlim.rlim_cur == RLIM_INFINITY) ?
INT64_MAX : rlim.rlim_cur; INT64_MAX : rlim.rlim_cur;
#else
return 0;
#endif #endif
} }