apps: add a little mkdir utility

This commit is contained in:
apio 2022-10-31 09:53:52 +01:00
parent c2a08060cf
commit 497a52dd82
2 changed files with 18 additions and 1 deletions

View File

@ -1,4 +1,4 @@
APPS := init sh uname uptime hello ps ls args cat stat su session date
APPS := init sh uname uptime hello ps ls args cat stat su session date mkdir
APPS_DIR := $(LUNA_ROOT)/apps
APPS_SRC := $(APPS_DIR)/src

17
apps/src/mkdir.c Normal file
View File

@ -0,0 +1,17 @@
#include <stdio.h>
#include <sys/stat.h>
int main(int argc, char** argv)
{
if (argc == 1)
{
fprintf(stderr, "Usage: %s [directory]", argv[0]);
return 1;
}
if (mkdir(argv[1], 0755) < 0)
{
perror("mkdir");
return 1;
}
}