#include <unistd.h>
int32_t unlink(const char *pathname);
Remove a link from a file, the last unlink()
will also delete the file if there is no reference to that inode anymore. This means that if some process still has the file open, it will continue to exist until the process closes it (then it will be effectively deleted).
The app rm exposes this syscall.
Implemented in sys_file.c
as sys_unlink()
.
Syscall rmdir to delete directories.
Overview: syscalls
File Management Syscalls: mkdir | rmdir | get_dirent | mknod | open | close | read | write | lseek | dup | link | unlink | fstat