mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-04 17:33:04 +00:00
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.
This commit is contained in:
parent
e287f8ef3a
commit
da3857b0c2
Notes:
sideshowbarker
2024-07-19 18:31:54 +09:00
Author: https://github.com/awesomekling
Commit: da3857b0c2
10 changed files with 42 additions and 22 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue