|
PatchworkOS
19e446b
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, namespace_t *ns) |
| 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 | ) |
| void cwd_deinit | ( | cwd_t * | cwd | ) |
| path_t cwd_get | ( | cwd_t * | cwd, |
| namespace_t * | ns | ||
| ) |
Get the current working directory.
| cwd | The CWD structure. |
| ns | The namespace to get the root path from if the cwd is not set. |
Definition at line 19 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 46 of file cwd.c.