aboutsummaryrefslogtreecommitdiff
path: root/misc/mbuffer
diff options
context:
space:
mode:
authorRong-En Fan <rafan@FreeBSD.org>2006-12-20 07:24:47 +0000
committerRong-En Fan <rafan@FreeBSD.org>2006-12-20 07:24:47 +0000
commit1edbc0deb46b1d718544bea984a280486cfc16c6 (patch)
treeb2fb2986e70507d697cdeb2bd7cec9b4110f6296 /misc/mbuffer
parent8e63fa065865f48aec09ddde63a57f4ab2cdc38c (diff)
downloadports-1edbc0deb46b1d718544bea984a280486cfc16c6.tar.gz
ports-1edbc0deb46b1d718544bea984a280486cfc16c6.zip
Add mbuffer-20060728, a tool for buffering data streams.
Notes
Notes: svn path=/head/; revision=180245
Diffstat (limited to 'misc/mbuffer')
-rw-r--r--misc/mbuffer/Makefile31
-rw-r--r--misc/mbuffer/distinfo3
-rw-r--r--misc/mbuffer/files/patch-mbuffer.c75
-rw-r--r--misc/mbuffer/pkg-descr12
4 files changed, 121 insertions, 0 deletions
diff --git a/misc/mbuffer/Makefile b/misc/mbuffer/Makefile
new file mode 100644
index 000000000000..7c633771c7b8
--- /dev/null
+++ b/misc/mbuffer/Makefile
@@ -0,0 +1,31 @@
+# New ports collection makefile for: mbuffer
+# Date created: Dec 14 2006
+# Whom: Rong-En Fan <rafan@FreeBSD.org>
+#
+# $FreeBSD$
+#
+
+PORTNAME= mbuffer
+PORTVERSION= 2006.07.28
+CATEGORIES= misc
+MASTER_SITES= http://www.maier-komor.de/software/mbuffer/
+DISTNAME= ${PORTNAME}-${PORTVERSION:S/.//g}
+EXTRACT_SUFX= .tgz
+
+MAINTAINER= rafan@FreeBSD.org
+COMMENT= A tool for buffering data streams
+
+USE_GMAKE= yes
+GNU_CONFIGURE= yes
+
+PLIST_FILES= bin/mbuffer
+
+MAN1= ${PORTNAME}.1
+
+.include <bsd.port.pre.mk>
+
+.if ${ARCH} == "amd64" || ${ARCH} == "sparc64" || ${ARCH} == "ia64"
+CFLAGS+= -m64
+.endif
+
+.include <bsd.port.post.mk>
diff --git a/misc/mbuffer/distinfo b/misc/mbuffer/distinfo
new file mode 100644
index 000000000000..183ce66b98d8
--- /dev/null
+++ b/misc/mbuffer/distinfo
@@ -0,0 +1,3 @@
+MD5 (mbuffer-20060728.tgz) = 92310e1e06b248a22b37ad76f13c1339
+SHA256 (mbuffer-20060728.tgz) = b5584ccba77d151e160f1b6ef16ec9690b965a322c05fd7b2dbcfc5a7278691b
+SIZE (mbuffer-20060728.tgz) = 77820
diff --git a/misc/mbuffer/files/patch-mbuffer.c b/misc/mbuffer/files/patch-mbuffer.c
new file mode 100644
index 000000000000..04b2a034199e
--- /dev/null
+++ b/misc/mbuffer/files/patch-mbuffer.c
@@ -0,0 +1,75 @@
+--- mbuffer.c.orig Fri Jul 28 23:05:14 2006
++++ mbuffer.c Mon Dec 18 13:22:57 2006
+@@ -16,15 +16,18 @@
+ #include <stdlib.h>
+ #include <strings.h>
+ #include <string.h>
+-#include <stropts.h>
+ #include <sys/mman.h>
+ #include <sys/stat.h>
+ #include <sys/time.h>
++#include <sys/types.h>
++#include <sys/sysctl.h>
+ #include <termios.h>
+ #include <unistd.h>
+
+ #ifdef HAVE_SENDFILE
+-#include <sys/sendfile.h>
++#include <sys/types.h>
++#include <sys/socket.h>
++#include <sys/uio.h>
+ /* if this sendfile implementation does not support sending from buffers,
+ disable sendfile support */
+ #ifndef SFV_FD_SELF
+@@ -1033,11 +1036,13 @@
+ totalmem = calcint(argv,c,totalmem);
+ optMset = 1;
+ if (totalmem < 100) {
+- long pgsz, nump;
++ long pgsz;
++ unsigned long nump;
++ size_t nump_size = sizeof(nump_size);
+ pgsz = sysconf(_SC_PAGESIZE);
+ assert(pgsz > 0);
+- nump = sysconf(_SC_PHYS_PAGES);
+- assert(pgsz > 0);
++ sysctlbyname("hw.availptotals", &nump, &nump_size, NULL, 0);
++ assert(nump > 0);
+ debugmsg("total # of phys pages: %li (pagesize %li)\n",nump,pgsz);
+ totalmem = ((unsigned long long) nump * pgsz * totalmem) / 100 ;
+ }
+@@ -1046,8 +1051,8 @@
+ Numblocks = (atoi(argv[c])) ? ((unsigned long long) atoll(argv[c])) : Numblocks;
+ optBset = 1;
+ debugmsg("Numblocks = %llu\n",Numblocks);
+-#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
+ } else if (!argcheck("-d",argv,&c)) {
++#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
+ setOutsize = 1;
+ debugmsg("setting output size according to the blocksize of the device\n");
+ #else
+@@ -1112,7 +1117,7 @@
+ Status = 0;
+ } else if (!strcmp("-c",argv[c])) {
+ debugmsg("enabling full synchronous I/O\n");
+- OptSync = O_DSYNC;
++ OptSync = O_FSYNC;
+ } else if (!argcheck("-a",argv,&c)) {
+ Autoloader = 1;
+ Autoload_time = atoi(argv[c]);
+@@ -1202,7 +1207,14 @@
+ fatal("multi volume support for input needs an explicit given input device (option -i)\n");
+
+ /* check that we stay within system limits */
+- mxnrsem = sysconf(_SC_SEM_VALUE_MAX);
++ {
++ int semvmx;
++ size_t semvmx_size = sizeof(semvmx);
++ if (sysctlbyname("kern.ipc.semvmx", &semvmx, &semvmx_size, NULL, 0) == -1)
++ mxnrsem = -1;
++ else
++ mxnrsem = semvmx;
++ }
+ if (-1 == mxnrsem) {
+ warningmsg("unable to determine maximum value of semaphores\n");
+ } else if (Numblocks > (unsigned long long) mxnrsem)
diff --git a/misc/mbuffer/pkg-descr b/misc/mbuffer/pkg-descr
new file mode 100644
index 000000000000..4ff7ddaf4ba8
--- /dev/null
+++ b/misc/mbuffer/pkg-descr
@@ -0,0 +1,12 @@
+mbuffer is a tool for buffering data streams. It is also a raplacement
+for buffer with additional functionality:
+
+- display of i/o speed
+- optional use of memory mapped i/o for huge buffer files
+- multithreaded instead of sharedmemory ipc
+- multi-volume support
+- auto-loader support
+- network support
+- buffer compatible command-line options
+
+WWW: http://www.maier-komor.de/mbuffer.html