@@ -0,0 +1,81 @@
1+Derivied from a patch distributed with the Homebrew formula:
2+https://github.com/Homebrew/homebrew-core/blob/6ae11ea82c00dc8c11297ecc3f06bc33979862d8/Formula/bonnie++.rb
3+
4+
5+Copyright 2009-2016 Homebrew contributors.
6+
7+Redistribution and use in source and binary forms, with or without
8+modification, are permitted provided that the following conditions
9+are met:
10+
11+ 1. Redistributions of source code must retain the above copyright
12+ notice, this list of conditions and the following disclaimer.
13+ 2. Redistributions in binary form must reproduce the above copyright
14+ notice, this list of conditions and the following disclaimer in the
15+ documentation and/or other materials provided with the distribution.
16+
17+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27+
28+
29+# Changes included in this patchset:
30+# 3) Remove the #ifdef _LARGEFILE64_SOURCE macros which not only prohibits the intended functionality of
31+# splitting into 2 GB files for such filesystems but also incorrectly tests for it in the first place.
32+# The ideal fix would be to replace the AC_TRY_RUN() in configure.in if the fail code actually worked.
33+# Files affected: bonnie++.cp
34+
35+diff --git i/bonnie++.cpp w/bonnie++.cpp
36+index 8c5a43a..8a4b3dc 100644
37+--- i/bonnie++.cpp
38++++ w/bonnie++.cpp
39+@@ -294,11 +294,7 @@ int main(int argc, char *argv[])
40+ {
41+ char *sbuf = _strdup(optarg);
42+ char *size = strtok(sbuf, ":");
43+-#ifdef _LARGEFILE64_SOURCE
44+ file_size = size_from_str(size, "gt");
45+-#else
46+- file_size = size_from_str(size, "g");
47+-#endif
48+ size = strtok(NULL, "");
49+ if(size)
50+ {
51+@@ -384,15 +380,6 @@ int main(int argc, char *argv[])
52+ if(file_size % 1024 > 512)
53+ file_size = file_size + 1024 - (file_size % 1024);
54+ }
55+-#ifndef _LARGEFILE64_SOURCE
56+- if(file_size == 2048)
57+- file_size = 2047;
58+- if(file_size > 2048)
59+- {
60+- fprintf(stderr, "Large File Support not present, can't do %dM.\n", file_size);
61+- usage();
62+- }
63+-#endif
64+ globals.byte_io_size = min(file_size, globals.byte_io_size);
65+ globals.byte_io_size = max(0, globals.byte_io_size);
66+
67+@@ -465,14 +452,6 @@ int main(int argc, char *argv[])
68+ && (directory_max_size < directory_min_size || directory_max_size < 0
69+ || directory_min_size < 0) )
70+ usage();
71+-#ifndef _LARGEFILE64_SOURCE
72+- if(file_size > (1 << (31 - 20 + globals.io_chunk_bits)) )
73+- {
74+- fprintf(stderr
75+- , "The small chunk size and large IO size make this test impossible in 32bit.\n");
76+- usage();
77+- }
78+-#endif
79+ if(file_size && globals.ram && (file_size * concurrency) < (globals.ram * 2) )
80+ {
81+ fprintf(stderr