1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:07:35 +00:00

Kernel+LibC: Make sys$getcwd truncate the result silently

This gives us the superpower of knowing the ideal buffer length if it fails.
See also https://github.com/SerenityOS/serenity/discussions/4357
This commit is contained in:
Ben Wiederhake 2021-01-16 15:48:56 +01:00 committed by Andreas Kling
parent 7ed002d1ca
commit ea5825f2c9
3 changed files with 70 additions and 12 deletions

View file

@ -263,7 +263,7 @@ public:
int sys$select(const Syscall::SC_select_params*);
int sys$poll(Userspace<const Syscall::SC_poll_params*>);
ssize_t sys$get_dir_entries(int fd, void*, ssize_t);
int sys$getcwd(Userspace<char*>, ssize_t);
int sys$getcwd(Userspace<char*>, size_t);
int sys$chdir(Userspace<const char*>, size_t);
int sys$fchdir(int fd);
int sys$sleep(unsigned seconds);