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

Function sys_chroot

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

Source from the content-addressed store, hash-verified

74}
75
76pub fn sys_chroot(path: *const c_char) -> AxResult<isize> {
77 let path = vm_load_string(path)?;
78 debug!("sys_chroot <= path: {path}");
79
80 let mut fs = FS_CONTEXT.lock();
81 let loc = fs.resolve(path)?;
82 if loc.node_type() != NodeType::Directory {
83 return Err(AxError::NotADirectory);
84 }
85 *fs = FsContext::new(loc);
86 Ok(0)
87}
88
89pub fn sys_mkdirat(dirfd: i32, path: *const c_char, mode: u32) -> AxResult<isize> {
90 let path = vm_load_string(path)?;

Callers 1

handle_syscallFunction · 0.85

Calls 1

vm_load_stringFunction · 0.85

Tested by

no test coverage detected