equal
deleted
inserted
replaced
36 #endif |
36 #endif |
37 #include <string.h> |
37 #include <string.h> |
38 #include <stdlib.h> |
38 #include <stdlib.h> |
39 #include <dlfcn.h> |
39 #include <dlfcn.h> |
40 #include <limits.h> |
40 #include <limits.h> |
|
41 #include <errno.h> |
|
42 #include <fcntl.h> |
|
43 #include <dirent.h> |
41 |
44 |
42 #include "jni.h" |
45 #include "jni.h" |
43 #include "jni_util.h" |
46 #include "jni_util.h" |
44 #include "jlong.h" |
47 #include "jlong.h" |
45 #include "jvm.h" |
|
46 #include "io_util.h" |
48 #include "io_util.h" |
47 #include "io_util_md.h" |
49 #include "io_util_md.h" |
48 #include "java_io_FileSystem.h" |
50 #include "java_io_FileSystem.h" |
49 #include "java_io_UnixFileSystem.h" |
51 #include "java_io_UnixFileSystem.h" |
50 |
52 |
95 jstring pathname) |
97 jstring pathname) |
96 { |
98 { |
97 jstring rv = NULL; |
99 jstring rv = NULL; |
98 |
100 |
99 WITH_PLATFORM_STRING(env, pathname, path) { |
101 WITH_PLATFORM_STRING(env, pathname, path) { |
100 char canonicalPath[JVM_MAXPATHLEN]; |
102 char canonicalPath[PATH_MAX]; |
101 if (canonicalize((char *)path, |
103 if (canonicalize((char *)path, |
102 canonicalPath, JVM_MAXPATHLEN) < 0) { |
104 canonicalPath, PATH_MAX) < 0) { |
103 JNU_ThrowIOExceptionWithLastError(env, "Bad pathname"); |
105 JNU_ThrowIOExceptionWithLastError(env, "Bad pathname"); |
104 } else { |
106 } else { |
105 #ifdef MACOSX |
107 #ifdef MACOSX |
106 rv = newStringPlatform(env, canonicalPath); |
108 rv = newStringPlatform(env, canonicalPath); |
107 #else |
109 #else |