summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorDaniel Bertalan <dani@danielbertalan.dev>2021-10-25 14:36:05 +0200
committerAndreas Kling <kling@serenityos.org>2021-10-25 21:42:26 +0200
commit5f6030b13cb24ad209b96f27f0f95152ceab439d (patch)
tree643998c2f46eadacd5a3b00628e6a4c966560c3e /Kernel
parent0e68550c051a6f1b629f9ca7f7ae968044f93b91 (diff)
downloadserenity-5f6030b13cb24ad209b96f27f0f95152ceab439d.zip
Kernel+LibC: Default to 8-bit characters in TTY
Some ports (like `bc` with history enabled) sensibly set the termios character size to 8 bits. Previously, we left the character size value (given by the bitmask CSIZE) as zero by default (meaning 5 bits per character), and returned ENOTIMPL whenever someone modified it. This was dumb.
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/TTY/TTY.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/Kernel/TTY/TTY.cpp b/Kernel/TTY/TTY.cpp
index 86ea95cd94..0d3e6aec38 100644
--- a/Kernel/TTY/TTY.cpp
+++ b/Kernel/TTY/TTY.cpp
@@ -438,12 +438,12 @@ KResult TTY::set_termios(const termios& t)
}
}
+ if ((m_termios.c_cflag & CSIZE) != CS8) {
+ dbgln("FIXME: Character sizes other than 8 bits are not supported");
+ rc = ENOTIMPL;
+ }
+
static constexpr FlagDescription unimplemented_cflags[] = {
- { CSIZE, "CSIZE" },
- { CS5, "CS5" },
- { CS6, "CS6" },
- { CS7, "CS7" },
- { CS8, "CS8" },
{ CSTOPB, "CSTOPB" },
{ CREAD, "CREAD" },
{ PARENB, "PARENB" },