diff options
author | Liav A <liavalb@gmail.com> | 2022-02-15 21:41:41 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-03-22 20:26:05 +0100 |
commit | b5ef900ccde41dd8bf922eeae8ebdcc964539f46 (patch) | |
tree | f718c887141041e7e565197b50c569f69ac4955c /Userland/DevTools/UserspaceEmulator | |
parent | de7566c2c49ca30785e90194f91bc81f907a5f70 (diff) | |
download | serenity-b5ef900ccde41dd8bf922eeae8ebdcc964539f46.zip |
Kernel: Don't assume paths of TTYs and pseudo terminals anymore
The obsolete ttyname and ptsname syscalls are removed.
LibC doesn't rely on these anymore, and it helps simplifying the Kernel
in many places, so it's an overall an improvement.
In addition to that, /proc/PID/tty node is removed too as it is not
needed anymore by userspace to get the attached TTY of a process, as
/dev/tty (which is already a character device) represents that as well.
Diffstat (limited to 'Userland/DevTools/UserspaceEmulator')
-rw-r--r-- | Userland/DevTools/UserspaceEmulator/Emulator.h | 2 | ||||
-rw-r--r-- | Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp | 23 |
2 files changed, 0 insertions, 25 deletions
diff --git a/Userland/DevTools/UserspaceEmulator/Emulator.h b/Userland/DevTools/UserspaceEmulator/Emulator.h index 6c7ddcff42..29b113f8ff 100644 --- a/Userland/DevTools/UserspaceEmulator/Emulator.h +++ b/Userland/DevTools/UserspaceEmulator/Emulator.h @@ -214,7 +214,6 @@ private: int virt$poll(FlatPtr); int virt$profiling_disable(pid_t); int virt$profiling_enable(pid_t); - int virt$ptsname(int fd, FlatPtr buffer, size_t buffer_size); int virt$purge(int mode); u32 virt$read(int, FlatPtr, ssize_t); int virt$readlink(FlatPtr); @@ -246,7 +245,6 @@ private: int virt$symlink(FlatPtr address); void virt$sync(); u32 virt$sysconf(u32 name); - int virt$ttyname(int fd, FlatPtr buffer, size_t buffer_size); mode_t virt$umask(mode_t); int virt$uname(FlatPtr params_addr); int virt$unlink(FlatPtr path, size_t path_length); diff --git a/Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp b/Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp index ea35e75604..e2b2e668e3 100644 --- a/Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp +++ b/Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp @@ -184,8 +184,6 @@ u32 Emulator::virt_syscall(u32 function, u32 arg1, u32 arg2, u32 arg3) return virt$profiling_disable(arg1); case SC_profiling_enable: return virt$profiling_enable(arg1); - case SC_ptsname: - return virt$ptsname(arg1, arg2, arg3); case SC_purge: return virt$purge(arg1); case SC_read: @@ -249,8 +247,6 @@ u32 Emulator::virt_syscall(u32 function, u32 arg1, u32 arg2, u32 arg3) return 0; case SC_sysconf: return virt$sysconf(arg1); - case SC_ttyname: - return virt$ttyname(arg1, arg2, arg3); case SC_umask: return virt$umask(arg1); case SC_uname: @@ -1454,19 +1450,6 @@ int Emulator::virt$setpgid(pid_t pid, pid_t pgid) return syscall(SC_setpgid, pid, pgid); } -int Emulator::virt$ttyname(int fd, FlatPtr buffer, size_t buffer_size) -{ - auto buffer_result = ByteBuffer::create_zeroed(buffer_size); - if (buffer_result.is_error()) - return -ENOMEM; - auto& host_buffer = buffer_result.value(); - int rc = syscall(SC_ttyname, fd, host_buffer.data(), host_buffer.size()); - if (rc < 0) - return rc; - mmu().copy_to_vm(buffer, host_buffer.data(), host_buffer.size()); - return rc; -} - int Emulator::virt$getcwd(FlatPtr buffer, size_t buffer_size) { auto buffer_result = ByteBuffer::create_zeroed(buffer_size); @@ -1642,12 +1625,6 @@ u32 Emulator::virt$allocate_tls(FlatPtr initial_data, size_t size) return tls_base; } -int Emulator::virt$ptsname(int fd, FlatPtr buffer, size_t buffer_size) -{ - auto pts = mmu().copy_buffer_from_vm(buffer, buffer_size); - return syscall(SC_ptsname, fd, pts.data(), pts.size()); -} - int Emulator::virt$beep() { return syscall(SC_beep); |