diff options
| author | Vanilla I. Shu <vanilla@FreeBSD.org> | 2018-05-31 03:53:34 +0000 |
|---|---|---|
| committer | Vanilla I. Shu <vanilla@FreeBSD.org> | 2018-05-31 03:53:34 +0000 |
| commit | 8221a129922841c9c8ce35f6ad42437729690715 (patch) | |
| tree | 9e29781491f5b3ecf8b5a2914760fb6d05ca5188 /databases/foundationdb/files/patch-flow_Platform.cpp | |
| parent | emulators/citra: unbreak on i386 with clang 5+ (diff) | |
Update to 5.2.2.
Diffstat (limited to 'databases/foundationdb/files/patch-flow_Platform.cpp')
| -rw-r--r-- | databases/foundationdb/files/patch-flow_Platform.cpp | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/databases/foundationdb/files/patch-flow_Platform.cpp b/databases/foundationdb/files/patch-flow_Platform.cpp index e2d121b83c44..059fce220afc 100644 --- a/databases/foundationdb/files/patch-flow_Platform.cpp +++ b/databases/foundationdb/files/patch-flow_Platform.cpp @@ -1,4 +1,4 @@ ---- flow/Platform.cpp.orig 2018-04-19 02:55:50 UTC +--- flow/Platform.cpp.orig 2018-05-11 01:30:59 UTC +++ flow/Platform.cpp @@ -71,6 +71,7 @@ @@ -8,7 +8,7 @@ #include <sys/mman.h> #include <unistd.h> #include <ftw.h> -@@ -119,6 +120,12 @@ +@@ -119,7 +120,13 @@ #include <IOKit/IOBSD.h> #endif @@ -17,10 +17,11 @@ +#include <sys/sysctl.h> +#include <sys/cpuset.h> +#include <sys/resource.h> -+#endif #endif ++#endif std::string removeWhitespace(const std::string &t) + { @@ -198,7 +205,7 @@ double getProcessorTimeThread() { throw platform_error(); } @@ -54,7 +55,7 @@ return 0; #endif } -@@ -427,6 +442,24 @@ void getMachineRAMInfo(MachineRAMInfo& m +@@ -427,6 +442,24 @@ void getMachineRAMInfo(MachineRAMInfo& memInfo) { memInfo.total = pagesize * (vm_stat.free_count + vm_stat.active_count + vm_stat.inactive_count + vm_stat.wire_count); memInfo.available = pagesize * vm_stat.free_count; memInfo.committed = memInfo.total - memInfo.available; @@ -79,7 +80,7 @@ #else #warning getMachineRAMInfo unimplemented on this platform #endif -@@ -435,7 +468,7 @@ void getMachineRAMInfo(MachineRAMInfo& m +@@ -435,7 +468,7 @@ void getMachineRAMInfo(MachineRAMInfo& memInfo) { void getDiskBytes(std::string const& directory, int64_t& free, int64_t& total) { INJECT_FAULT( platform_error, "getDiskBytes" ); #if defined(__unixish__) @@ -88,7 +89,7 @@ struct statvfs buf; if (statvfs(directory.c_str(), &buf)) { TraceEvent(SevError, "GetDiskBytesStatvfsError").detail("Directory", directory).GetLastError(); -@@ -477,7 +510,7 @@ void getDiskBytes(std::string const& dir +@@ -477,7 +510,7 @@ void getDiskBytes(std::string const& directory, int64_ #endif } @@ -155,7 +156,7 @@ struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); return uint64_t(ts.tv_sec) * 1e9 + ts.tv_nsec; -@@ -1481,7 +1538,7 @@ static void *allocateInternal(size_t len +@@ -1481,7 +1538,7 @@ static void *allocateInternal(size_t length, bool larg flags |= MAP_HUGETLB; return mmap(NULL, length, PROT_READ|PROT_WRITE, flags, -1, 0); @@ -176,7 +177,7 @@ #endif } -@@ -1615,7 +1677,7 @@ void renameFile( std::string const& from +@@ -1615,7 +1677,7 @@ void renameFile( std::string const& fromPath, std::str //renamedFile(); return; } @@ -185,7 +186,7 @@ if (!rename( fromPath.c_str(), toPath.c_str() )) { //FIXME: We cannot inject faults after renaming the file, because we could end up with two asyncFileNonDurable open for the same file //renamedFile(); -@@ -1733,7 +1795,7 @@ bool createDirectory( std::string const& +@@ -1733,7 +1795,7 @@ bool createDirectory( std::string const& directory ) { } TraceEvent(SevError, "CreateDirectory").detail("Directory", directory).GetLastError(); throw platform_error(); @@ -194,7 +195,7 @@ size_t sep = 0; do { sep = directory.find_first_of('/', sep + 1); -@@ -1774,7 +1836,7 @@ std::string abspath( std::string const& +@@ -1774,7 +1836,7 @@ std::string abspath( std::string const& filename ) { if (*x == '/') *x = CANONICAL_PATH_SEPARATOR; return nameBuffer; @@ -221,7 +222,7 @@ return S_ISREG(fileAttributes) && StringRef(name).endsWith(extension); #else #error Port me! -@@ -1858,7 +1920,7 @@ bool acceptFile( FILE_ATTRIBUTE_DATA fil +@@ -1858,7 +1920,7 @@ bool acceptFile( FILE_ATTRIBUTE_DATA fileAttributes, s bool acceptDirectory( FILE_ATTRIBUTE_DATA fileAttributes, std::string name, std::string extension ) { #ifdef _WIN32 return (fileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0; @@ -230,7 +231,7 @@ return S_ISDIR(fileAttributes); #else #error Port me! -@@ -1894,7 +1956,7 @@ std::vector<std::string> findFiles( std: +@@ -1894,7 +1956,7 @@ std::vector<std::string> findFiles( std::string const& } FindClose(h); } @@ -239,7 +240,7 @@ DIR *dip; if ((dip = opendir(directory.c_str())) != NULL) { -@@ -1958,7 +2020,7 @@ void findFilesRecursively(std::string pa +@@ -1958,7 +2020,7 @@ void findFilesRecursively(std::string path, std::vecto void threadSleep( double seconds ) { #ifdef _WIN32 Sleep( (DWORD)(seconds * 1e3) ); @@ -248,7 +249,7 @@ struct timespec req, rem; req.tv_sec = seconds; -@@ -1996,7 +2058,7 @@ void makeTemporary( const char* filename +@@ -1996,7 +2058,7 @@ void makeTemporary( const char* filename ) { THREAD_HANDLE startThread(void (*func) (void *), void *arg) { return (void *)_beginthread(func, 0, arg); } @@ -257,7 +258,7 @@ THREAD_HANDLE startThread(void *(*func) (void *), void *arg) { pthread_t t; pthread_create(&t, NULL, func, arg); -@@ -2009,7 +2071,7 @@ THREAD_HANDLE startThread(void *(*func) +@@ -2009,7 +2071,7 @@ THREAD_HANDLE startThread(void *(*func) (void *), void void waitThread(THREAD_HANDLE thread) { #ifdef _WIN32 WaitForSingleObject(thread, INFINITE); @@ -266,7 +267,7 @@ pthread_join(thread, NULL); #else #error Port me! -@@ -2038,7 +2100,7 @@ int64_t fileSize(std::string const& file +@@ -2038,7 +2100,7 @@ int64_t fileSize(std::string const& filename) { return 0; else return file_status.st_size; @@ -275,7 +276,7 @@ struct stat file_status; if(stat(filename.c_str(), &file_status) != 0) return 0; -@@ -2181,6 +2243,8 @@ std::string getDefaultPluginPath( const +@@ -2181,6 +2243,8 @@ std::string getDefaultPluginPath( const char* plugin_n return format( "/usr/lib/foundationdb/plugins/%s.so", plugin_name ); #elif defined(__APPLE__) return format( "/usr/local/foundationdb/plugins/%s.dylib", plugin_name ); @@ -293,7 +294,7 @@ #error Port me! #endif -@@ -2446,7 +2510,7 @@ bool isLibraryLoaded(const char* lib_pat +@@ -2446,7 +2510,7 @@ bool isLibraryLoaded(const char* lib_path) { } void* loadLibrary(const char* lib_path) { |
