mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
UserspaceEmulator: Support ioctl(TCGETS) and ioctl(TCSETS)
This commit is contained in:
parent
e0e3e5b9b1
commit
d608d714b9
Notes:
sideshowbarker
2024-07-19 04:15:07 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/d608d714b98
1 changed files with 17 additions and 0 deletions
|
@ -42,6 +42,7 @@
|
|||
#include <sys/socket.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/time.h>
|
||||
#include <termios.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
|
@ -905,6 +906,22 @@ int Emulator::virt$ioctl(int fd, unsigned request, FlatPtr arg)
|
|||
if (request == TIOCSPGRP) {
|
||||
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;
|
||||
dump_backtrace();
|
||||
TODO();
|
||||
|
|
Loading…
Reference in a new issue