Import sfio-2002, a safe/fast I/O library.
This commit is contained in:
parent
d50000e68c
commit
261f04f2d5
47
devel/sfio/Makefile
Normal file
47
devel/sfio/Makefile
Normal file
@ -0,0 +1,47 @@
|
||||
# $OpenBSD: Makefile,v 1.1.1.1 2003/05/12 07:25:32 wcobb Exp $
|
||||
|
||||
COMMENT= "A Safe/Fast I/O Library"
|
||||
|
||||
VERSION= 2002
|
||||
PKGNAME= sfio-${VERSION}
|
||||
DISTNAME= sfio_${VERSION}.src.unix_tar
|
||||
CATEGORIES= devel
|
||||
HOMEPAGE= http://www.research.att.com/sw/tools/sfio/
|
||||
|
||||
MASTER_SITES= http://mirror.csoft.org/sfio/
|
||||
EXTRACT_SUFX= .tar
|
||||
|
||||
MAINTAINER= Wilbern Cobb <wcobb@openbsd.org>
|
||||
|
||||
PERMIT_PACKAGE_CDROM= Yes
|
||||
PERMIT_PACKAGE_FTP= Yes
|
||||
PERMIT_DISTFILES_CDROM= Yes
|
||||
PERMIT_DISTFILES_FTP= Yes
|
||||
|
||||
post-extract:
|
||||
cd ${WRKDIR} && ln -s . ${DISTNAME}
|
||||
cd ${WRKDIR}/man/man3 && \
|
||||
perl -pi -e 's/(\\fI|\\fP)//g' sfio.3
|
||||
|
||||
do-build:
|
||||
cd ${WRKDIR}/src/lib/sfio && \
|
||||
env PATH="${WRKDIR}/bin:${PATH}" \
|
||||
${MAKE} CCMODE="${CFLAGS}" \
|
||||
vthread libsfio.a libstdio.a libsfio-mt.a libstdio-mt.a
|
||||
|
||||
pre-fake:
|
||||
${INSTALL_DATA_DIR} ${PREFIX}/include/sfio
|
||||
|
||||
do-install:
|
||||
cd ${WRKDIR}/src/lib/sfio && \
|
||||
env PATH="${WRKDIR}/bin:${PATH}" ${MAKE} \
|
||||
INCDIR="${PREFIX}/include/sfio" \
|
||||
LIBDIR="${PREFIX}/lib" \
|
||||
BINDIR="${PREFIX}/bin" \
|
||||
install_unithreaded install_multithreaded
|
||||
${INSTALL_MAN} ${WRKDIR}/man/man3/sfio.3 ${PREFIX}/man/man3
|
||||
|
||||
do-regress:
|
||||
cd ${WRKDIR}/src/lib/sfio/Sfio_t && ./runtest -mt -lpthread
|
||||
|
||||
.include <bsd.port.mk>
|
3
devel/sfio/distinfo
Normal file
3
devel/sfio/distinfo
Normal file
@ -0,0 +1,3 @@
|
||||
MD5 (sfio_2002.src.unix_tar.tar) = 497988e502f0fd8bff554b0788f5dbf3
|
||||
RMD160 (sfio_2002.src.unix_tar.tar) = 8c8f57751553f63f674662415e4ba1f037f90733
|
||||
SHA1 (sfio_2002.src.unix_tar.tar) = d54ef8581e5dafce54e4cd72682e3c85537498b8
|
11
devel/sfio/patches/patch-src_lib_sfio_Sfio_t_runtest
Normal file
11
devel/sfio/patches/patch-src_lib_sfio_Sfio_t_runtest
Normal file
@ -0,0 +1,11 @@
|
||||
--- src/lib/sfio/Sfio_t/runtest.orig Sat Apr 26 06:25:02 2003
|
||||
+++ src/lib/sfio/Sfio_t/runtest Sat Apr 26 06:25:04 2003
|
||||
@@ -75,7 +75,7 @@
|
||||
if $CC -g $DEFS $HDRS $i $LIBS -o ./t
|
||||
then
|
||||
if ./t
|
||||
- then rm ./t; status=Passed
|
||||
+ then rm -f ./t; status=Passed
|
||||
else status=Failed
|
||||
fi
|
||||
else status="Not compiled"
|
40
devel/sfio/patches/patch-src_lib_sfio_Sfio_t_terror_h
Normal file
40
devel/sfio/patches/patch-src_lib_sfio_Sfio_t_terror_h
Normal file
@ -0,0 +1,40 @@
|
||||
--- src/lib/sfio/Sfio_t/terror.h.orig Sat Apr 26 06:28:15 2003
|
||||
+++ src/lib/sfio/Sfio_t/terror.h Sat Apr 26 06:29:29 2003
|
||||
@@ -119,7 +119,7 @@
|
||||
|
||||
s = buf;
|
||||
if(line >= 0)
|
||||
- { sprintf(s,"\tLine=%d: ", line);
|
||||
+ { snprintf(s, sizeof(buf), "\tLine=%d: ", line);
|
||||
s += strlen(s);
|
||||
}
|
||||
vsprintf(s,form,args);
|
||||
@@ -152,7 +152,7 @@
|
||||
form = va_arg(args,char*);
|
||||
#endif
|
||||
|
||||
- sprintf(failform, "Failure: %s", form);
|
||||
+ snprintf(failform, sizeof(failform), "Failure: %s", form);
|
||||
tstputmesg(Tstline,failform,args);
|
||||
|
||||
va_end(args);
|
||||
@@ -229,7 +229,8 @@
|
||||
if(!Tstfile[n][0])
|
||||
{
|
||||
#ifdef DEBUG
|
||||
- sprintf(Tstfile[n], "Tstfile.%c%c%c", '0'+n, '0'+n, '0'+n);
|
||||
+ snprintf(Tstfile[n], sizeof(Tstfile[n]), "Tstfile.%c%c%c",
|
||||
+ '0'+n, '0'+n, '0'+n);
|
||||
#else
|
||||
static int pid;
|
||||
static char* tmp;
|
||||
@@ -238,7 +239,8 @@
|
||||
tmp = "/tmp";
|
||||
pid = (int)getpid() % 10000;
|
||||
}
|
||||
- sprintf(Tstfile[n], "%s/sft.%c.%d", tmp, '0'+n, pid);
|
||||
+ snprintf(Tstfile[n], sizeof(Tstfile[n]), "%s/sft.%c.%d", tmp,
|
||||
+ '0'+n, pid);
|
||||
#endif
|
||||
}
|
||||
|
15
devel/sfio/pkg/DESCR
Normal file
15
devel/sfio/pkg/DESCR
Normal file
@ -0,0 +1,15 @@
|
||||
Sfio manages I/O streams, much like the ANSI C Standard I/O library,
|
||||
via a distinct interface that is more powerful, robust and efficient.
|
||||
|
||||
o Separate thread-safe I/O library.
|
||||
o Correct sharing of file descriptors across streams and/or processes.
|
||||
o An adaptive buffering algorithm enhaces overall I/O performance.
|
||||
o Efficient and customizable data formatting functions.
|
||||
o I/O disciplines can be used to pre/post-process R/W data from/to streams.
|
||||
o Streams can be stacked for recursive processing of nested streams.
|
||||
o Streams can be pooled for automatic stream synchronization as I/O
|
||||
operations are switched from stream to stream.
|
||||
o Support for zero-copy stream I/O.
|
||||
o Support for reading lines and records of any length from any stream.
|
||||
|
||||
WWW: ${HOMEPAGE}
|
13
devel/sfio/pkg/PLIST
Normal file
13
devel/sfio/pkg/PLIST
Normal file
@ -0,0 +1,13 @@
|
||||
@comment $OpenBSD: PLIST,v 1.1.1.1 2003/05/12 07:25:32 wcobb Exp $
|
||||
include/sfio/ast_common.h
|
||||
include/sfio/sfdisc.h
|
||||
include/sfio/sfio.h
|
||||
include/sfio/sfio_s.h
|
||||
include/sfio/sfio_t.h
|
||||
lib/libsfio-mt.a
|
||||
lib/libsfio.a
|
||||
man/man3/sfio.3
|
||||
@comment include/sfio/stdio.h
|
||||
@comment lib/libstdio-mt.a
|
||||
@comment lib/libstdio.a
|
||||
@dirrm include/sfio
|
Loading…
Reference in New Issue
Block a user