sys_unlinkat

Function sys_unlinkat 

Source
pub fn sys_unlinkat(
    abi: &mut LinuxRiscv64Abi,
    trapframe: &mut Trapframe,
) -> usize
Expand description

Linux sys_unlinkat implementation for Scarlet VFS v2

Removes a file or directory relative to a directory file descriptor. If dirfd == AT_FDCWD, uses the current working directory as the base. Otherwise, resolves the base directory from the file descriptor.

Arguments:

  • abi: LinuxRiscv64Abi context
  • trapframe: Trapframe containing syscall arguments
    • arg0: dirfd (directory file descriptor)
    • arg1: path_ptr (pointer to path string)
    • arg2: flags (unlink flags)

Returns:

  • 0 on success
  • usize::MAX (Linux -1) on error