From f2703089da21898e9c3127615e98c1717c7ceeb5 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Mon, 8 Aug 2022 19:04:27 +0200 Subject: user/libc: cwd --- src/user/lib/include/unistd.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/user/lib/include') diff --git a/src/user/lib/include/unistd.h b/src/user/lib/include/unistd.h index 4f367ca..aedca1b 100644 --- a/src/user/lib/include/unistd.h +++ b/src/user/lib/include/unistd.h @@ -6,3 +6,12 @@ int close(handle_t h); _Noreturn void exit(int); int execv(const char *path, char *const argv[]); + +int chdir(const char *path); +char *getcwd(char *buf, size_t size); +/* Converts a relative path to an absolute one, simplifying it if possible. + * If in == NULL - return the length of cwd (without a trailing slash) + * If size isn't enough to fit the path, returns the amount of bytes needed to fit + * it, including the null byte. + * @return 0 on failure, length of the path otherwise */ +size_t absolutepath(char *out, const char *in, size_t size); -- cgit v1.2.3