From cf173a332b00dc5f960d36c7eee614deecf29f26 Mon Sep 17 00:00:00 2001 From: Chris Nauroth Date: Thu, 6 Feb 2014 18:42:14 +0000 Subject: [PATCH] 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 --- hadoop-common-project/hadoop-common/CHANGES.txt | 3 +++ .../org/apache/hadoop/io/nativeio/NativeIO.c | 17 ++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 109ed94c2e8..01a6e423b10 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -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 diff --git a/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c b/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c index 2b5c0a4ab0a..79c9b9d4697 100644 --- a/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c +++ b/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c @@ -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: */ -