MCPcopy Create free account
hub / github.com/Starry-OS/StarryOS / sys_chdir

Function sys_chdir

api/src/syscall/fs/ctl.rs:53–61  ·  view source on GitHub ↗
(path: *const c_char)

Source from the content-addressed store, hash-verified

51}
52
53pub fn sys_chdir(path: *const c_char) -> AxResult<isize> {
54 let path = vm_load_string(path)?;
55 debug!("sys_chdir <= path: {path}");
56
57 let mut fs = FS_CONTEXT.lock();
58 let entry = fs.resolve(path)?;
59 fs.set_current_dir(entry)?;
60 Ok(0)
61}
62
63pub fn sys_fchdir(dirfd: i32) -> AxResult<isize> {
64 debug!("sys_fchdir <= dirfd: {dirfd}");

Callers 1

handle_syscallFunction · 0.85

Calls 1

vm_load_stringFunction · 0.85

Tested by

no test coverage detected