summaryrefslogtreecommitdiff
path: root/Userland/rm.cpp
blob: 606d92d7d98f0e8c33b56965f93ed7ef0e642d26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <stdio.h>
#include <errno.h>
#include <unistd.h>

int main(int argc, char** argv)
{
    if (argc != 2) {
        fprintf(stderr, "usage: rm <path>\n");
        return 1;
    }
    int rc = unlink(argv[1]);
    if (rc < 0) {
        perror("unlink");
        return 1;
    }
    return 0;
}