Overview
| Comment: | Added start of appfs |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
40155f723537f6018dfeac76e45a76e4 |
| User & Date: | rkeene on 2014-09-07 06:36:15 |
| Other Links: | manifest | tags |
Context
|
2014-09-07
| ||
| 06:42 | Updated to use PKG_CONFIG check-in: 777947ec3d user: rkeene tags: trunk | |
| 06:36 | Added start of appfs check-in: 40155f7235 user: rkeene tags: trunk | |
| 06:34 | initial empty check-in check-in: 78c60b0c9e user: rkeene tags: trunk | |
Changes
Added Makefile version [44f1b4fcef].
> > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | CC = gcc LIBS = -lfuse PREFIX = /usr/local prefix = $(PREFIX) bindir = $(prefix)/bin all: appfs appfs: appfs.o $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o appfs appfs.o $(LIBS) appfs.o: appfs.c install: appfs cp appfs $(bindir) clean: rm -f appfs appfs.o distclean: clean .PHONY: all clean distclean install |
Added appfs.c version [c3eac4ab1b].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
#define FUSE_USE_VERSION 26
#define _FILE_OFFSET_BITS 64
#include <fuse.h>
#include <errno.h>
#include <string.h>
#include <fcntl.h>
static int appfs_getattr(const char *path, struct stat *stbuf) {
int res = 0;
memset(stbuf, 0, sizeof(struct stat));
if (strcmp(path, "/") == 0) {
stbuf->st_mode = S_IFDIR | 0755;
stbuf->st_nlink = 2;
} else {
res = -ENOENT;
}
return res;
}
static int appfs_readdir(const char *path, void *buf, fuse_fill_dir_t filler, off_t offset, struct fuse_file_info *fi) {
if (strcmp(path, "/") != 0) {
return(-ENOENT);
}
filler(buf, ".", NULL, 0);
filler(buf, "..", NULL, 0);
return 0;
}
static int appfs_open(const char *path, struct fuse_file_info *fi) {
return(-ENOENT);
if ((fi->flags & 3) != O_RDONLY)
return -EACCES;
return 0;
}
static int appfs_read(const char *path, char *buf, size_t size, off_t offset, struct fuse_file_info *fi) {
return(-ENOENT);
}
static struct fuse_operations appfs_oper = {
.getattr = appfs_getattr,
.readdir = appfs_readdir,
.open = appfs_open,
.read = appfs_read,
};
int main(int argc, char **argv) {
return(fuse_main(argc, argv, &appfs_oper, NULL));
}
|