aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/include
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ens.fr>2015-02-09 22:26:25 +0100
committerAlex Auvolat <alex.auvolat@ens.fr>2015-02-09 22:26:25 +0100
commitde27176a8164bd037b4669d1c2b8cc24a747e633 (patch)
tree56b30a6025b73edd7eb12004f1ae65f6731a035f /src/kernel/include
parenta1ebf864cc9f10f821413921f4aa5c75dcbe6f55 (diff)
downloadkogata-de27176a8164bd037b4669d1c2b8cc24a747e633.tar.gz
kogata-de27176a8164bd037b4669d1c2b8cc24a747e633.zip
Add stating on open files
Diffstat (limited to 'src/kernel/include')
-rw-r--r--src/kernel/include/nullfs.h1
-rw-r--r--src/kernel/include/vfs.h13
2 files changed, 3 insertions, 11 deletions
diff --git a/src/kernel/include/nullfs.h b/src/kernel/include/nullfs.h
index cfca023..265d41b 100644
--- a/src/kernel/include/nullfs.h
+++ b/src/kernel/include/nullfs.h
@@ -11,6 +11,7 @@ typedef struct {
void* (*open)(void* f, int mode, fs_handle_t *h);
size_t (*read)(void* f, size_t offset, size_t len, char* buf);
size_t (*write)(void* f, size_t offset, size_t len, const char* buf);
+ bool (*stat)(void* f, stat_t *st);
void (*close)(void* f);
void (*dispose)(void* f);
} nullfs_node_ops_t;
diff --git a/src/kernel/include/vfs.h b/src/kernel/include/vfs.h
index 0a6a955..3ee4367 100644
--- a/src/kernel/include/vfs.h
+++ b/src/kernel/include/vfs.h
@@ -3,17 +3,7 @@
#include <stdbool.h>
#include <malloc.h>
-typedef struct {
- // TODO
- // (should also be moved to a user-visible header)
-} stat_t;
-
-#define FM_READ (0x01)
-#define FM_WRITE (0x02)
-#define FM_MMAP (0x04)
-#define FM_CREATE (0x10)
-#define FM_TRUNC (0x20)
-#define FM_APPEND (0x40)
+#include <fs.h> // common header
// How to use :
// - when using a filesystem : never call the operations in fs_*_ops_t directly, use
@@ -27,6 +17,7 @@ typedef struct {
typedef struct {
size_t (*read)(void* f, size_t offset, size_t len, char* buf);
size_t (*write)(void* f, size_t offset, size_t len, const char* buf);
+ bool (*stat)(void* f, stat_t *st);
void (*close)(void* f);
} fs_handle_ops_t;