summaryrefslogtreecommitdiff
path: root/src/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel')
-rw-r--r--src/kernel/arch/amd64/driver/fsroot.c2
-rw-r--r--src/kernel/arch/amd64/driver/serial.c2
-rw-r--r--src/kernel/syscalls.c2
3 files changed, 4 insertions, 2 deletions
diff --git a/src/kernel/arch/amd64/driver/fsroot.c b/src/kernel/arch/amd64/driver/fsroot.c
index c4c3de4..2feaf67 100644
--- a/src/kernel/arch/amd64/driver/fsroot.c
+++ b/src/kernel/arch/amd64/driver/fsroot.c
@@ -94,6 +94,8 @@ static int handle(struct vfs_request *req) {
switch (id) {
case HANDLE_VGA: {
void *vga = (void*)0xB8000;
+ if (req->flags)
+ return -1;
fs_normslice(&req->offset, &req->input.len, 80*25*2, false);
if (!virt_cpy_from(req->caller->pages, vga + req->offset,
req->input.buf, req->input.len))
diff --git a/src/kernel/arch/amd64/driver/serial.c b/src/kernel/arch/amd64/driver/serial.c
index 6dda657..93202c2 100644
--- a/src/kernel/arch/amd64/driver/serial.c
+++ b/src/kernel/arch/amd64/driver/serial.c
@@ -93,7 +93,7 @@ static void accept(struct vfs_request *req) {
}
break;
case VFSOP_WRITE:
- if (req->caller) {
+ if (req->caller && !req->flags) {
struct virt_iter iter;
virt_iter_new(&iter, req->input.buf, req->input.len,
req->caller->pages, true, false);
diff --git a/src/kernel/syscalls.c b/src/kernel/syscalls.c
index 0dec4c5..4537ff5 100644
--- a/src/kernel/syscalls.c
+++ b/src/kernel/syscalls.c
@@ -233,7 +233,7 @@ long _syscall_read(handle_t handle_num, void __user *buf, size_t len, long offse
long _syscall_write(handle_t handle_num, const void __user *buf, size_t len, long offset, int flags) {
struct handle *h = process_handle_get(process_current, handle_num);
if (!h) SYSCALL_RETURN(-1);
- if (flags != 0)
+ if (flags & ~(WRITE_TRUNCATE))
SYSCALL_RETURN(-ENOSYS);
switch (h->type) {
case HANDLE_FILE: