Mercurial > hg > graal-jvmci-8
comparison src/os/windows/vm/os_windows.cpp @ 10195:e12c9b3740db
8012260: ciReplay: Include PID into the name of replay data file
Reviewed-by: kvn, twisti
author | vlivanov |
---|---|
date | Thu, 25 Apr 2013 11:02:32 -0700 |
parents | f36e073d56a4 |
children | 0b55a78c6be5 |
comparison
equal
deleted
inserted
replaced
10141:47766e2d2527 | 10195:e12c9b3740db |
---|---|
1219 return retval; | 1219 return retval; |
1220 } | 1220 } |
1221 | 1221 |
1222 // Needs to be in os specific directory because windows requires another | 1222 // Needs to be in os specific directory because windows requires another |
1223 // header file <direct.h> | 1223 // header file <direct.h> |
1224 const char* os::get_current_directory(char *buf, int buflen) { | 1224 const char* os::get_current_directory(char *buf, size_t buflen) { |
1225 return _getcwd(buf, buflen); | 1225 int n = static_cast<int>(buflen); |
1226 if (buflen > INT_MAX) n = INT_MAX; | |
1227 return _getcwd(buf, n); | |
1226 } | 1228 } |
1227 | 1229 |
1228 //----------------------------------------------------------- | 1230 //----------------------------------------------------------- |
1229 // Helper functions for fatal error handler | 1231 // Helper functions for fatal error handler |
1230 #ifdef _WIN64 | 1232 #ifdef _WIN64 |
4096 } | 4098 } |
4097 os::native_path(strcpy(pathbuf, path)); | 4099 os::native_path(strcpy(pathbuf, path)); |
4098 return ::open(pathbuf, oflag | O_BINARY | O_NOINHERIT, mode); | 4100 return ::open(pathbuf, oflag | O_BINARY | O_NOINHERIT, mode); |
4099 } | 4101 } |
4100 | 4102 |
4103 FILE* os::open(int fd, const char* mode) { | |
4104 return ::_fdopen(fd, mode); | |
4105 } | |
4106 | |
4101 // Is a (classpath) directory empty? | 4107 // Is a (classpath) directory empty? |
4102 bool os::dir_is_empty(const char* path) { | 4108 bool os::dir_is_empty(const char* path) { |
4103 WIN32_FIND_DATA fd; | 4109 WIN32_FIND_DATA fd; |
4104 HANDLE f = FindFirstFile(path, &fd); | 4110 HANDLE f = FindFirstFile(path, &fd); |
4105 if (f == INVALID_HANDLE_VALUE) { | 4111 if (f == INVALID_HANDLE_VALUE) { |