]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
system.h: correct compilation error: MAX not defined
authorJim Meyering <meyering@redhat.com>
Sat, 14 Mar 2009 20:29:33 +0000 (21:29 +0100)
committerJim Meyering <meyering@redhat.com>
Sat, 14 Mar 2009 20:46:35 +0000 (21:46 +0100)
* src/system.h (io_blksize): Move definition down, so it follows that
of MAX -- to avoid compilation failure on OpenSolaris.  Reported by
David Bartley.  Details in
http://lists.gnu.org/archive/html/bug-coreutils/2009-03/msg00190.html

THANKS
src/system.h

diff --git a/THANKS b/THANKS
index 46d077b1d82c71d09343facf183c3c967455db37..f894e1d26ab415728079c3b05e9d080307364350 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -131,6 +131,7 @@ Darrel Francis                      d.francis@cheerful.com
 Darren Salt                         ds@youmustbejoking.demon.co.uk
 Dave Beckett                        dajobe@dajobe.org
 David Alan Gilbert                  gilbertd@treblig.org
+David Bartley                       dtbartle@csclub.uwaterloo.ca
 David Dyck                          dcd@tc.fluke.COM
 David Eisner                        cradle@umd.edu
 David Flynn                         dav@chess.plus.com
index dbb4da1ed75a7cd494d099933991cc48610a84be..eafcc25239c5bfb45e062c82a83fd4b80afb4307 100644 (file)
@@ -221,51 +221,6 @@ enum
 # endif
 #endif
 
-/* As of Mar 2009, 32KiB is determined to be the minimium
-   blksize to best minimize system call overhead.
-   This can be tested with this script with the results
-   shown for a 1.7GHz pentium-m with 2GB of 400MHz DDR2 RAM:
-
-   for i in $(seq 0 10); do
-     size=$((8*1024**3)) #ensure this is big enough
-     bs=$((1024*2**$i))
-     printf "%7s=" $bs
-     dd bs=$bs if=/dev/zero of=/dev/null count=$(($size/$bs)) 2>&1 |
-     sed -n 's/.* \([0-9.]* [GM]B\/s\)/\1/p'
-   done
-
-      1024=734 MB/s
-      2048=1.3 GB/s
-      4096=2.4 GB/s
-      8192=3.5 GB/s
-     16384=3.9 GB/s
-     32768=5.2 GB/s
-     65536=5.3 GB/s
-    131072=5.5 GB/s
-    262144=5.7 GB/s
-    524288=5.7 GB/s
-   1048576=5.8 GB/s
-
-   Note that this is to minimize system call overhead.
-   Other values may be appropriate to minimize file system
-   or disk overhead.  For example on my current linux system
-   the readahead setting is 128KiB which was read using:
-
-   file="."
-   device=$(df -P --local "$file" | tail -n1 | cut -d' ' -f1)
-   echo $(( $(blockdev --getra $device) * 512 ))
-
-   However there isn't a portable way to get the above.
-   In the future we could use the above method if available
-   and default to io_blksize() if not.
- */
-enum { IO_BUFSIZE = 32*1024 };
-static inline size_t
-io_blksize (struct stat sb)
-{
-  return MAX (IO_BUFSIZE, ST_BLKSIZE (sb));
-}
-
 /* Redirection and wildcarding when done by the utility itself.
    Generally a noop, but used in particular for native VMS. */
 #ifndef initialize_main
@@ -701,4 +656,49 @@ bad_cast (char const *s)
   return (char *) s;
 }
 
+/* As of Mar 2009, 32KiB is determined to be the minimium
+   blksize to best minimize system call overhead.
+   This can be tested with this script with the results
+   shown for a 1.7GHz pentium-m with 2GB of 400MHz DDR2 RAM:
+
+   for i in $(seq 0 10); do
+     size=$((8*1024**3)) #ensure this is big enough
+     bs=$((1024*2**$i))
+     printf "%7s=" $bs
+     dd bs=$bs if=/dev/zero of=/dev/null count=$(($size/$bs)) 2>&1 |
+     sed -n 's/.* \([0-9.]* [GM]B\/s\)/\1/p'
+   done
+
+      1024=734 MB/s
+      2048=1.3 GB/s
+      4096=2.4 GB/s
+      8192=3.5 GB/s
+     16384=3.9 GB/s
+     32768=5.2 GB/s
+     65536=5.3 GB/s
+    131072=5.5 GB/s
+    262144=5.7 GB/s
+    524288=5.7 GB/s
+   1048576=5.8 GB/s
+
+   Note that this is to minimize system call overhead.
+   Other values may be appropriate to minimize file system
+   or disk overhead.  For example on my current linux system
+   the readahead setting is 128KiB which was read using:
+
+   file="."
+   device=$(df -P --local "$file" | tail -n1 | cut -d' ' -f1)
+   echo $(( $(blockdev --getra $device) * 512 ))
+
+   However there isn't a portable way to get the above.
+   In the future we could use the above method if available
+   and default to io_blksize() if not.
+ */
+enum { IO_BUFSIZE = 32*1024 };
+static inline size_t
+io_blksize (struct stat sb)
+{
+  return MAX (IO_BUFSIZE, ST_BLKSIZE (sb));
+}
+
 void usage (int status) ATTRIBUTE_NORETURN;