summaryrefslogtreecommitdiff
path: root/Userland/mkdir.cpp
blob: c370a1486bdd869c7c206e3f3af0aed469df6caf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <sys/stat.h>

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