diff options
| author | Miguel <m.i@gmx.at> | 2018-09-19 01:52:14 +0200 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2018-09-19 01:52:14 +0200 |
| commit | 1e08b64b43bf9c50b644da3f76d5a8bcc73f62da (patch) | |
| tree | 53aca729b7faeb781b04b9c62a7b1b13efa21991 /fs/pipe.c | |
| parent | 2d91384197847a7e8fe2c3f548918a8277d3086d (diff) | |
addding sysfs and pipes etc
Diffstat (limited to 'fs/pipe.c')
| -rw-r--r-- | fs/pipe.c | 37 |
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); +} |
