general clean-up; Christian Weisgerber <naddy@unix-ag.uni-kl.de>

This commit is contained in:
marc 1999-03-11 20:19:28 +00:00
parent 2dc9fa879e
commit 75cfd2bc98
5 changed files with 56 additions and 53 deletions

View File

@ -3,16 +3,17 @@
# Date created: 17 Dec 1997
# Whom: joey
#
# $OpenBSD: Makefile,v 1.1.1.1 1997/12/17 23:11:45 joey Exp $
# $OpenBSD: Makefile,v 1.2 1999/03/11 20:19:28 marc Exp $
#
DISTNAME= buffer-1.17
CATEGORIES= misc
MASTER_SITES= ftp://ftp.sun.ac.za/pub/unix/misc/
MASTER_SITES= ftp://ftp.openbsd.org/pub/OpenBSD/distfiles/ \
ftp://ftp.netbsd.org/pub/NetBSD/packages/distfiles/
MAINTAINER= joey@OpenBSD.ORG
MAINTAINER= naddy@unix-ag.uni-kl.de
NO_WRKSUBDIR= yes
MANL= buffer.l
MAN1= buffer.1
.include <bsd.port.mk>

View File

@ -1,31 +1,42 @@
diff -udr buffer.ORG/Makefile buffer/Makefile
--- buffer.ORG/Makefile Wed Jul 14 17:59:17 1993
+++ Makefile Thu Nov 16 20:09:23 1995
@@ -8,7 +8,7 @@
--- Makefile.orig Wed Jul 14 17:59:17 1993
+++ Makefile Thu Mar 11 18:51:57 1999
@@ -4,13 +4,13 @@
# You should also add -DSYS5 for Ultrix, AIX, and Solarix.
# Add -DDEF_SHMEM=n if you can only have n bytes of shared memory
# (eg: -DDEF_SHMEM=524288 if you can only have half a meg.)
-CFLAGS=
+CFLAGS+=
# Where to install buffer and its manual pages
INSTBIN=/usr/local/bin
-INSTBIN=/usr/local/bin
-INSTMAN=/usr/man/manl
+INSTMAN=/usr/local/man/manl
+INSTBIN=${PREFIX}/bin
+INSTMAN=${PREFIX}/man/man1
# The manual page section (normally l or 1)
S=l
-S=l
+S=1
diff -udr buffer.ORG/buffer.c buffer/buffer.c
--- buffer.ORG/buffer.c Wed Jul 14 17:59:17 1993
+++ buffer.c Fri Nov 17 20:23:58 1995
@@ -384,6 +384,7 @@
}
RM=/bin/rm
ALL=README buffer.man Makefile buffer.c sem.c COPYING
@@ -18,18 +18,14 @@
all: buffer
/* The interrupt handler */
+void
shutdown()
{
static int shutting;
@@ -400,6 +401,7 @@
}
buffer: buffer.o sem.o
- $(CC) -o buffer $(CFLAGS) buffer.o sem.o
+ $(CC) -o buffer buffer.o sem.o
/* Shutdown because the child has ended */
+void
child_shutdown()
{
/* Find out which child has died. (They may not be my
clean:
$(RM) -f *.o core buffer .merrs
install: buffer
- rm -f $(INSTBIN)/buffer
- cp buffer $(INSTBIN)/buffer
- chmod 111 $(INSTBIN)/buffer
- rm -f $(INSTMAN)/buffer.$S
- cp buffer.man $(INSTMAN)/buffer.$S
- chmod 444 $(INSTMAN)/buffer.$S
+ ${BSD_INSTALL_PROGRAM} buffer $(INSTBIN)/buffer
+ ${BSD_INSTALL_MAN} buffer.man $(INSTMAN)/buffer.$S
buffer.tar: $(ALL)
$(RM) -f buffer.tar

View File

@ -1 +1 @@
buffer sporadic binary I/O for faster tape use
Buffer sporadic binary I/O for faster tape use.

View File

@ -1,27 +1,18 @@
This is a program designed to speed up writing tapes on remote tape
drives. Requirements are shared memory and locks which normally
means that these are supported in your kernel.
Buffer reads from standard input reblocking to the given blocksize
and writes each block to standard output.
[for FreeBSD, this means you MUST have a kernel with
options SYSVSHM
compiled in - markm]
Internally, buffer is a pair of processes communicating via a large
circular queue held in shared memory. This means you *must* have a
kernel with
Buffer has been tested under OpenBSD SunOS 4.0.*, SunOS 4.1.*, Solarix,
HP-UX 7.0, and Gould UTX 2.1A (sv universe).
options SYSVSHM
The program splits itself into two processes. The first process reads
(and reblocks) from stdin into a shared memory buffer. The second
writes from the shared memory buffer to stdout. Doing it this way
means that the writing side effectly sits in a tight write loop and
doesn't have to wait for input. Similarly for the input side. It is
this waiting that slows down other reblocking processes, like dd.
compiled in. The reader process only has to block when the queue
is full and the writer process when the queue is empty. Buffer is
designed to try and keep the writer side continuously busy so that
it can stream when writing to tape drives. When used to write tapes
with an intervening network, buffer can result in a considerable
increase in throughput.
I run an archive and need to write large chunks out to tape regularly
with an ethernet in the way. Using 'buffer' in a command like:
tar cvf - stuff | rsh somebox "buffer > /dev/rst8"
is a factor of 5 faster than the best alternative, gnu tar with its
remote tape option:
tar cvf somebox:/dev/rst8 stuff
- Christian "naddy" Weisgerber
<naddy@unix-ag.uni-kl.de>

View File

@ -1,2 +1,2 @@
bin/buffer
man/manl/buffer.l
man/man1/buffer.1