1 /* |
1 /* |
2 * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
48 JNIEXPORT jint handleRead(FD fd, void *buf, jint len); |
48 JNIEXPORT jint handleRead(FD fd, void *buf, jint len); |
49 jint handleWrite(FD fd, const void *buf, jint len); |
49 jint handleWrite(FD fd, const void *buf, jint len); |
50 jint handleAppend(FD fd, const void *buf, jint len); |
50 jint handleAppend(FD fd, const void *buf, jint len); |
51 void handleClose(JNIEnv *env, jobject this, jfieldID fid); |
51 void handleClose(JNIEnv *env, jobject this, jfieldID fid); |
52 void fileDescriptorClose(JNIEnv *env, jobject this); |
52 void fileDescriptorClose(JNIEnv *env, jobject this); |
53 jlong handleLseek(FD fd, jlong offset, jint whence); |
53 JNIEXPORT jlong handleLseek(FD fd, jlong offset, jint whence); |
54 |
54 |
55 /* |
55 /* |
56 * Returns an opaque handle to file named by "path". If an error occurs, |
56 * Returns an opaque handle to file named by "path". If an error occurs, |
57 * returns -1 and an exception is pending. |
57 * returns -1 and an exception is pending. |
58 */ |
58 */ |
59 FD winFileHandleOpen(JNIEnv *env, jstring path, int flags); |
59 JNIEXPORT FD winFileHandleOpen(JNIEnv *env, jstring path, int flags); |
60 |
60 |
61 /* |
61 /* |
62 * Macros to set/get fd from the java.io.FileDescriptor. |
62 * Macros to set/get fd from the java.io.FileDescriptor. |
63 * If GetObjectField returns null, SET_FD will stop and GET_FD |
63 * If GetObjectField returns null, SET_FD will stop and GET_FD |
64 * will simply return -1 to avoid crashing VM. |
64 * will simply return -1 to avoid crashing VM. |