PatchworkOS
19e446b
A non-POSIX operating system.
Theme:
Default
Round
Robot
Loading...
Searching...
No Matches
chdir.c
Go to the documentation of this file.
1
#include <
stdarg.h
>
2
#include <
stdio.h
>
3
#include <
stdlib.h
>
4
#include <
sys/fs.h
>
5
6
#include "
user/common/syscalls.h
"
7
8
uint64_t
chdir
(
const
char
* path)
9
{
10
if
(
writefiles
(
"/proc/self/cwd"
, path) ==
ERR
)
11
{
12
return
ERR
;
13
}
14
15
return
0;
16
}
writefiles
size_t writefiles(const char *path, const char *string)
Wrapper for writing a null-terminated string directly to a file using a path.
Definition
swritefile.c:4
chdir
uint64_t chdir(const char *path)
System call for changing the cwd.
Definition
chdir.c:8
ERR
#define ERR
Integer error value.
Definition
ERR.h:17
fs.h
stdarg.h
uint64_t
__UINT64_TYPE__ uint64_t
Definition
stdint.h:17
stdio.h
stdlib.h
syscalls.h
src
libstd
user
functions
fs
chdir.c
Generated on Sat Jan 24 2026 10:59:25 for PatchworkOS by
1.9.8