summaryrefslogtreecommitdiff
path: root/Kernel/Process.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2018-11-08 01:23:23 +0100
committerAndreas Kling <awesomekling@gmail.com>2018-11-08 01:23:47 +0100
commitda3857b0c23a4e99edc2481c93c7f3bebda510cc (patch)
treee32c162d311a06f3678b28a967344b04c9f77ee0 /Kernel/Process.cpp
parente287f8ef3adc88112e1c2336adc4a27365058db8 (diff)
downloadserenity-da3857b0c23a4e99edc2481c93c7f3bebda510cc.zip
Add some simple write buffering to LibC's stdio.
Plumb it all the way to the VirtualConsole. Also fix /bin/cat to write() the whole chunks we get from read() directly to stdout.
Diffstat (limited to 'Kernel/Process.cpp')
-rw-r--r--Kernel/Process.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp
index c7ecaa01be..19aec8c7bf 100644
--- a/Kernel/Process.cpp
+++ b/Kernel/Process.cpp
@@ -29,15 +29,19 @@
#define VALIDATE_USER_READ(b, s) \
do { \
LinearAddress laddr((dword)(b)); \
- if (!validate_user_read(laddr) || !validate_user_read(laddr.offset((s) - 1))) \
+ if (!validate_user_read(laddr) || !validate_user_read(laddr.offset((s) - 1))) { \
+ dbgprintf("Bad read address passed to syscall: %p +%u\n", laddr.get(), (s)); \
return -EFAULT; \
+ } \
} while(0)
#define VALIDATE_USER_WRITE(b, s) \
do { \
LinearAddress laddr((dword)(b)); \
- if (!validate_user_write(laddr) || !validate_user_write(laddr.offset((s) - 1))) \
+ if (!validate_user_write(laddr) || !validate_user_write(laddr.offset((s) - 1))) { \
+ dbgprintf("Bad write address passed to syscall: %p +%u\n", laddr.get(), (s)); \
return -EFAULT; \
+ } \
} while(0)
static const DWORD defaultStackSize = 16384;