我尝试在C ++中运行基本的FUSE代码。 代码基于BBFS代码,但非常精简:
struct fuse_operations oper;
int main(int argc, char* argv[])
{
// Initialise the operations
oper.getattr = caching_getattr;
oper.access = caching_access;
//... some more here
int fuse_stat = fuse_main(argc, argv, &oper, NULL);
return fuse_stat;
}
实现了这些功能,只记录了他们名字的文件。
我在运行此代码时看到的行为非常奇怪:应用程序完成其运行,但FUSE未运行。在我打电话给“卸载”之前,它的行为是一样的。来自贝壳。
此时(系统尝试销毁挂载),我在日志文件中看到调用了init()
和destroy()
函数。
任何想法为什么?为了让init()
立即运行,我需要做些什么吗?
答案 0 :(得分:0)
问题出在发送到FUSE主函数的参数中。