CS318 - Pintos
Pintos source browser for JHU CS318 course
src
examples
mkdir.c
Go to the documentation of this file.
1
/** mkdir.c
2
3
Creates a directory. */
4
5
#include <stdio.h>
6
#include <syscall.h>
7
8
int
9
main
(
int
argc,
char
*argv[])
10
{
11
if
(argc != 2)
12
{
13
printf
(
"usage: %s DIRECTORY\n"
, argv[0]);
14
return
EXIT_FAILURE
;
15
}
16
17
if
(!
mkdir
(argv[1]))
18
{
19
printf
(
"%s: mkdir failed\n"
, argv[1]);
20
return
EXIT_FAILURE
;
21
}
22
23
return
EXIT_SUCCESS
;
24
}
EXIT_FAILURE
#define EXIT_FAILURE
Unsuccessful execution.
Definition:
syscall.h:20
mkdir
bool mkdir(const char *dir)
Definition:
syscall.c:163
printf
int printf(const char *format,...)
Writes formatted output to the console.
Definition:
stdio.c:79
EXIT_SUCCESS
#define EXIT_SUCCESS
Typical return values from main() and arguments to exit().
Definition:
syscall.h:19
main
int main(int argc, char *argv[])
mkdir.c
Definition:
mkdir.c:9
Generated on Thu Aug 22 2019 10:19:15 for CS318 - Pintos by
1.8.16