mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 19:28:12 +00:00
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. :^)
This commit is contained in:
parent
d551263b11
commit
1a08ac72ad
21 changed files with 51 additions and 69 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue