pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/benchmarks/blogbench Not every system has O_DIRECT ......



details:   https://anonhg.NetBSD.org/pkgsrc/rev/589a1fd28926
branches:  trunk
changeset: 520462:589a1fd28926
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sun Oct 22 04:36:12 2006 +0000

description:
Not every system has O_DIRECT ... not even NetBSD.

diffstat:

 benchmarks/blogbench/distinfo         |   4 ++--
 benchmarks/blogbench/patches/patch-ad |  26 +++++++++++++++++---------
 2 files changed, 19 insertions(+), 11 deletions(-)

diffs (57 lines):

diff -r a106aa45aaee -r 589a1fd28926 benchmarks/blogbench/distinfo
--- a/benchmarks/blogbench/distinfo     Sun Oct 22 01:06:27 2006 +0000
+++ b/benchmarks/blogbench/distinfo     Sun Oct 22 04:36:12 2006 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.3 2006/10/15 12:53:04 xtraeme Exp $
+$NetBSD: distinfo,v 1.4 2006/10/22 04:36:12 rillig Exp $
 
 SHA1 (blogbench-1.0.tar.bz2) = 3e667bc9ebfee8751c28508a1840a10b9bdfc099
 RMD160 (blogbench-1.0.tar.bz2) = b688e83c06d45986d592a4fc6a6f5f59ade3da7a
@@ -6,6 +6,6 @@
 SHA1 (patch-aa) = 77c48f0e50aeeec341d7d127564839f526a86e1f
 SHA1 (patch-ab) = 9db1070408e2afd12272e01a62d5ea8f2802c1df
 SHA1 (patch-ac) = 72ce26dc25b1c2adf9b6d8835852c6ff7ddc1d84
-SHA1 (patch-ad) = e353b458af302aa0f9afd8811d11aafb3ed19010
+SHA1 (patch-ad) = dab09cd5e678cc5ccce62ffac365b6a61df14ee6
 SHA1 (patch-ae) = 01b8dcb0641941d70dd056ae2026b83fb16be954
 SHA1 (patch-af) = 8c16af43c281d28446dc2b976662c64b02cf3269
diff -r a106aa45aaee -r 589a1fd28926 benchmarks/blogbench/patches/patch-ad
--- a/benchmarks/blogbench/patches/patch-ad     Sun Oct 22 01:06:27 2006 +0000
+++ b/benchmarks/blogbench/patches/patch-ad     Sun Oct 22 04:36:12 2006 +0000
@@ -1,19 +1,27 @@
-$NetBSD: patch-ad,v 1.1 2006/10/15 12:53:04 xtraeme Exp $
+$NetBSD: patch-ad,v 1.2 2006/10/22 04:36:12 rillig Exp $
 
 --- src/helpers.c.orig 2005-02-11 15:46:26.000000000 +0100
-+++ src/helpers.c      2006-10-15 13:25:58.000000000 +0200
-@@ -49,8 +49,13 @@
++++ src/helpers.c      2006-10-22 06:33:08.000000000 +0200
+@@ -48,9 +48,20 @@ int create_dummy_file(const char * const
+     size_t towrite;
      ssize_t written;    
      int fd;
-     
+-    
 -    if ((fd = open(file_name, O_CREAT | O_TRUNC | O_WRONLY,
 -                 (mode_t) 0600)) == -1) {
-+    if (do_directio)
-+         fd = open(file_name, O_CREAT|O_TRUNC|O_WRONLY|O_DIRECT,
-+                  (mode_t)0600);
-+    else
-+         fd = open(file_name, O_CREAT|O_TRUNC|O_WRONLY, (mode_t)0600);
++    mode_t m;
 +
++#if defined(O_DIRECT)
++    m = O_CREAT|O_TRUNC|O_WRONLY|(do_directio ? O_DIRECT : 0);
++#else
++    if (do_directio) {
++      reentrant_printf("open: O_DIRECT is not supported on this system.\n");
++      return -1;
++    }
++    m = O_CREAT|O_TRUNC|O_WRONLY;
++#endif
++
++    fd = open(file_name, m, (mode_t)0600);
 +    if (fd == -1) {
        if (errno != ENOENT) {      
            reentrant_printf("open(\"%s\"): %s\n",



Home | Main Index | Thread Index | Old Index