PatchworkOS  19e446b
A non-POSIX operating system.
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
7
8uint64_t chdir(const char* path)
9{
10 if (writefiles("/proc/self/cwd", path) == ERR)
11 {
12 return ERR;
13 }
14
15 return 0;
16}
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
uint64_t chdir(const char *path)
System call for changing the cwd.
Definition chdir.c:8
#define ERR
Integer error value.
Definition ERR.h:17
__UINT64_TYPE__ uint64_t
Definition stdint.h:17