mirror of
https://github.com/RGBCube/serenity
synced 2025-07-05 23:17:34 +00:00
UserspaceEmulator: Support ioctl(TCGETS) and ioctl(TCSETS)
This commit is contained in:
parent
e0e3e5b9b1
commit
d608d714b9
1 changed files with 17 additions and 0 deletions
|
@ -42,6 +42,7 @@
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
#include <termios.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#if defined(__GNUC__) && !defined(__clang__)
|
#if defined(__GNUC__) && !defined(__clang__)
|
||||||
|
@ -905,6 +906,22 @@ int Emulator::virt$ioctl(int fd, unsigned request, FlatPtr arg)
|
||||||
if (request == TIOCSPGRP) {
|
if (request == TIOCSPGRP) {
|
||||||
return syscall(SC_ioctl, fd, request, arg);
|
return syscall(SC_ioctl, fd, request, arg);
|
||||||
}
|
}
|
||||||
|
if (request == TCGETS) {
|
||||||
|
struct termios termios;
|
||||||
|
int rc = syscall(SC_ioctl, fd, request, &termios);
|
||||||
|
if (rc < 0)
|
||||||
|
return rc;
|
||||||
|
mmu().copy_to_vm(arg, &termios, sizeof(termios));
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
if (request == TCSETS) {
|
||||||
|
struct termios termios;
|
||||||
|
mmu().copy_from_vm(&termios, arg, sizeof(termios));
|
||||||
|
int rc = syscall(SC_ioctl, fd, request, &termios);
|
||||||
|
if (rc < 0)
|
||||||
|
return rc;
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
dbg() << "Unsupported ioctl: " << request;
|
dbg() << "Unsupported ioctl: " << request;
|
||||||
dump_backtrace();
|
dump_backtrace();
|
||||||
TODO();
|
TODO();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue