Step 2: move code to .cpp

This commit is contained in:
Alexey Milovidov 2020-10-03 03:02:47 +03:00
parent 6608de470d
commit 2441be4b66
2 changed files with 15 additions and 11 deletions

View File

@ -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

View File

@ -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);
}