|
PatchworkOS
966e257
A non-POSIX operating system.
|
Current Working Directory. More...
Current Working Directory.
The current working directory (CWD) is a per-process structure to track the current location in the filesystem for the process.
Data Structures | |
| struct | cwd_t |
Functions | |
| void | cwd_init (cwd_t *cwd) |
| Initialize a CWD structure. | |
| void | cwd_deinit (cwd_t *cwd) |
| Deinitialize a CWD structure. | |
| path_t | cwd_get (cwd_t *cwd) |
| Get the current working directory. | |
| void | cwd_set (cwd_t *cwd, const path_t *newPath) |
| Set the current working directory. | |
| void | cwd_clear (cwd_t *cwd) |
| Clear the current working directory. | |
| void cwd_init | ( | cwd_t * | cwd | ) |
Initialize a CWD structure.
Will by default lazily resolve to the root path of the kernel process's namespace until set to another path.
| cwd | The CWD structure to initialize. |
Definition at line 5 of file cwd.c.
| void cwd_deinit | ( | cwd_t * | cwd | ) |
Get the current working directory.
| cwd | The CWD structure. |
Definition at line 18 of file cwd.c.
| void cwd_clear | ( | cwd_t * | cwd | ) |
Clear the current working directory.
Needed as a process might have its working directory inside its own /proc/[pid] directory which, since that directory holds references to the process itself, would result in a memory leak.
| cwd | The CWD structure. |
Definition at line 51 of file cwd.c.