HADOOP-10327. Merging change r1565389 from trunk to branch-2.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1565390 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Chris Nauroth 2014-02-06 18:42:14 +00:00
parent fa43d8fb45
commit cf173a332b
2 changed files with 19 additions and 1 deletions

View File

@ -26,6 +26,9 @@ Release 2.4.0 - UNRELEASED
HADOOP-10273. Fix 'mvn site'. (Arpit Agarwal)
HADOOP-10327. Trunk windows build broken after HDFS-5746.
(Vinay via cnauroth)
Release 2.3.0 - UNRELEASED
INCOMPATIBLE CHANGES

View File

@ -671,6 +671,7 @@ Java_org_apache_hadoop_io_nativeio_NativeIO_00024POSIX_mmap(
JNIEnv *env, jclass clazz, jobject jfd, jint jprot,
jboolean jshared, jlong length)
{
#ifdef UNIX
void *addr = 0;
int prot, flags, fd;
@ -684,18 +685,33 @@ Java_org_apache_hadoop_io_nativeio_NativeIO_00024POSIX_mmap(
throw_ioe(env, errno);
}
return (jlong)(intptr_t)addr;
#endif // UNIX
#ifdef WINDOWS
THROW(env, "java/io/IOException",
"The function POSIX.mmap() is not supported on Windows");
return NULL;
#endif
}
JNIEXPORT void JNICALL
Java_org_apache_hadoop_io_nativeio_NativeIO_00024POSIX_munmap(
JNIEnv *env, jclass clazz, jlong jaddr, jlong length)
{
#ifdef UNIX
void *addr;
addr = (void*)(intptr_t)jaddr;
if (munmap(addr, length) < 0) {
throw_ioe(env, errno);
}
#endif // UNIX
#ifdef WINDOWS
THROW(env, "java/io/IOException",
"The function POSIX.munmap() is not supported on Windows");
return NULL;
#endif
}
@ -1050,4 +1066,3 @@ JNIEnv *env, jclass clazz)
/**
* vim: sw=2: ts=2: et:
*/