21 lines
364 B
C
21 lines
364 B
C
|
#include <stdio.h>
|
||
|
#include <errno.h>
|
||
|
#include <stdlib.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;
|
||
|
}
|