Skip to content
This repository has been archived by the owner on Feb 19, 2023. It is now read-only.

Commit

Permalink
syscall remove
Browse files Browse the repository at this point in the history
  • Loading branch information
CCXXXI committed Jan 10, 2021
1 parent fd3dd0d commit 850e3fa
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/userprog/syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,13 @@ static bool create(const char *file, unsigned initial_size)
or closed, and removing an open file does not close it. */
static bool remove(const char *file)
{
// todo
return false;
USER_ASSERT(is_valid_str(file));

lock_acquire(&file_lock);
bool ret = filesys_remove(file);
lock_release(&file_lock);

return ret;
}

/* Opens the file called FILE. Returns a nonnegative integer handle
Expand Down

0 comments on commit 850e3fa

Please sign in to comment.