author | alanb |
Thu, 16 Aug 2012 11:14:42 +0100 | |
changeset 13571 | 737b7b4bd73a |
parent 5506 | 202f599c92aa |
child 14342 | 8435a30053c1 |
permissions | -rw-r--r-- |
2057
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
1 |
/* |
5506 | 2 |
* Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. |
2057
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
4 |
* |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2057
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2057
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
10 |
* |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
15 |
* accompanied this code). |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
16 |
* |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
17 |
* You should have received a copy of the GNU General Public License version |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
20 |
* |
5506 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
2057
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
24 |
*/ |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
25 |
|
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
26 |
#include "jni.h" |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
27 |
#include "jni_util.h" |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
28 |
#include "jvm.h" |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
29 |
#include "jlong.h" |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
30 |
|
13571
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
31 |
#include <strings.h> |
2057
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
32 |
#include <errno.h> |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
33 |
#include <sys/acl.h> |
13571
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
34 |
#include <sys/mnttab.h> |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
35 |
#include <sys/mkdev.h> |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
36 |
|
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
37 |
#include "jni.h" |
2057
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
38 |
|
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
39 |
#include "sun_nio_fs_SolarisNativeDispatcher.h" |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
40 |
|
13571
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
41 |
static jfieldID entry_name; |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
42 |
static jfieldID entry_dir; |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
43 |
static jfieldID entry_fstype; |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
44 |
static jfieldID entry_options; |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
45 |
static jfieldID entry_dev; |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
46 |
|
2057
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
47 |
static void throwUnixException(JNIEnv* env, int errnum) { |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
48 |
jobject x = JNU_NewObjectByName(env, "sun/nio/fs/UnixException", |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
49 |
"(I)V", errnum); |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
50 |
if (x != NULL) { |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
51 |
(*env)->Throw(env, x); |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
52 |
} |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
53 |
} |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
54 |
|
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
55 |
JNIEXPORT void JNICALL |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
56 |
Java_sun_nio_fs_SolarisNativeDispatcher_init(JNIEnv *env, jclass clazz) { |
13571
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
57 |
clazz = (*env)->FindClass(env, "sun/nio/fs/UnixMountEntry"); |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
58 |
if (clazz == NULL) |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
59 |
return; |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
60 |
|
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
61 |
entry_name = (*env)->GetFieldID(env, clazz, "name", "[B"); |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
62 |
entry_dir = (*env)->GetFieldID(env, clazz, "dir", "[B"); |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
63 |
entry_fstype = (*env)->GetFieldID(env, clazz, "fstype", "[B"); |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
64 |
entry_options = (*env)->GetFieldID(env, clazz, "opts", "[B"); |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
65 |
entry_dev = (*env)->GetFieldID(env, clazz, "dev", "J"); |
2057
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
66 |
} |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
67 |
|
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
68 |
JNIEXPORT jint JNICALL |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
69 |
Java_sun_nio_fs_SolarisNativeDispatcher_facl(JNIEnv* env, jclass this, jint fd, |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
70 |
jint cmd, jint nentries, jlong address) |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
71 |
{ |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
72 |
void* aclbufp = jlong_to_ptr(address); |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
73 |
int n = -1; |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
74 |
|
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
75 |
n = facl((int)fd, (int)cmd, (int)nentries, aclbufp); |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
76 |
if (n == -1) { |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
77 |
throwUnixException(env, errno); |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
78 |
} |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
79 |
return (jint)n; |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
80 |
} |
13571
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
81 |
|
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
82 |
JNIEXPORT jint JNICALL |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
83 |
Java_sun_nio_fs_SolarisNativeDispatcher_getextmntent(JNIEnv* env, jclass this, |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
84 |
jlong value, jobject entry) |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
85 |
{ |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
86 |
struct extmnttab ent; |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
87 |
FILE* fp = jlong_to_ptr(value); |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
88 |
jsize len; |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
89 |
jbyteArray bytes; |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
90 |
char* name; |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
91 |
char* dir; |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
92 |
char* fstype; |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
93 |
char* options; |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
94 |
dev_t dev; |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
95 |
|
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
96 |
if (getextmntent(fp, &ent, 0)) |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
97 |
return -1; |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
98 |
name = ent.mnt_special; |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
99 |
dir = ent.mnt_mountp; |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
100 |
fstype = ent.mnt_fstype; |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
101 |
options = ent.mnt_mntopts; |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
102 |
dev = makedev(ent.mnt_major, ent.mnt_minor); |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
103 |
if (dev == NODEV) { |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
104 |
throwUnixException(env, errno); |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
105 |
return -1; |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
106 |
} |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
107 |
|
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
108 |
len = strlen(name); |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
109 |
bytes = (*env)->NewByteArray(env, len); |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
110 |
if (bytes == NULL) |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
111 |
return -1; |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
112 |
(*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)name); |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
113 |
(*env)->SetObjectField(env, entry, entry_name, bytes); |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
114 |
|
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
115 |
len = strlen(dir); |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
116 |
bytes = (*env)->NewByteArray(env, len); |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
117 |
if (bytes == NULL) |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
118 |
return -1; |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
119 |
(*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)dir); |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
120 |
(*env)->SetObjectField(env, entry, entry_dir, bytes); |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
121 |
|
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
122 |
len = strlen(fstype); |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
123 |
bytes = (*env)->NewByteArray(env, len); |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
124 |
if (bytes == NULL) |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
125 |
return -1; |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
126 |
(*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)fstype); |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
127 |
(*env)->SetObjectField(env, entry, entry_fstype, bytes); |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
128 |
|
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
129 |
len = strlen(options); |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
130 |
bytes = (*env)->NewByteArray(env, len); |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
131 |
if (bytes == NULL) |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
132 |
return -1; |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
133 |
(*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)options); |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
134 |
(*env)->SetObjectField(env, entry, entry_options, bytes); |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
135 |
|
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
136 |
if (dev != 0) |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
137 |
(*env)->SetLongField(env, entry, entry_dev, (jlong)dev); |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
138 |
|
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
139 |
return 0; |
737b7b4bd73a
7191556: (fs) UnixNativeDispatcher.getextmntent should be moved into platform specific code
alanb
parents:
5506
diff
changeset
|
140 |
} |