⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fuse_loop.c

📁 FUSE文件系统开发工具,将内核层面的文件系统开发过程平移到应用层面上来。
💻 C
字号:
/*  FUSE: Filesystem in Userspace  Copyright (C) 2001-2007  Miklos Szeredi <miklos@szeredi.hu>  This program can be distributed under the terms of the GNU LGPLv2.  See the file COPYING.LIB*/#include "fuse_lowlevel.h"#include <stdio.h>#include <stdlib.h>#include <errno.h>int fuse_session_loop(struct fuse_session *se){	int res = 0;	struct fuse_chan *ch = fuse_session_next_chan(se, NULL);	size_t bufsize = fuse_chan_bufsize(ch);	char *buf = (char *) malloc(bufsize);	if (!buf) {		fprintf(stderr, "fuse: failed to allocate read buffer\n");		return -1;	}	while (!fuse_session_exited(se)) {		struct fuse_chan *tmpch = ch;		res = fuse_chan_recv(&tmpch, buf, bufsize);		if (res == -EINTR)			continue;		if (res <= 0)			break;		fuse_session_process(se, buf, res, tmpch);	}	free(buf);	fuse_session_reset(se);	return res < 0 ? -1 : 0;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -