summaryrefslogtreecommitdiff
path: root/fs/pipe.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/pipe.c')
-rw-r--r--fs/pipe.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/fs/pipe.c b/fs/pipe.c
new file mode 100644
index 0000000..cbba7a9
--- /dev/null
+++ b/fs/pipe.c
@@ -0,0 +1,37 @@
+#include "kernel.h"
+#include "mount.h"
+#include "pipe.h"
+#include "log.h"
+
+#include "lib/string/string.h"
+
+/* mount interface */
+
+fd pipe_file_open(mount *m,char *path)
+{
+ fd a;
+ a.type=FD_TYPE_PIPE;
+// return fd_from_
+ return a;
+}
+
+int pipe_read_dir(mount *m,char *path, fs_dirent *dirs, uint32_t *pos)
+{
+ /*
+ if(*pos>=count)return 0;
+ memcpy(dirs->name,names[*pos],strlen(names[*pos])+1);
+ *pos+=1;
+ return 1;
+ */
+ return 0;
+}
+
+void pipe_mount(char* path)
+{
+ mount m;
+ m.type=MOUNT_TYPE_PIPES;
+ memcpy(m.path,path,strlen(path)+1);
+ m.mount_file_open=pipe_file_open;
+ m.mount_read_dir=pipe_read_dir;
+ mount_add(m);
+}