add mkfifo

This commit is contained in:
Connor Lane Smith
2011-05-25 11:00:15 +01:00
parent da757ff7d1
commit a9c970b973
7 changed files with 30 additions and 6 deletions

17
mkfifo.c Normal file
View File

@@ -0,0 +1,17 @@
/* See LICENSE file for copyright and license details. */
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/stat.h>
#include "util.h"
int
main(int argc, char *argv[])
{
while(getopt(argc, argv, "") != -1)
exit(EXIT_FAILURE);
for(; optind < argc; optind++)
if(mkfifo(argv[optind], S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) != 0)
eprintf("mkfifo %s:", argv[optind]);
return EXIT_SUCCESS;
}