add mkfifo
This commit is contained in:
parent
da757ff7d1
commit
a9c970b973
2
Makefile
2
Makefile
|
@ -2,7 +2,7 @@ include config.mk
|
|||
|
||||
LIB = util/enmasse.o util/eprintf.o util/recurse.o
|
||||
SRC = basename.c cat.c chown.c date.c dirname.c echo.c false.c grep.c ln.c \
|
||||
pwd.c rm.c sleep.c tee.c touch.c true.c wc.c
|
||||
mkfifo.c pwd.c rm.c sleep.c tee.c touch.c true.c wc.c
|
||||
OBJ = $(SRC:.c=.o) $(LIB)
|
||||
BIN = $(SRC:.c=)
|
||||
MAN = $(SRC:.c=.1)
|
||||
|
|
2
chown.1
2
chown.1
|
@ -5,7 +5,7 @@ chown \- change file ownership
|
|||
.B chown
|
||||
.RB [ -Rr ]
|
||||
.RI [ owner ][: group ]
|
||||
.RI [ files ...]
|
||||
.RI [ file ...]
|
||||
.SH DESCRIPTION
|
||||
.B chown
|
||||
changes the user or group ownership for the given files.
|
||||
|
|
|
@ -4,8 +4,6 @@ VERSION = 0.0
|
|||
#CC = cc
|
||||
#CC = musl-gcc
|
||||
|
||||
AR = ar
|
||||
|
||||
CPPFLAGS = -D_POSIX_C_SOURCE=200112L
|
||||
CFLAGS = -Os -ansi -Wall -pedantic $(CPPFLAGS)
|
||||
LDFLAGS = -s -static
|
||||
|
|
2
ln.1
2
ln.1
|
@ -9,7 +9,7 @@ ln \- make links between files
|
|||
.P
|
||||
.B ln
|
||||
.RB [ \-s ]
|
||||
.RI [ files ...]
|
||||
.RI [ file ...]
|
||||
.RI [ directory ]
|
||||
.SH DESCRIPTION
|
||||
.B ln
|
||||
|
|
9
mkfifo.1
Normal file
9
mkfifo.1
Normal file
|
@ -0,0 +1,9 @@
|
|||
.TH MKFIFO 1 sbase\-VERSION
|
||||
.SH NAME
|
||||
mkfifo \- make named pipe
|
||||
.SH SYNOPSIS
|
||||
.B mkfifo
|
||||
.RI [ name ...]
|
||||
.SH DESCRIPTION
|
||||
.B mkfifo
|
||||
creates named pipes (FIFOs) with the given names.
|
17
mkfifo.c
Normal file
17
mkfifo.c
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user