mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
Step 2: move code to .cpp
This commit is contained in:
parent
6608de470d
commit
2441be4b66
@ -18,6 +18,20 @@ namespace ErrorCodes
|
||||
extern const int NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
|
||||
struct statvfs getStatVFS(const String & path)
|
||||
{
|
||||
struct statvfs fs;
|
||||
while (statvfs(path.c_str(), &fs) != 0)
|
||||
{
|
||||
if (errno == EINTR)
|
||||
continue;
|
||||
throwFromErrnoWithPath("Could not calculate available disk space (statvfs)", path, ErrorCodes::CANNOT_STATVFS);
|
||||
}
|
||||
return fs;
|
||||
}
|
||||
|
||||
|
||||
bool enoughSpaceInDirectory(const std::string & path [[maybe_unused]], size_t data_size [[maybe_unused]])
|
||||
{
|
||||
#if POCO_VERSION >= 0x01090000
|
||||
|
@ -32,16 +32,6 @@ std::filesystem::path getMountPoint(std::filesystem::path absolute_path);
|
||||
#endif
|
||||
String getFilesystemName([[maybe_unused]] const String & mount_point);
|
||||
|
||||
inline struct statvfs getStatVFS(const String & path)
|
||||
{
|
||||
struct statvfs fs;
|
||||
while (statvfs(path.c_str(), &fs) != 0)
|
||||
{
|
||||
if (errno == EINTR)
|
||||
continue;
|
||||
throwFromErrnoWithPath("Could not calculate available disk space (statvfs)", path, ErrorCodes::CANNOT_STATVFS);
|
||||
}
|
||||
return fs;
|
||||
}
|
||||
struct statvfs getStatVFS(const String & path);
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user