aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/include
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ens.fr>2015-02-19 18:25:29 +0100
committerAlex Auvolat <alex.auvolat@ens.fr>2015-02-19 18:25:29 +0100
commit277b329c5609b8172ad0c142117edfa9a08279da (patch)
tree23dc957e64e5b67e61072516bea30d650ffcefdd /src/kernel/include
parent408faed4df730384538aaa0e338ae8ea7abe400d (diff)
downloadkogata-277b329c5609b8172ad0c142117edfa9a08279da.tar.gz
kogata-277b329c5609b8172ad0c142117edfa9a08279da.zip
Implement basic syscalls...
Diffstat (limited to 'src/kernel/include')
-rw-r--r--src/kernel/include/process.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/kernel/include/process.h b/src/kernel/include/process.h
index 5d9c3bf..07cc14e 100644
--- a/src/kernel/include/process.h
+++ b/src/kernel/include/process.h
@@ -18,7 +18,6 @@
#include <mmap.h>
-
#define USERSTACK_ADDR 0xB8000000
#define USERSTACK_SIZE 0x00020000 // 32 KB
@@ -29,6 +28,8 @@ typedef struct process {
btree_t *regions_idx;
hashtbl_t *filesystems;
+ hashtbl_t *files;
+ int next_fd;
thread_t *thread;
@@ -47,7 +48,10 @@ bool start_process(process_t *p, proc_entry_t entry); // maps a region for user
bool proc_add_fs(process_t *p, fs_t *fs, const char* name);
fs_t *proc_find_fs(process_t *p, const char* name);
-bool proc_rm_fs(process_t *p, const char* name);
+void proc_rm_fs(process_t *p, const char* name);
+int proc_add_fd(process_t *p, fs_handle_t *f); // on error returns 0, nonzero other<ise
+fs_handle_t *proc_read_fd(process_t *p, int fd);
+void proc_close_fd(process_t *p, int fd);
bool mmap(process_t *proc, void* addr, size_t size, int mode); // create empty zone
bool mmap_file(process_t *proc, fs_handle_t *h, size_t offset, void* addr, size_t size, int mode);