]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
more darwin tweaks
authorsageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Tue, 30 Jan 2007 16:54:43 +0000 (16:54 +0000)
committersageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Tue, 30 Jan 2007 16:54:43 +0000 (16:54 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1051 29311d96-e01e-0410-9327-a35deaab8ce9

trunk/ceph/Makefile
trunk/ceph/client/Client.cc
trunk/ceph/client/fuse.cc

index ae8646905bd3929f1bf76ab1e87fa24df606ffe3..81fcfc0858f1aba46179b49daf9ce69df225772b 100644 (file)
 #CFLAGS = -g -Wall -I. -D_FILE_OFFSET_BITS=64 -DMPICH_IGNORE_CXX_SEEK -D_REENTRANT -D_THREAD_SAFE
 #LIBS = -lpthread  
 
+# Hook for extra -I options, etc.
+EXTRA_CFLAGS = 
+
+ifeq ($(target),darwin)
+# For Darwin
+CFLAGS = -g -Wall -I. -D_FILE_OFFSET_BITS=64 -DMPICH_IGNORE_CXX_SEEK -D_REENTRANT -D_THREAD_SAFE -DDARWIN -D__FreeBSD__=10 ${EXTRA_CFLAGS}
+else
 # For linux
 CFLAGS = -g -Wall -I. -D_FILE_OFFSET_BITS=64 -DMPICH_IGNORE_CXX_SEEK -D_REENTRANT -D_THREAD_SAFE 
-# For Darwin
-#CFLAGS = -g -Wall -I. -D_FILE_OFFSET_BITS=64 -DMPICH_IGNORE_CXX_SEEK -D_REENTRANT -D_THREAD_SAFE -DDARWIN -D__FreeBSD__=5
+endif
 
 CC = g++
 LIBS = -lpthread
index db779d2322ce70bb2886b3d1b4a82ee2689cce1b..f0a3e81427c4f2f8e5d23d76368aec47219ba02a 100644 (file)
 #include <sys/stat.h>
 #include <fcntl.h>
 
+#ifdef DARWIN
+#include <sys/statvfs.h>
+#endif // DARWIN
+
 
 #include <iostream>
 using namespace std;
@@ -2526,15 +2530,29 @@ int Client::chdir(const char *path)
 }
 
 #ifdef DARWIN
-int Client::statfs(const char *path, struct statvfs *stbuf) 
+int Client::statfs(const char *path, struct statvfs *stbuf)
+{
+  bzero (stbuf, sizeof (struct statvfs));
+  // FIXME
+  stbuf->f_bsize   = 1024;
+  stbuf->f_frsize  = 1024;
+  stbuf->f_blocks  = 1024 * 1024;
+  stbuf->f_bfree   = 1024 * 1024;
+  stbuf->f_bavail  = 1024 * 1024;
+  stbuf->f_files   = 1024 * 1024;
+  stbuf->f_ffree   = 1024 * 1024;
+  stbuf->f_favail  = 1024 * 1024;
+  stbuf->f_namemax = 1024;
+
+  return 0;
+}
 #else
 int Client::statfs(const char *path, struct statfs *stbuf) 
-#endif
 {
   assert(0);  // implement me
   return 0;
 }
-
+#endif
 
 
 int Client::lazyio_propogate(int fd, off_t offset, size_t count)
index 994ff48624fa186eac622732ddb2b7c35c7a6636..94d15f9f79179305c9cc79bd6552326b107f4951 100644 (file)
@@ -256,8 +256,11 @@ int ceph_fuse_main(Client *c, int argc, char *argv[])
   
   // allow other (all!) users to see my file system
   // NOTE: echo user_allow_other >> /etc/fuse.conf
+  // NB: seems broken on Darwin
+#ifndef DARWIN
   newargv[newargc++] = "-o";
   newargv[newargc++] = "allow_other";
+#endif // DARWIN
   
   // use inos
   newargv[newargc++] = "-o";