diff options
author | dzwdz | 2023-09-22 23:42:30 +0200 |
---|---|---|
committer | dzwdz | 2023-09-22 23:42:30 +0200 |
commit | 6a4d4a41a664e6a4c406a449ea847abd4a224bcf (patch) | |
tree | 0a637697c8697929beb8f4b7ff69d8b74f9e28bb /src/cmd/logfs/logfs.c | |
parent | a3d6aa9f8d427b86a33dc05bed98a2e88229a285 (diff) |
build: support single file commands
Diffstat (limited to 'src/cmd/logfs/logfs.c')
-rw-r--r-- | src/cmd/logfs/logfs.c | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/src/cmd/logfs/logfs.c b/src/cmd/logfs/logfs.c deleted file mode 100644 index a50d530..0000000 --- a/src/cmd/logfs/logfs.c +++ /dev/null @@ -1,34 +0,0 @@ -#include <camellia.h> -#include <camellia/syscalls.h> -#include <err.h> -#include <stdio.h> -#include <stdlib.h> -#include <camellia/fs/misc.h> - -_Noreturn void fs(void) { - const size_t buflen = 1024; - char *buf = malloc(buflen); - if (!buf) err(1, "malloc"); - for (;;) { - struct ufs_request req; - hid_t reqh = ufs_wait(buf, buflen, &req); - if (reqh < 0) errx(1, "ufs_wait error"); - - switch (req.op) { - case VFSOP_OPEN: - printf("[logfs] open(\"%s\", 0x%x)\n", buf, req.flags); - forward_open(reqh, buf, req.len, req.flags); - break; - default: - /* Unsupported vfs operation. - * Currently if you never create your own file descriptors you won't receive - * anything but VFSOP_OPEN, but it's idiomatic to handle this anyways. */ - _sys_fs_respond(reqh, NULL, -1, 0); - break; - } - } -} - -int main(void) { - fs(); -} |