CS318 - Pintos
Pintos source browser for JHU CS318 course
rm.c
Go to the documentation of this file.
1 /** rm.c
2 
3  Removes files specified on command line. */
4 
5 #include <stdio.h>
6 #include <syscall.h>
7 
8 int
9 main (int argc, char *argv[])
10 {
11  bool success = true;
12  int i;
13 
14  for (i = 1; i < argc; i++)
15  if (!remove (argv[i]))
16  {
17  printf ("%s: remove failed\n", argv[i]);
18  success = false;
19  }
20  return success ? EXIT_SUCCESS : EXIT_FAILURE;
21 }
main
int main(int argc, char *argv[])
rm.c
Definition: rm.c:9
EXIT_FAILURE
#define EXIT_FAILURE
Unsuccessful execution.
Definition: syscall.h:20
printf
int printf(const char *format,...)
Writes formatted output to the console.
Definition: stdio.c:79
remove
bool remove(const char *file)
Definition: syscall.c:97
EXIT_SUCCESS
#define EXIT_SUCCESS
Typical return values from main() and arguments to exit().
Definition: syscall.h:19