21 lines
478 B
C
21 lines
478 B
C
#include "src/lib/syscall.h"
|
|
#include "src/lib/util.h"
|
|
#include "src/user/syscall.h"
|
|
|
|
exit_code_t main(uint64_t argc, const char **argv) {
|
|
if (argc < 2) {
|
|
ERR_S("rm: requires one or more arguments\n");
|
|
return EXIT_CODE_GENERAL_FAILURE;
|
|
}
|
|
|
|
uint64_t code = EXIT_CODE_OK;
|
|
for (uint64_t i = 1; i < argc; i++) {
|
|
if (remove(argv[i]) == (uint64_t)-1) {
|
|
ERR_S("rm: could not remove file\n");
|
|
code = EXIT_CODE_GENERAL_FAILURE;
|
|
}
|
|
}
|
|
|
|
return code;
|
|
}
|