Skip to content
Snippets Groups Projects
Commit 6abe05cd authored by Nadav Har'El's avatar Nadav Har'El
Browse files

Fix implementation of TCGETS ioctl on console

While I implemented TCSETS ioctl, TCGETS used to be a no-op. This patch
implements it (which is trivial). TGETS is need because the standard
idiom for programs which switch to raw mode is to use TCGETS to save the
original mode, then use TCSETS, and when exiting restore the original mode.

Also used <sys/ioctl.h> definitions (from the host...) instead of the ugly
ioctl numbers.
parent 39a80e71
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <queue> #include <queue>
#include <deque> #include <deque>
#include <vector> #include <vector>
#include <sys/ioctl.h>
#include "isa-serial.hh" #include "isa-serial.hh"
#include "debug-console.hh" #include "debug-console.hh"
...@@ -200,9 +201,10 @@ static int ...@@ -200,9 +201,10 @@ static int
console_ioctl(struct device *dev, u_long request, void *arg) console_ioctl(struct device *dev, u_long request, void *arg)
{ {
switch (request) { switch (request) {
case 0x5401: // TCGETS case TCGETS:
return 0; // XXX: stubbing out to get libc into line buffering mode *static_cast<termios*>(arg) = tio;
case 0x5402: // TCSETS return 0;
case TCSETS:
tio = *static_cast<termios*>(arg); tio = *static_cast<termios*>(arg);
return 0; return 0;
default: default:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment