diff options
author | AnotherTest <ali.mpfard@gmail.com> | 2020-10-24 11:20:36 +0330 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-10-25 10:13:03 +0100 |
commit | 33730cbd925c95e36461152a595a43de29409707 (patch) | |
tree | fce599f9d699358f009b214e99abf808d526749c /DevTools/UserspaceEmulator | |
parent | aee0df19c18cbdc91173c944d285b7f03d703ef5 (diff) | |
download | serenity-33730cbd925c95e36461152a595a43de29409707.zip |
UserspaceEmulator: Add support for some more ioctl() requests
Diffstat (limited to 'DevTools/UserspaceEmulator')
-rw-r--r-- | DevTools/UserspaceEmulator/Emulator.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/DevTools/UserspaceEmulator/Emulator.cpp b/DevTools/UserspaceEmulator/Emulator.cpp index fe7d1afb72..5739636991 100644 --- a/DevTools/UserspaceEmulator/Emulator.cpp +++ b/DevTools/UserspaceEmulator/Emulator.cpp @@ -34,6 +34,8 @@ #include <Kernel/API/Syscall.h> #include <LibX86/ELFSymbolProvider.h> #include <fcntl.h> +#include <net/if.h> +#include <net/route.h> #include <serenity.h> #include <stdio.h> #include <string.h> @@ -965,6 +967,25 @@ int Emulator::virt$ioctl(int fd, unsigned request, FlatPtr arg) mmu().copy_from_vm(&termios, arg, sizeof(termios)); return syscall(SC_ioctl, fd, request, &termios); } + if (request == TIOCNOTTY || request == TIOCSCTTY) { + return syscall(SC_ioctl, fd, request, 0); + } + if (request == FB_IOCTL_GET_SIZE_IN_BYTES) { + size_t size = 0; + auto rc = syscall(SC_ioctl, fd, request, &size); + mmu().copy_to_vm(arg, &size, sizeof(size)); + return rc; + } + if (request == FB_IOCTL_SET_RESOLUTION) { + FBResolution user_resolution; + mmu().copy_from_vm(&user_resolution, arg, sizeof(user_resolution)); + auto rc = syscall(SC_ioctl, fd, request, &user_resolution); + mmu().copy_to_vm(arg, &user_resolution, sizeof(user_resolution)); + return rc; + } + if (request == FB_IOCTL_SET_BUFFER) { + return syscall(SC_ioctl, fd, request, arg); + } reportln("Unsupported ioctl: {}", request); dump_backtrace(); TODO(); |