summaryrefslogtreecommitdiff
path: root/benchmarks/bytebench/patches/patch-ag
blob: fddceffb51e5f8d3f69924bbb94e95c8e650da74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
$NetBSD: patch-ag,v 1.1 2005/10/31 17:09:45 tv Exp $

--- src/fstime.c.orig	1999-07-28 17:47:02.000000000 -0400
+++ src/fstime.c
@@ -151,11 +151,13 @@ int w_test(void)
 	long f_blocks;
 	extern int sigalarm;
 
+#ifndef __INTERIX
 	/* Sync and let it settle */
 	sync();
 	sleep(2);
 	sync();
 	sleep(1);
+#endif
 
 	signal(SIGALRM,stop_count);
 	sigalarm = 0; /* reset alarm flag */
@@ -176,6 +178,8 @@ int w_test(void)
 		lseek(f, 0L, 0); /* rewind */
 	}
 
+	fsync(f);
+
 	/* stop clock */
 	fprintf(stderr, "%d second sample\n", seconds);
 	write_score = counted/((long)seconds * COUNTPERK);
@@ -194,11 +198,13 @@ int r_test(void)
 	extern int sigalarm;
 	extern int errno;
 
+#ifndef __INTERIX
 	/* Sync and let it settle */
 	sync();
 	sleep(2 + seconds/4);
 	sync();
 	sleep(1 + seconds/4);
+#endif
 
 	/* rewind */
 	errno = 0;
@@ -229,6 +235,8 @@ int r_test(void)
 			counted += COUNTPERBUF;
 	}
 
+	fsync(f);
+
 	/* stop clock */
 	fprintf(stderr, "%d second sample\n", seconds);
 	read_score = counted / ((long)seconds * COUNTPERK);