diff options
author | Ian Moffett <ian@osmora.org> | 2025-07-03 19:59:45 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-07-03 19:59:45 -0400 |
commit | 23a8e1b78063c0276d987e835434700267b9c8f8 (patch) | |
tree | 19886b291f9c56fb2c90068aece37aee991cca79 /lib/libc/src/stdio/fputc.c | |
parent | 9c7fcf89f9ec234dd55ace2c48f4fcc84069c5ac (diff) |
kernel: Ensure mutually exclusive console accessexpt
If multiple processes try to write to the console, a race condition
of sorts may occur. Similarly, if multiple processes try to read from the
console and contend with the console input buffer. One process may steal
keys from the other. Prevent this by implementing a mutex within the
console descriptor. Each time a process reads or writes the console, it
attaches itself. Any other processes attempting to read or write the
console while another is attached will be yielded to the scheduler
until the resource is free.
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'lib/libc/src/stdio/fputc.c')
0 files changed, 0 insertions, 0 deletions