diff options
author | Andreas Kling <kling@serenityos.org> | 2021-01-12 19:21:59 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-01-12 23:34:01 +0100 |
commit | 1a08ac72ad4610689f23ae76f41bd8adcb23fe47 (patch) | |
tree | 844395bad7a402d864512296360c9c2ef0083712 /Userland/DevTools | |
parent | d551263b111bc83e65fa845ef245f43982dfd7ad (diff) | |
download | serenity-1a08ac72ad4610689f23ae76f41bd8adcb23fe47.zip |
LibC+Everywhere: Remove open_with_path_length() in favor of open()
This API was a mostly gratuitous deviation from POSIX that gave up some
portability in exchange for avoiding the occasional strlen().
I don't think that was actually achieving anything valuable, so let's
just chill out and have the same open() API as everyone else. :^)
Diffstat (limited to 'Userland/DevTools')
-rw-r--r-- | Userland/DevTools/UserspaceEmulator/Emulator.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Userland/DevTools/UserspaceEmulator/Emulator.cpp b/Userland/DevTools/UserspaceEmulator/Emulator.cpp index c463d24618..107dbf5cbb 100644 --- a/Userland/DevTools/UserspaceEmulator/Emulator.cpp +++ b/Userland/DevTools/UserspaceEmulator/Emulator.cpp @@ -988,10 +988,14 @@ u32 Emulator::virt$open(u32 params_addr) auto path = mmu().copy_buffer_from_vm((FlatPtr)params.path.characters, params.path.length); - int fd = openat_with_path_length(params.dirfd, (const char*)path.data(), path.size(), params.options, params.mode); - if (fd < 0) - return -errno; - return fd; + Syscall::SC_open_params host_params {}; + host_params.dirfd = params.dirfd; + host_params.mode = params.mode; + host_params.options = params.options; + host_params.path.characters = (const char*)path.data(); + host_params.path.length = path.size(); + + return syscall(SC_open, &host_params); } int Emulator::virt$pipe(FlatPtr vm_pipefd, int flags) |