return 0;
}
+void Client::getcwd(string& dir)
+{
+ filepath path;
+ cwd->make_path(path);
+ dir = path.get_path();
+}
+
int Client::statfs(const char *path, struct statvfs *stbuf)
{
Mutex::Locker l(client_lock);
// stl
+#include <string>
#include <set>
#include <map>
#include <fstream>
// crap
int chdir(const char *s);
- const char *getcwd();
+ void getcwd(std::string& cwd);
// namespace ops
int getdir(const char *relpath, list<string>& names); // get the whole dir at once.
return client->chdir(s);
}
+/*if we want to extern C this, we need to convert it to const char*,
+which will mean storing it somewhere or else making the caller
+responsible for delete-ing a c-string they didn't create*/
+void ceph_getcwd(string& cwd)
+{
+ client->getcwd(cwd);
+}
+
extern "C" int ceph_opendir(const char *name, DIR **dirpp)
{
return client->opendir(name, dirpp);
int ceph_statfs(const char *path, struct statvfs *stbuf);
int ceph_chdir (const char *s);
-const char *ceph_getcwd();
int ceph_opendir(const char *name, DIR **dirpp);
int ceph_closedir(DIR *dirp);
int ceph_sync_fs();
int ceph_get_stripe_unit(int fh);
#ifdef __cplusplus
-int ceph_getdir(const char *relpath, std::list<std::string>& names); //not for C, sorry!
+//not for C, sorry!
+int ceph_getdir(const char *relpath, std::list<std::string>& names);
+void ceph_getcwd(std::string& cwd);
}
#endif