micro-utils/coreutils/mkfifo.c

22 lines
384 B
C
Raw Normal View History

#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;
}