Last stretch to get PPC native tests working

This commit is contained in:
Dr. Chat
2017-05-11 15:09:43 -05:00
parent 7eceb9db09
commit 737b78ad49
8 changed files with 131 additions and 52 deletions

View File

@@ -15,7 +15,6 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <cstring>
namespace xe {
namespace filesystem {
@@ -44,7 +43,6 @@ std::vector<FileInfo> ListFiles(const std::wstring& path) {
while (auto ent = readdir(dir)) {
FileInfo info;
std::memset(&info, 0, sizeof(info));
if (ent->d_type == DT_DIR) {
info.type = FileInfo::Type::kDirectory;
info.total_size = 0;
@@ -53,6 +51,9 @@ std::vector<FileInfo> ListFiles(const std::wstring& path) {
info.total_size = 0; // TODO(DrChat): Find a way to get this
}
info.create_timestamp = 0;
info.access_timestamp = 0;
info.write_timestamp = 0;
info.name = xe::to_wstring(ent->d_name);
result.push_back(info);
}

View File

@@ -36,7 +36,8 @@ void set_name(std::thread::native_handle_type handle, const std::string& name) {
}
void Sleep(std::chrono::microseconds duration) {
timespec rqtp = {duration.count() / 1000000, duration.count() % 1000};
timespec rqtp = {time_t(duration.count() / 1000000),
time_t(duration.count() % 1000)};
nanosleep(&rqtp, nullptr);
// TODO(benvanik): spin while rmtp >0?
}