diff options
author | wiz <wiz@pkgsrc.org> | 2016-11-06 16:12:08 +0000 |
---|---|---|
committer | wiz <wiz@pkgsrc.org> | 2016-11-06 16:12:08 +0000 |
commit | 4e9497ba2857a12a37745918f7b53aa312db396f (patch) | |
tree | f6aaeae233aea6964549149718144c9ce94b8984 /filesystems | |
parent | 7fa6384c125bca152b7e9d564ad7bee5d38e5209 (diff) | |
download | pkgsrc-4e9497ba2857a12a37745918f7b53aa312db396f.tar.gz |
Import fsx-2009 as filesystems/fsx.
File system exerciser.
Diffstat (limited to 'filesystems')
-rw-r--r-- | filesystems/fsx/DESCR | 1 | ||||
-rw-r--r-- | filesystems/fsx/Makefile | 25 | ||||
-rw-r--r-- | filesystems/fsx/PLIST | 3 | ||||
-rw-r--r-- | filesystems/fsx/distinfo | 15 | ||||
-rw-r--r-- | filesystems/fsx/patches/patch-fsx.c | 137 |
5 files changed, 181 insertions, 0 deletions
diff --git a/filesystems/fsx/DESCR b/filesystems/fsx/DESCR new file mode 100644 index 00000000000..1b6ede1b811 --- /dev/null +++ b/filesystems/fsx/DESCR @@ -0,0 +1 @@ +File system exerciser. diff --git a/filesystems/fsx/Makefile b/filesystems/fsx/Makefile new file mode 100644 index 00000000000..52f50329d80 --- /dev/null +++ b/filesystems/fsx/Makefile @@ -0,0 +1,25 @@ +# $NetBSD: Makefile,v 1.1 2016/11/06 16:12:08 wiz Exp $ + +DISTNAME= fsx-2009 +CATEGORIES= filesystems +MASTER_SITES= http://codemonkey.org.uk/projects/fsx/fsx-macosforge/ +DISTFILES= fsx.c Makefile APPLE_LICENSE + +MAINTAINER= pkgsrc-users@NetBSD.org +HOMEPAGE= http://codemonkey.org.uk/projects/fsx/ +COMMENT= File System Exerciser +LICENSE= apple-public-source-license + +DIST_SUBDIR= ${DISTNAME} +WRKSRC= ${WRKDIR} +USE_TOOLS+= gmake +BUILD_TARGET= fsx +MAKE_FLAGS= CFLAGS=${CFLAGS} + +INSTALLATION_DIRS= bin share/doc/fsx + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/fsx ${DESTDIR}${PREFIX}/bin + ${INSTALL_DATA} ${WRKSRC}/APPLE_LICENSE ${DESTDIR}${PREFIX}/share/doc/fsx + +.include "../../mk/bsd.pkg.mk" diff --git a/filesystems/fsx/PLIST b/filesystems/fsx/PLIST new file mode 100644 index 00000000000..1c5284a37fd --- /dev/null +++ b/filesystems/fsx/PLIST @@ -0,0 +1,3 @@ +@comment $NetBSD: PLIST,v 1.1 2016/11/06 16:12:08 wiz Exp $ +bin/fsx +share/doc/fsx/APPLE_LICENSE diff --git a/filesystems/fsx/distinfo b/filesystems/fsx/distinfo new file mode 100644 index 00000000000..dca024a3a67 --- /dev/null +++ b/filesystems/fsx/distinfo @@ -0,0 +1,15 @@ +$NetBSD: distinfo,v 1.1 2016/11/06 16:12:08 wiz Exp $ + +SHA1 (fsx-2009/APPLE_LICENSE) = f752e2ee8522bbdcd8945f73f6189958eb15a374 +RMD160 (fsx-2009/APPLE_LICENSE) = 61094dc893ea2f47435779485f64b50a519aadb0 +SHA512 (fsx-2009/APPLE_LICENSE) = ba9a08094d32f8416c71842d347c34070ec330ce83e90bcd7b2e9c3b1d2d7af452615582b76970dce860b0f7527721c7ea95e9c46e81cf44a6cc403f77f5d1de +Size (fsx-2009/APPLE_LICENSE) = 19829 bytes +SHA1 (fsx-2009/Makefile) = 108caf6f44add1276805693fb90c3e28acb5bdfa +RMD160 (fsx-2009/Makefile) = 3b315d64e403a5eb1fa4d33e0d8cba7859a24bac +SHA512 (fsx-2009/Makefile) = 7c01bb869b25423a4989c078014218061e9ae4e9e10c76378d0ada32fde7fa08a91aab50ea8e3f934322b5201cd95173c560c0151bac7f0eba26b15fe4c7c544 +Size (fsx-2009/Makefile) = 1327 bytes +SHA1 (fsx-2009/fsx.c) = 96a4f28624cd5810851669d927a48177361341db +RMD160 (fsx-2009/fsx.c) = 10ea68dbb1af824b0e00c39f14c1e08af3123e75 +SHA512 (fsx-2009/fsx.c) = f77d52e445c574c511652f96fea485496252d21c077631ca8a24aea52729553b4f5a43e88cbe0f2e262dc310d7100860253b5395a5183677e99b50ab5d550d4b +Size (fsx-2009/fsx.c) = 42316 bytes +SHA1 (patch-fsx.c) = d2f67e9098787bad80ee7465828bcca18cc023cd diff --git a/filesystems/fsx/patches/patch-fsx.c b/filesystems/fsx/patches/patch-fsx.c new file mode 100644 index 00000000000..1afbf72141e --- /dev/null +++ b/filesystems/fsx/patches/patch-fsx.c @@ -0,0 +1,137 @@ +$NetBSD: patch-fsx.c,v 1.1 2016/11/06 16:12:08 wiz Exp $ + +Portability fixes for NetBSD. + +--- fsx.c.orig 2016-11-06 16:10:25.886667703 +0000 ++++ fsx.c +@@ -53,7 +53,9 @@ + #include <sys/types.h> + #include <sys/stat.h> + #include <time.h> ++#ifdef __APPLE__ + #include <sys/paths.h> ++#endif + #include <sys/param.h> + #ifdef _UWIN + # include <limits.h> +@@ -76,6 +78,9 @@ + #ifdef XILOG + # include <XILog/XILog.h> + #endif ++#ifndef _PATH_FORKSPECIFIER ++#define _PATH_FORKSPECIFIER "/..namedfork/" ++#endif + + /* + * A log entry is an operation and a bunch of arguments. +@@ -754,19 +759,27 @@ doread(unsigned offset, unsigned size) + failure(140); + } + ++#ifdef F_NOCACHE + if (cache_off && (fcntl(fd, F_NOCACHE, 1) != 0)) { // turn data caching off + logdump(); + prterr("doread: fcntl(F_NOCACHE, 1)"); + failure(201); + } ++#endif + iret = read(fd, temp_buf, size); ++#ifdef F_NOCACHE + if (cache_off && (fcntl(fd, F_NOCACHE, 0) != 0)) { + logdump(); + prterr("doread: fcntl(F_NOCACHE, 0)"); + failure(201); + } ++#endif + } else { ++#ifdef __APPLE__ + iret = fgetxattr(fd, eaname, temp_buf, size, 0, 0); ++#else ++ iret = fgetxattr(fd, eaname, temp_buf, size); ++#endif + } + + if (iret != size) { +@@ -947,11 +960,13 @@ dowrite(unsigned offset, unsigned size) + prterr("dowrite: lseek"); + failure(150); + } ++#ifdef F_NOCACHE + if (cache_off && (fcntl(fd, F_NOCACHE, 1) != 0)) { // turn data caching off + logdump(); + prterr("dowrite: fcntl(F_NOCACHE, 1)"); + failure(201); + } ++#endif + iret = write(fd, good_buf + file_size, offset - file_size); + if (iret != offset - file_size) { + logdump(); +@@ -964,11 +979,13 @@ dowrite(unsigned offset, unsigned size) + } + failure(151); + } ++#ifdef F_NOCACHE + if (cache_off && (fcntl(fd, F_NOCACHE, 0) != 0)) { + logdump(); + prterr("dowrite: fcntl(F_NOCACHE, 0)"); + failure(201); + } ++#endif + } + } + file_size = offset + size; +@@ -994,11 +1011,13 @@ dowrite(unsigned offset, unsigned size) + prterr("dowrite: lseek"); + failure(150); + } ++#ifdef F_NOCACHE + if (cache_off && (fcntl(fd, F_NOCACHE, 1) != 0)) { // turn data caching off + logdump(); + prterr("dowrite: fcntl(F_NOCACHE, 1)"); + failure(201); + } ++#endif + iret = write(fd, good_buf + offset, size); + if (iret != size) { + logdump(); +@@ -1011,21 +1030,31 @@ dowrite(unsigned offset, unsigned size) + } + failure(151); + } ++#ifdef F_NOCACHE + if (cache_off && (fcntl(fd, F_NOCACHE, 0) != 0)) { + logdump(); + prterr("dowrite: fcntl(F_NOCACHE, 0)"); + failure(201); + } ++#endif + } else { + if (random() % 2000 == 0) { ++#ifdef __APPLE__ + iret = fremovexattr(fd, eaname, 0); ++#else ++ iret = fremovexattr(fd, eaname); ++#endif + if (iret != 0) { + logdump(); + prterr("ea_dowrite: removexattr"); + failure(151); + } + } ++#ifdef __APPLE__ + iret = fsetxattr(fd, eaname, good_buf, size, 0, 0); ++#else ++ iret = fsetxattr(fd, eaname, good_buf, size, 0); ++#endif + ea_lastwrite = size; + if (iret != 0) { + logdump(); +@@ -1101,7 +1130,7 @@ domapwrite(unsigned offset, unsigned siz + failure(202); + } + memcpy(p + pg_offset, good_buf + offset, size); +- if (msync(p, map_size, 0) != 0) { ++ if (msync(p, map_size, MS_SYNC) != 0) { + logdump(); + prterr("domapwrite: msync"); + failure(203); |