Lines Matching refs:env

157 static void throwUnixException(JNIEnv* env, int errnum) {
158 jobject x = JNU_NewObjectByName(env, "sun/nio/fs/UnixException",
161 (*env)->Throw(env, x);
169 Java_sun_nio_fs_UnixNativeDispatcher_init(JNIEnv* env, jclass this)
174 clazz = (*env)->FindClass(env, "sun/nio/fs/UnixFileAttributes");
178 attrs_st_mode = (*env)->GetFieldID(env, clazz, "st_mode", "I");
179 attrs_st_ino = (*env)->GetFieldID(env, clazz, "st_ino", "J");
180 attrs_st_dev = (*env)->GetFieldID(env, clazz, "st_dev", "J");
181 attrs_st_rdev = (*env)->GetFieldID(env, clazz, "st_rdev", "J");
182 attrs_st_nlink = (*env)->GetFieldID(env, clazz, "st_nlink", "I");
183 attrs_st_uid = (*env)->GetFieldID(env, clazz, "st_uid", "I");
184 attrs_st_gid = (*env)->GetFieldID(env, clazz, "st_gid", "I");
185 attrs_st_size = (*env)->GetFieldID(env, clazz, "st_size", "J");
186 attrs_st_atime = (*env)->GetFieldID(env, clazz, "st_atime", "J");
187 attrs_st_mtime = (*env)->GetFieldID(env, clazz, "st_mtime", "J");
188 attrs_st_ctime = (*env)->GetFieldID(env, clazz, "st_ctime", "J");
190 clazz = (*env)->FindClass(env, "sun/nio/fs/UnixFileStoreAttributes");
194 attrs_f_frsize = (*env)->GetFieldID(env, clazz, "f_frsize", "J");
195 attrs_f_blocks = (*env)->GetFieldID(env, clazz, "f_blocks", "J");
196 attrs_f_bfree = (*env)->GetFieldID(env, clazz, "f_bfree", "J");
197 attrs_f_bavail = (*env)->GetFieldID(env, clazz, "f_bavail", "J");
199 clazz = (*env)->FindClass(env, "sun/nio/fs/UnixMountEntry");
203 entry_name = (*env)->GetFieldID(env, clazz, "name", "[B");
204 entry_dir = (*env)->GetFieldID(env, clazz, "dir", "[B");
205 entry_fstype = (*env)->GetFieldID(env, clazz, "fstype", "[B");
206 entry_options = (*env)->GetFieldID(env, clazz, "opts", "[B");
207 entry_dev = (*env)->GetFieldID(env, clazz, "dev", "J");
241 Java_sun_nio_fs_UnixNativeDispatcher_getcwd(JNIEnv* env, jclass this) {
248 throwUnixException(env, errno);
251 result = (*env)->NewByteArray(env, len);
253 (*env)->SetByteArrayRegion(env, result, 0, len, (jbyte*)buf);
260 Java_sun_nio_fs_UnixNativeDispatcher_strerror(JNIEnv* env, jclass this, jint error)
268 bytes = (*env)->NewByteArray(env, len);
270 (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)msg);
276 Java_sun_nio_fs_UnixNativeDispatcher_dup(JNIEnv* env, jclass this, jint fd) {
282 throwUnixException(env, errno);
288 Java_sun_nio_fs_UnixNativeDispatcher_fopen0(JNIEnv* env, jclass this,
300 throwUnixException(env, errno);
307 Java_sun_nio_fs_UnixNativeDispatcher_fclose(JNIEnv* env, jclass this, jlong stream)
316 throwUnixException(env, errno);
321 Java_sun_nio_fs_UnixNativeDispatcher_open0(JNIEnv* env, jclass this,
329 throwUnixException(env, errno);
335 Java_sun_nio_fs_UnixNativeDispatcher_openat0(JNIEnv* env, jclass this, jint dfd,
342 JNU_ThrowInternalError(env, "should not reach here");
348 throwUnixException(env, errno);
354 Java_sun_nio_fs_UnixNativeDispatcher_close(JNIEnv* env, jclass this, jint fd) {
361 Java_sun_nio_fs_UnixNativeDispatcher_read(JNIEnv* env, jclass this, jint fd,
368 throwUnixException(env, errno);
374 Java_sun_nio_fs_UnixNativeDispatcher_write(JNIEnv* env, jclass this, jint fd,
381 throwUnixException(env, errno);
389 static void prepAttributes(JNIEnv* env, struct stat64* buf, jobject attrs) {
390 (*env)->SetIntField(env, attrs, attrs_st_mode, (jint)buf->st_mode);
391 (*env)->SetLongField(env, attrs, attrs_st_ino, (jlong)buf->st_ino);
392 (*env)->SetLongField(env, attrs, attrs_st_dev, (jlong)buf->st_dev);
393 (*env)->SetLongField(env, attrs, attrs_st_rdev, (jlong)buf->st_rdev);
394 (*env)->SetIntField(env, attrs, attrs_st_nlink, (jint)buf->st_nlink);
395 (*env)->SetIntField(env, attrs, attrs_st_uid, (jint)buf->st_uid);
396 (*env)->SetIntField(env, attrs, attrs_st_gid, (jint)buf->st_gid);
397 (*env)->SetLongField(env, attrs, attrs_st_size, (jlong)buf->st_size);
398 (*env)->SetLongField(env, attrs, attrs_st_atime, (jlong)buf->st_atime);
399 (*env)->SetLongField(env, attrs, attrs_st_mtime, (jlong)buf->st_mtime);
400 (*env)->SetLongField(env, attrs, attrs_st_ctime, (jlong)buf->st_ctime);
404 Java_sun_nio_fs_UnixNativeDispatcher_stat0(JNIEnv* env, jclass this,
413 throwUnixException(env, errno);
415 prepAttributes(env, &buf, attrs);
420 Java_sun_nio_fs_UnixNativeDispatcher_lstat0(JNIEnv* env, jclass this,
429 throwUnixException(env, errno);
431 prepAttributes(env, &buf, attrs);
436 Java_sun_nio_fs_UnixNativeDispatcher_fstat(JNIEnv* env, jclass this, jint fd,
444 throwUnixException(env, errno);
446 prepAttributes(env, &buf, attrs);
451 Java_sun_nio_fs_UnixNativeDispatcher_fstatat0(JNIEnv* env, jclass this, jint dfd,
459 JNU_ThrowInternalError(env, "should not reach here");
464 throwUnixException(env, errno);
466 prepAttributes(env, &buf, attrs);
471 Java_sun_nio_fs_UnixNativeDispatcher_chmod0(JNIEnv* env, jclass this,
479 throwUnixException(env, errno);
484 Java_sun_nio_fs_UnixNativeDispatcher_fchmod(JNIEnv* env, jclass this, jint filedes,
491 throwUnixException(env, errno);
497 Java_sun_nio_fs_UnixNativeDispatcher_chown0(JNIEnv* env, jclass this,
505 throwUnixException(env, errno);
510 Java_sun_nio_fs_UnixNativeDispatcher_lchown0(JNIEnv* env, jclass this, jlong pathAddress, jint uid, jint gid)
517 throwUnixException(env, errno);
522 Java_sun_nio_fs_UnixNativeDispatcher_fchown(JNIEnv* env, jclass this, jint filedes, jint uid, jint gid)
528 throwUnixException(env, errno);
533 Java_sun_nio_fs_UnixNativeDispatcher_utimes0(JNIEnv* env, jclass this,
548 throwUnixException(env, errno);
553 Java_sun_nio_fs_UnixNativeDispatcher_futimes(JNIEnv* env, jclass this, jint filedes,
569 JNU_ThrowInternalError(env, "my_ftimesat_func is NULL");
575 throwUnixException(env, errno);
580 Java_sun_nio_fs_UnixNativeDispatcher_opendir0(JNIEnv* env, jclass this,
589 throwUnixException(env, errno);
595 Java_sun_nio_fs_UnixNativeDispatcher_fdopendir(JNIEnv* env, jclass this, int dfd) {
599 JNU_ThrowInternalError(env, "should not reach here");
606 throwUnixException(env, errno);
612 Java_sun_nio_fs_UnixNativeDispatcher_closedir(JNIEnv* env, jclass this, jlong dir) {
618 throwUnixException(env, errno);
623 Java_sun_nio_fs_UnixNativeDispatcher_readdir(JNIEnv* env, jclass this, jlong value) {
637 throwUnixException(env, res);
644 jbyteArray bytes = (*env)->NewByteArray(env, len);
646 (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)(ptr->d_name));
654 Java_sun_nio_fs_UnixNativeDispatcher_mkdir0(JNIEnv* env, jclass this,
661 throwUnixException(env, errno);
666 Java_sun_nio_fs_UnixNativeDispatcher_rmdir0(JNIEnv* env, jclass this,
673 throwUnixException(env, errno);
678 Java_sun_nio_fs_UnixNativeDispatcher_link0(JNIEnv* env, jclass this,
687 throwUnixException(env, errno);
693 Java_sun_nio_fs_UnixNativeDispatcher_unlink0(JNIEnv* env, jclass this,
700 throwUnixException(env, errno);
705 Java_sun_nio_fs_UnixNativeDispatcher_unlinkat0(JNIEnv* env, jclass this, jint dfd,
711 JNU_ThrowInternalError(env, "should not reach here");
717 throwUnixException(env, errno);
722 Java_sun_nio_fs_UnixNativeDispatcher_rename0(JNIEnv* env, jclass this,
730 throwUnixException(env, errno);
735 Java_sun_nio_fs_UnixNativeDispatcher_renameat0(JNIEnv* env, jclass this,
742 JNU_ThrowInternalError(env, "should not reach here");
748 throwUnixException(env, errno);
753 Java_sun_nio_fs_UnixNativeDispatcher_symlink0(JNIEnv* env, jclass this,
761 throwUnixException(env, errno);
766 Java_sun_nio_fs_UnixNativeDispatcher_readlink0(JNIEnv* env, jclass this,
776 throwUnixException(env, errno);
784 result = (*env)->NewByteArray(env, len);
786 (*env)->SetByteArrayRegion(env, result, 0, len, (jbyte*)target);
793 Java_sun_nio_fs_UnixNativeDispatcher_realpath0(JNIEnv* env, jclass this,
802 throwUnixException(env, errno);
805 result = (*env)->NewByteArray(env, len);
807 (*env)->SetByteArrayRegion(env, result, 0, len, (jbyte*)resolved);
814 Java_sun_nio_fs_UnixNativeDispatcher_access0(JNIEnv* env, jclass this,
822 throwUnixException(env, errno);
827 Java_sun_nio_fs_UnixNativeDispatcher_statvfs0(JNIEnv* env, jclass this,
837 throwUnixException(env, errno);
839 (*env)->SetLongField(env, attrs, attrs_f_frsize, long_to_jlong(buf.f_frsize));
840 (*env)->SetLongField(env, attrs, attrs_f_blocks, long_to_jlong(buf.f_blocks));
841 (*env)->SetLongField(env, attrs, attrs_f_bfree, long_to_jlong(buf.f_bfree));
842 (*env)->SetLongField(env, attrs, attrs_f_bavail, long_to_jlong(buf.f_bavail));
847 Java_sun_nio_fs_UnixNativeDispatcher_pathconf0(JNIEnv* env, jclass this,
855 throwUnixException(env, errno);
861 Java_sun_nio_fs_UnixNativeDispatcher_fpathconf(JNIEnv* env, jclass this,
868 throwUnixException(env, errno);
874 Java_sun_nio_fs_UnixNativeDispatcher_mknod0(JNIEnv* env, jclass this,
882 throwUnixException(env, errno);
887 Java_sun_nio_fs_UnixNativeDispatcher_getpwuid(JNIEnv* env, jclass this, jint uid)
899 JNU_ThrowOutOfMemoryError(env, "native heap");
916 throwUnixException(env, errno);
919 result = (*env)->NewByteArray(env, len);
921 (*env)->SetByteArrayRegion(env, result, 0, len, (jbyte*)(p->pw_name));
932 Java_sun_nio_fs_UnixNativeDispatcher_getgrgid(JNIEnv* env, jclass this, jint gid)
950 JNU_ThrowOutOfMemoryError(env, "native heap");
971 throwUnixException(env, errno);
975 result = (*env)->NewByteArray(env, len);
977 (*env)->SetByteArrayRegion(env, result, 0, len, (jbyte*)(g->gr_name));
989 Java_sun_nio_fs_UnixNativeDispatcher_getpwnam0(JNIEnv* env, jclass this,
1002 JNU_ThrowOutOfMemoryError(env, "native heap");
1019 throwUnixException(env, errno);
1030 Java_sun_nio_fs_UnixNativeDispatcher_getgrnam0(JNIEnv* env, jclass this,
1050 JNU_ThrowOutOfMemoryError(env, "native heap");
1070 throwUnixException(env, errno);