diff options
author | dzwdz | 2022-08-08 19:04:27 +0200 |
---|---|---|
committer | dzwdz | 2022-08-08 19:04:27 +0200 |
commit | f2703089da21898e9c3127615e98c1717c7ceeb5 (patch) | |
tree | d4a80164a20b34cbf594e72d758708be23c0e6e1 /src/user/lib/include | |
parent | a4634ea9458fcc4856ad52bcf383efcb9134091f (diff) |
user/libc: cwd
Diffstat (limited to 'src/user/lib/include')
-rw-r--r-- | src/user/lib/include/unistd.h | 9 |
1 files changed, 9 insertions, 0 deletions
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); |