+static inline int gettid(void)
+{
+ return (int) _lwp_self();
+}
+
+static inline unsigned long long get_fs_free_size(const char *path)
+{
+ unsigned long long ret;
+ struct statvfs s;
+
+ if (statvfs(path, &s) < 0)
+ return -1ULL;
+
+ ret = s.f_frsize;
+ ret *= (unsigned long long) s.f_bfree;
+ return ret;
+}
+