summaryrefslogtreecommitdiff
path: root/src/init/fs/misc.c
diff options
context:
space:
mode:
authordzwdz2022-07-08 14:40:44 +0200
committerdzwdz2022-07-08 14:40:44 +0200
commit1f7e7501660123ff8f26e8c65e75c2b282b933ef (patch)
tree5ba6cee10ac656b20dcabc9c9f7b079dcd952a45 /src/init/fs/misc.c
parente567ebeee5ea196128f15adcf30cec5dd1137f90 (diff)
syscall/fs_respond: get the file id from the buf argument
Previously, file ids could only be positive integers, so their range was 31 bits - not enough to represent the entire memory. Now, pointers can be safely used as file ids.
Diffstat (limited to 'src/init/fs/misc.c')
-rw-r--r--src/init/fs/misc.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/init/fs/misc.c b/src/init/fs/misc.c
index b394c26..701db9f 100644
--- a/src/init/fs/misc.c
+++ b/src/init/fs/misc.c
@@ -188,7 +188,7 @@ void fs_dir_inject(const char *path) {
/* if we're making up the opened directory, disallow create */
if (ret < 0 && (res.flags & OPEN_CREATE)) hid = ret;
- _syscall_fs_respond(NULL, hid, 0);
+ _syscall_fs_respond((void*)hid, hid, 0);
} else {
/* not injecting, don't allow opening nonexistent stuff */
@@ -198,16 +198,16 @@ void fs_dir_inject(const char *path) {
break;
case VFSOP_CLOSE:
- if (handles[res.id].delegate >= 0)
- _syscall_close(handles[res.id].delegate);
- handles[res.id].taken = false;
+ if (handles[(int)res.id].delegate >= 0)
+ _syscall_close(handles[(int)res.id].delegate);
+ handles[(int)res.id].taken = false;
_syscall_fs_respond(NULL, 0, 0);
break;
case VFSOP_READ:
- if (handles[res.id].inject) {
+ if (handles[(int)res.id].inject) {
if (res.offset > 0) _syscall_fs_respond(NULL, 0, 0); // TODO working offsets
- struct fs_dir_handle h = handles[res.id];
+ struct fs_dir_handle h = handles[(int)res.id];
int out_len = 0;
while (h.inject[out_len] && h.inject[out_len] != '/')
@@ -232,7 +232,7 @@ void fs_dir_inject(const char *path) {
/* fallthrough */
default: {
- struct fs_dir_handle h = handles[res.id];
+ struct fs_dir_handle h = handles[(int)res.id];
if (h.delegate < 0)
_syscall_fs_respond(NULL, -1, 0);
else