MiniDLNA update: 1.0.19.1 to 1.0.20
[tomato.git] / release / src / router / ntfs-3g / libfuse-lite / helper.c
blob6c640aece9e364385d57ad62215a4b8d2fdbae69
1 /*
2 FUSE: Filesystem in Userspace
3 Copyright (C) 2001-2007 Miklos Szeredi <miklos@szeredi.hu>
5 This program can be distributed under the terms of the GNU LGPLv2.
6 See the file COPYING.LIB.
7 */
9 #include "config.h"
10 #include "fuse_i.h"
11 #include "fuse_lowlevel.h"
13 struct fuse_chan *fuse_mount(const char *mountpoint, struct fuse_args *args)
15 struct fuse_chan *ch;
16 int fd;
18 fd = fuse_kern_mount(mountpoint, args);
19 if (fd == -1)
20 return NULL;
22 ch = fuse_kern_chan_new(fd);
23 if (!ch)
24 fuse_kern_unmount(mountpoint, fd);
26 return ch;
29 void fuse_unmount(const char *mountpoint, struct fuse_chan *ch)
31 int fd = ch ? fuse_chan_fd(ch) : -1;
32 fuse_kern_unmount(mountpoint, fd);
33 fuse_chan_destroy(ch);
36 int fuse_version(void)
38 return FUSE_VERSION;