RFuse-ngを使ってみる
Fedora12 x64で試す。
ruby1.8, ruby-develを入れておく。
解凍してパッチを当てる。次の内容のrfuse-ng.patch を作る
diff -Nurdp org.rfuse-ng/ext/rfuse.c rfuse-ng/ext/rfuse.c --- org.rfuse-ng/ext/rfuse.c 2010-05-04 01:57:18.000000000 +0900 +++ rfuse-ng/ext/rfuse.c 2010-05-18 19:19:46.163725354 +0900 @@ -882,14 +882,14 @@ static int rf_listxattr(const char *path } else { return -ERANGE; } - printf("destination: %s,%d\n",buf,size); - printf("source: %s,%d\n",rbuf,length); + printf("destination: %s,%zd\n",buf,size); + printf("source: %s,%zd\n",rbuf,length); return length; //TODO optimize,check lenght } else { - printf ("not copied: %s, %d\n",buf,length); + printf ("not copied: %s, %zd\n",buf,length); return length; } }
パッチを適用。解凍したrfuse-ngディレクトリとrfuse-ng.patchを同じディレクトリにおいて、
$ patch -p0 < rfuse-ng.patch
で適用。
$ ruby ext/extconf.rb checking for main() in -lfuse... yes creating Makefile
$ make gcc -I. -I. -I/usr/lib64/ruby/1.8/x86_64-linux -Iext -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -fPIC -Wall -Werror -D_FILE_OFFSET_BITS=64 -DFUSE_USE_VERSION=26 -c ext/rfuse_mod.c gcc -I. -I. -I/usr/lib64/ruby/1.8/x86_64-linux -Iext -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -fPIC -Wall -Werror -D_FILE_OFFSET_BITS=64 -DFUSE_USE_VERSION=26 -c ext/helper.c gcc -I. -I. -I/usr/lib64/ruby/1.8/x86_64-linux -Iext -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -fPIC -Wall -Werror -D_FILE_OFFSET_BITS=64 -DFUSE_USE_VERSION=26 -c ext/context.c gcc -I. -I. -I/usr/lib64/ruby/1.8/x86_64-linux -Iext -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -fPIC -Wall -Werror -D_FILE_OFFSET_BITS=64 -DFUSE_USE_VERSION=26 -c ext/rfuse.c gcc -I. -I. -I/usr/lib64/ruby/1.8/x86_64-linux -Iext -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -fPIC -Wall -Werror -D_FILE_OFFSET_BITS=64 -DFUSE_USE_VERSION=26 -c ext/file_info.c gcc -I. -I. -I/usr/lib64/ruby/1.8/x86_64-linux -Iext -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -fPIC -Wall -Werror -D_FILE_OFFSET_BITS=64 -DFUSE_USE_VERSION=26 -c ext/intern_rfuse.c gcc -I. -I. -I/usr/lib64/ruby/1.8/x86_64-linux -Iext -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -fPIC -Wall -Werror -D_FILE_OFFSET_BITS=64 -DFUSE_USE_VERSION=26 -c ext/filler.c gcc -shared -o rfuse_ng.so rfuse_mod.o helper.o context.o rfuse.o file_info.o intern_rfuse.o filler.o -L. -L/usr/lib64 -L. -rdynamic -Wl,-export-dynamic -lruby -lfuse -lpthread -lrt -ldl -lcrypt -lm -lc
# make install /usr/bin/install -c -m 0755 rfuse_ng.so /usr/lib64/ruby/site_ruby/1.8/x86_64-linux
# ./test-ruby.rb ./test-ruby.rb:319: [BUG] Segmentation fault ruby 1.8.6 (2010-02-05) [x86_64-linux] Aborted (core dumped)
おh…
ライブラリの方までデバッガで追いかけていく気力がないので今日はあきらめる。だれかー