diff options
author | dzwdz | 2022-07-29 19:06:23 +0200 |
---|---|---|
committer | dzwdz | 2022-07-29 19:06:23 +0200 |
commit | 2cdc815322af6c7c22b9ceb371d9c7b2a4853c0e (patch) | |
tree | 98023777a62a533a3ac1d68ef99bcdd8bbee685e /src/kernel/arch/amd64 | |
parent | a658e1068eb2f849736931d2b99bcb6290c7ec0a (diff) |
syscall/write: WRITE_TRUNCATE
Diffstat (limited to 'src/kernel/arch/amd64')
-rw-r--r-- | src/kernel/arch/amd64/driver/fsroot.c | 2 | ||||
-rw-r--r-- | src/kernel/arch/amd64/driver/serial.c | 2 |
2 files changed, 3 insertions, 1 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); |