mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 02:54:35 +02:00
8203680: os::stat() on Posix platform does not need to copy input path
Reviewed-by: hseigel, dholmes
This commit is contained in:
parent
79fea6b201
commit
6f462fbc70
9 changed files with 10 additions and 56 deletions
|
@ -1667,16 +1667,6 @@ void* os::get_default_process_handle() {
|
|||
return (void*)::dlopen(NULL, RTLD_LAZY);
|
||||
}
|
||||
|
||||
int os::stat(const char *path, struct stat *sbuf) {
|
||||
char pathbuf[MAX_PATH];
|
||||
if (strlen(path) > MAX_PATH - 1) {
|
||||
errno = ENAMETOOLONG;
|
||||
return -1;
|
||||
}
|
||||
os::native_path(strcpy(pathbuf, path));
|
||||
return ::stat(pathbuf, sbuf);
|
||||
}
|
||||
|
||||
static inline time_t get_mtime(const char* filename) {
|
||||
struct stat st;
|
||||
int ret = os::stat(filename, &st);
|
||||
|
@ -4474,10 +4464,6 @@ jlong os::lseek(int fd, jlong offset, int whence) {
|
|||
return (jlong) ::lseek64(fd, offset, whence);
|
||||
}
|
||||
|
||||
char * os::native_path(char *path) {
|
||||
return path;
|
||||
}
|
||||
|
||||
int os::ftruncate(int fd, jlong length) {
|
||||
return ::ftruncate64(fd, length);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue