summaryrefslogtreecommitdiff
path: root/src/user/lib/include
diff options
context:
space:
mode:
authordzwdz2022-08-09 18:29:25 +0200
committerdzwdz2022-08-09 18:29:25 +0200
commit9438c2fdaf4e75c9218a5fde84f121a7a0abb457 (patch)
tree4ed0de6a19d2180198d939c042237aa43e751c3a /src/user/lib/include
parentd51413be236c09f3946d390327595adc109fcf66 (diff)
user/libc: preserve cwd through exec()
Diffstat (limited to 'src/user/lib/include')
-rw-r--r--src/user/lib/include/unistd.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/user/lib/include/unistd.h b/src/user/lib/include/unistd.h
index aedca1b..2b75a13 100644
--- a/src/user/lib/include/unistd.h
+++ b/src/user/lib/include/unistd.h
@@ -10,8 +10,12 @@ 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 in == NULL - return the length of cwd. Doesn't include the trailing slash,
+ * except for the root dir. Includes the null byte.
* 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);
+
+// TODO put in an internal libc header
+void __setinitialcwd(const char *c);