/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#include "jni.h"
#include "jni_util.h"
#include "jvm.h"
#include "jlong.h"
#include <io.h>
#include "nio.h"
#include "nio_util.h"
#include "sun_nio_ch_FileChannelImpl.h"
/**************************************************************
* static method to store field ID's in initializers
* and retrieve the allocation granularity
*/
{
GetSystemInfo(&si);
return align;
}
/**************************************************************
* Channel
*/
{
void *mapAddress = 0;
if (prot == sun_nio_ch_FileChannelImpl_MAP_RO) {
} else if (prot == sun_nio_ch_FileChannelImpl_MAP_RW) {
} else if (prot == sun_nio_ch_FileChannelImpl_MAP_PV) {
}
fileHandle, /* Handle of file */
NULL, /* Not inheritable */
fileProtect, /* Read and write */
highLen, /* High word of max size */
lowLen, /* Low word of max size */
NULL); /* No name for object */
return IOS_THROWN;
}
mapping, /* Handle of file mapping object */
mapAccess, /* Read and write access */
highOffset, /* High word of offset */
lowOffset, /* Low word of offset */
mapError = GetLastError();
if (result == 0) {
return IOS_THROWN;
}
if (mapAddress == NULL) {
if (mapError == ERROR_NOT_ENOUGH_MEMORY)
else
return IOS_THROWN;
}
return ptr_to_jlong(mapAddress);
}
{
void *a = (void *) jlong_to_ptr(address);
result = UnmapViewOfFile(a);
if (result == 0) {
return IOS_THROWN;
}
return 0;
}
{
long highPos = 0;
if (offset < 0) {
} else {
}
if (GetLastError() != ERROR_SUCCESS) {
return IOS_THROWN;
}
}
}
{
if (h != INVALID_HANDLE_VALUE) {
if (result < 0) {
}
}
}
{
return IOS_UNSUPPORTED;
}