micro-utils/coreutils/mkfifo.c
Your Name 7eed71d9b2 mk
2023-10-13 15:34:16 +03:00

22 lines
384 B
C

#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
int main(const int argc, const char **argv) {
if (argc == 1) {
printf("mkfifo: missing operand\n");
return 1;
}
for (int i = 1; i < argc; i++) {
if (mkfifo(argv[i], 0666)) {
fprintf(stderr, "mkfifo: %s %s\n", argv[i], strerror(errno));
return 1;
}
}
return 0;
}