Пример #1
0
struct fuse_chan *fuse_mount(const char *mountpoint, struct fuse_args *args)
{
	struct fuse_chan *ch;
	int fd;

	/*
	 * Make sure file descriptors 0, 1 and 2 are open, otherwise chaos
	 * would ensue.
	 */
	do {
		fd = open("/dev/null", O_RDWR);
		if (fd > 2)
			close(fd);
	} while (fd >= 0 && fd <= 2);

	fd = fuse_kern_mount(mountpoint, args);
	if (fd == -1)
		return NULL;

	ch = fuse_chan_new(fd);
	if (!ch)
		fuse_kern_unmount(mountpoint, fd);

	return ch;
}
int fuse_mount_compat25(const char *mountpoint, struct fuse_args *args)
{
	return fuse_kern_mount(mountpoint, args);
}