Fix copy/paste error in benchmark code.

This had minimal impact on the results, since 95% of the writes were
performed through pwrite(), but it's important to fix this for future
benchmark suites.

Bug: 29759783
Change-Id: Ic628aab98b9f9def78508cc722899afdefed84ae
diff --git a/BenchmarkGen.h b/BenchmarkGen.h
index 3e86608..8a4f68b 100644
--- a/BenchmarkGen.h
+++ b/BenchmarkGen.h
@@ -220,7 +220,7 @@
 t3450f22 = TEMP_FAILURE_RETRY(open("file14", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
 close(t3450f22);
 t3450f22 = TEMP_FAILURE_RETRY(open("file15", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
-TEMP_FAILURE_RETRY(read(t3450f22, buf, 1));
+TEMP_FAILURE_RETRY(write(t3450f22, buf, 1));
 TEMP_FAILURE_RETRY(fsync(t3450f22));
 close(t3450f22);
 close(t3450f18);
@@ -405,7 +405,7 @@
 t3455f19 = TEMP_FAILURE_RETRY(open("file14", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
 close(t3455f19);
 t3455f19 = TEMP_FAILURE_RETRY(open("file15", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
-TEMP_FAILURE_RETRY(read(t3455f19, buf, 1));
+TEMP_FAILURE_RETRY(write(t3455f19, buf, 1));
 TEMP_FAILURE_RETRY(fsync(t3455f19));
 close(t3455f19);
 close(t3455f18);
@@ -1944,7 +1944,7 @@
 TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 28, 0));
 TEMP_FAILURE_RETRY(fdatasync(t3499f55));
 close(t3499f55);
-TEMP_FAILURE_RETRY(read(t3505f56, buf, 20552));
+TEMP_FAILURE_RETRY(write(t3505f56, buf, 20552));
 TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35601253));
 TEMP_FAILURE_RETRY(pread(t3455f17, buf, 36, 35601283));
 TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3224, 35598336)); // mmap2
@@ -1969,11 +1969,11 @@
 TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35513539));
 TEMP_FAILURE_RETRY(pread(t3455f17, buf, 37, 35513569));
 TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1673, 35512320)); // mmap2
-TEMP_FAILURE_RETRY(read(t3505f56, buf, 16008));
+TEMP_FAILURE_RETRY(write(t3505f56, buf, 16008));
 TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 31153857));
 TEMP_FAILURE_RETRY(pread(t3455f17, buf, 48, 31153887));
 TEMP_FAILURE_RETRY(pread(t3455f17, buf, 4461, 31150080)); // mmap2
-TEMP_FAILURE_RETRY(read(t3505f56, buf, 10864));
+TEMP_FAILURE_RETRY(write(t3505f56, buf, 10864));
 TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34907552));
 TEMP_FAILURE_RETRY(pread(t3455f17, buf, 39, 34907582));
 TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2551, 34906112)); // mmap2
@@ -1986,7 +1986,7 @@
 TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 30431338));
 TEMP_FAILURE_RETRY(pread(t3455f17, buf, 42, 30431368));
 TEMP_FAILURE_RETRY(pread(t3455f17, buf, 4400, 30429184)); // mmap2
-TEMP_FAILURE_RETRY(read(t3505f56, buf, 14320));
+TEMP_FAILURE_RETRY(write(t3505f56, buf, 14320));
 TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34416128));
 TEMP_FAILURE_RETRY(pread(t3455f17, buf, 43, 34416158));
 TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1855, 34414592)); // mmap2
@@ -1996,18 +1996,18 @@
 TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 29892892));
 TEMP_FAILURE_RETRY(pread(t3455f17, buf, 58, 29892922));
 TEMP_FAILURE_RETRY(pread(t3455f17, buf, 755, 29892608)); // mmap2
-TEMP_FAILURE_RETRY(read(t3505f56, buf, 12208));
-TEMP_FAILURE_RETRY(read(t3505f56, buf, 20736));
+TEMP_FAILURE_RETRY(write(t3505f56, buf, 12208));
+TEMP_FAILURE_RETRY(write(t3505f56, buf, 20736));
 TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 36353719));
 TEMP_FAILURE_RETRY(pread(t3455f17, buf, 43, 36353749));
 TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2179, 36352000)); // mmap2
 TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35512004));
 TEMP_FAILURE_RETRY(pread(t3455f17, buf, 33, 35512034));
 TEMP_FAILURE_RETRY(pread(t3455f17, buf, 4299, 35508224)); // mmap2
-TEMP_FAILURE_RETRY(read(t3505f56, buf, 8936));
-TEMP_FAILURE_RETRY(read(t3505f56, buf, 2800));
-TEMP_FAILURE_RETRY(read(t3505f56, buf, 20216));
-TEMP_FAILURE_RETRY(read(t3505f56, buf, 16912));
+TEMP_FAILURE_RETRY(write(t3505f56, buf, 8936));
+TEMP_FAILURE_RETRY(write(t3505f56, buf, 2800));
+TEMP_FAILURE_RETRY(write(t3505f56, buf, 20216));
+TEMP_FAILURE_RETRY(write(t3505f56, buf, 16912));
 close(t3505f56);
 t3505f56 = TEMP_FAILURE_RETRY(open("file31", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
 TEMP_FAILURE_RETRY(pread(t3505f56, buf, 1, 0));
@@ -2409,9 +2409,9 @@
 int  t3519f75 = TEMP_FAILURE_RETRY(open("file128", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
 close(t3526f70);
 t3526f70 = TEMP_FAILURE_RETRY(open("file129", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
-TEMP_FAILURE_RETRY(read(t3519f75, buf, 2991));
+TEMP_FAILURE_RETRY(write(t3519f75, buf, 2991));
 close(t3519f75);
-TEMP_FAILURE_RETRY(read(t3526f70, buf, 3974));
+TEMP_FAILURE_RETRY(write(t3526f70, buf, 3974));
 close(t3526f70);
 t3519f67 = TEMP_FAILURE_RETRY(open("file130", O_RDONLY|O_LARGEFILE));
 TEMP_FAILURE_RETRY(read(t3519f67, buf, 16384));
@@ -2444,18 +2444,18 @@
 t3526f70 = TEMP_FAILURE_RETRY(open("file131", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE));
 close(t3526f70);
 t3526f70 = TEMP_FAILURE_RETRY(open("file131", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
-TEMP_FAILURE_RETRY(read(t3526f70, buf, 4622));
+TEMP_FAILURE_RETRY(write(t3526f70, buf, 4622));
 close(t3526f70);
 int  t3526f72 = TEMP_FAILURE_RETRY(open("file132", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE));
 close(t3526f72);
 t3526f72 = TEMP_FAILURE_RETRY(open("file132", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
-TEMP_FAILURE_RETRY(read(t3526f72, buf, 16384));
-TEMP_FAILURE_RETRY(read(t3526f72, buf, 6849));
+TEMP_FAILURE_RETRY(write(t3526f72, buf, 16384));
+TEMP_FAILURE_RETRY(write(t3526f72, buf, 6849));
 close(t3526f72);
 t3526f70 = TEMP_FAILURE_RETRY(open("file133", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE));
 close(t3526f70);
 int  t3526f75 = TEMP_FAILURE_RETRY(open("file133", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
-TEMP_FAILURE_RETRY(read(t3526f75, buf, 13332));
+TEMP_FAILURE_RETRY(write(t3526f75, buf, 13332));
 close(t3526f75);
 int  t3495f70 = TEMP_FAILURE_RETRY(open("file31", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
 TEMP_FAILURE_RETRY(pread(t3495f70, buf, 1, 0));
@@ -2484,7 +2484,7 @@
 int  t3526f93 = TEMP_FAILURE_RETRY(open("file134", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE));
 close(t3526f93);
 int  t3526f88 = TEMP_FAILURE_RETRY(open("file134", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
-TEMP_FAILURE_RETRY(read(t3526f88, buf, 15056));
+TEMP_FAILURE_RETRY(write(t3526f88, buf, 15056));
 close(t3526f88);
 TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34433108));
 TEMP_FAILURE_RETRY(pread(t3455f17, buf, 56, 34433138));
@@ -2546,13 +2546,13 @@
 int  t3526f64 = TEMP_FAILURE_RETRY(open("file135", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE));
 close(t3526f64);
 t3526f64 = TEMP_FAILURE_RETRY(open("file135", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
-TEMP_FAILURE_RETRY(read(t3526f64, buf, 16384));
-TEMP_FAILURE_RETRY(read(t3526f64, buf, 4873));
+TEMP_FAILURE_RETRY(write(t3526f64, buf, 16384));
+TEMP_FAILURE_RETRY(write(t3526f64, buf, 4873));
 close(t3526f64);
 int  t3526f90 = TEMP_FAILURE_RETRY(open("file136", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE));
 close(t3526f90);
 t3526f90 = TEMP_FAILURE_RETRY(open("file136", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
-TEMP_FAILURE_RETRY(read(t3526f90, buf, 4199));
+TEMP_FAILURE_RETRY(write(t3526f90, buf, 4199));
 close(t3526f90);
 int  t3499f90 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
 TEMP_FAILURE_RETRY(pread(t3499f90, buf, 1, 0));
@@ -2759,8 +2759,8 @@
 TEMP_FAILURE_RETRY(read(t3526f70, buf, 16384));
 TEMP_FAILURE_RETRY(read(t3526f70, buf, 16384));
 close(t3526f70);
-TEMP_FAILURE_RETRY(read(t3505f66, buf, 10432));
-TEMP_FAILURE_RETRY(read(t3505f66, buf, 4464));
+TEMP_FAILURE_RETRY(write(t3505f66, buf, 10432));
+TEMP_FAILURE_RETRY(write(t3505f66, buf, 4464));
 t3495f70 = TEMP_FAILURE_RETRY(open("file31", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
 TEMP_FAILURE_RETRY(pread(t3495f70, buf, 1, 0));
 close(t3495f70);
@@ -2785,26 +2785,26 @@
 TEMP_FAILURE_RETRY(pwrite(t3495f70, buf, 28, 0));
 TEMP_FAILURE_RETRY(fdatasync(t3495f70));
 close(t3495f70);
-TEMP_FAILURE_RETRY(read(t3505f66, buf, 10592));
+TEMP_FAILURE_RETRY(write(t3505f66, buf, 10592));
 int  t3533f70 = TEMP_FAILURE_RETRY(open("file140", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE));
 close(t3533f70);
 t3533f70 = TEMP_FAILURE_RETRY(open("file140", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
-TEMP_FAILURE_RETRY(read(t3533f70, buf, 4042));
+TEMP_FAILURE_RETRY(write(t3533f70, buf, 4042));
 close(t3533f70);
-TEMP_FAILURE_RETRY(read(t3505f66, buf, 9664));
-TEMP_FAILURE_RETRY(read(t3505f66, buf, 23656));
+TEMP_FAILURE_RETRY(write(t3505f66, buf, 9664));
+TEMP_FAILURE_RETRY(write(t3505f66, buf, 23656));
 t3533f70 = TEMP_FAILURE_RETRY(open("file141", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE));
 close(t3533f70);
 t3526f70 = TEMP_FAILURE_RETRY(open("file142", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE));
 int  t3533f72 = TEMP_FAILURE_RETRY(open("file141", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
 close(t3526f70);
 t3526f70 = TEMP_FAILURE_RETRY(open("file142", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
-TEMP_FAILURE_RETRY(read(t3526f70, buf, 5057));
-TEMP_FAILURE_RETRY(read(t3533f72, buf, 4595));
+TEMP_FAILURE_RETRY(write(t3526f70, buf, 5057));
+TEMP_FAILURE_RETRY(write(t3533f72, buf, 4595));
 close(t3526f70);
 close(t3533f72);
-TEMP_FAILURE_RETRY(read(t3505f66, buf, 19744));
-TEMP_FAILURE_RETRY(read(t3505f66, buf, 9344));
+TEMP_FAILURE_RETRY(write(t3505f66, buf, 19744));
+TEMP_FAILURE_RETRY(write(t3505f66, buf, 9344));
 t3499f70 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
 TEMP_FAILURE_RETRY(pread(t3499f70, buf, 1, 0));
 close(t3499f70);
@@ -2821,7 +2821,7 @@
 TEMP_FAILURE_RETRY(pwrite(t3499f70, buf, 4, 12820));
 TEMP_FAILURE_RETRY(pread(t3499f70, buf, 8, 13312));
 TEMP_FAILURE_RETRY(fdatasync(t3499f70));
-TEMP_FAILURE_RETRY(read(t3505f66, buf, 24672));
+TEMP_FAILURE_RETRY(write(t3505f66, buf, 24672));
 t3499f72 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
 TEMP_FAILURE_RETRY(fdatasync(t3499f72));
 close(t3499f72);
@@ -2830,8 +2830,8 @@
 TEMP_FAILURE_RETRY(pwrite(t3499f70, buf, 28, 0));
 TEMP_FAILURE_RETRY(fdatasync(t3499f70));
 close(t3499f70);
-TEMP_FAILURE_RETRY(read(t3505f66, buf, 7584));
-TEMP_FAILURE_RETRY(read(t3505f66, buf, 10736));
+TEMP_FAILURE_RETRY(write(t3505f66, buf, 7584));
+TEMP_FAILURE_RETRY(write(t3505f66, buf, 10736));
 close(t3505f66);
 t3505f66 = TEMP_FAILURE_RETRY(open("file31", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
 TEMP_FAILURE_RETRY(pread(t3505f66, buf, 1, 0));
@@ -2928,9 +2928,9 @@
 t3533f91 = TEMP_FAILURE_RETRY(open("file143", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
 TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 31210525));
 TEMP_FAILURE_RETRY(pread(t3455f17, buf, 44, 31210555));
-TEMP_FAILURE_RETRY(read(t3533f91, buf, 16384));
+TEMP_FAILURE_RETRY(write(t3533f91, buf, 16384));
 TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3673, 31207424)); // mmap2
-TEMP_FAILURE_RETRY(read(t3533f91, buf, 2024));
+TEMP_FAILURE_RETRY(write(t3533f91, buf, 2024));
 close(t3533f91);
 int  t3499f91 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
 TEMP_FAILURE_RETRY(pread(t3499f91, buf, 1, 0));
@@ -2983,40 +2983,40 @@
 int  t3533f102 = TEMP_FAILURE_RETRY(open("file144", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE));
 close(t3533f102);
 t3533f72 = TEMP_FAILURE_RETRY(open("file144", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
-TEMP_FAILURE_RETRY(read(t3533f72, buf, 5550));
+TEMP_FAILURE_RETRY(write(t3533f72, buf, 5550));
 close(t3533f72);
 int  t3526f84 = TEMP_FAILURE_RETRY(open("file145", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE));
 close(t3526f84);
 int  t3526f101 = TEMP_FAILURE_RETRY(open("file145", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
-TEMP_FAILURE_RETRY(read(t3526f101, buf, 3612));
+TEMP_FAILURE_RETRY(write(t3526f101, buf, 3612));
 close(t3526f101);
 t3526f90 = TEMP_FAILURE_RETRY(open("file146", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE));
 close(t3526f90);
 t3526f90 = TEMP_FAILURE_RETRY(open("file146", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
-TEMP_FAILURE_RETRY(read(t3526f90, buf, 5414));
+TEMP_FAILURE_RETRY(write(t3526f90, buf, 5414));
 int  t3533f96 = TEMP_FAILURE_RETRY(open("file147", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE));
 close(t3533f96);
 t3533f96 = TEMP_FAILURE_RETRY(open("file147", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
 close(t3526f90);
-TEMP_FAILURE_RETRY(read(t3533f96, buf, 3834));
+TEMP_FAILURE_RETRY(write(t3533f96, buf, 3834));
 close(t3533f96);
 int  t3519f90 = TEMP_FAILURE_RETRY(open("file148", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE));
 close(t3519f90);
 t3519f90 = TEMP_FAILURE_RETRY(open("file148", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
-TEMP_FAILURE_RETRY(read(t3519f90, buf, 3461));
+TEMP_FAILURE_RETRY(write(t3519f90, buf, 3461));
 int  t3526f96 = TEMP_FAILURE_RETRY(open("file149", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE));
 close(t3526f96);
 close(t3519f90);
 t3526f90 = TEMP_FAILURE_RETRY(open("file149", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
-TEMP_FAILURE_RETRY(read(t3526f90, buf, 16384));
-TEMP_FAILURE_RETRY(read(t3526f90, buf, 12766));
+TEMP_FAILURE_RETRY(write(t3526f90, buf, 16384));
+TEMP_FAILURE_RETRY(write(t3526f90, buf, 12766));
 close(t3526f90);
 int  t3533f90 = TEMP_FAILURE_RETRY(open("file150", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE));
 close(t3533f90);
 t3533f90 = TEMP_FAILURE_RETRY(open("file150", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
 int  t3505f96 = TEMP_FAILURE_RETRY(open("file151", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
 TEMP_FAILURE_RETRY(pread(t3505f96, buf, 100, 0));
-TEMP_FAILURE_RETRY(read(t3533f90, buf, 10056));
+TEMP_FAILURE_RETRY(write(t3533f90, buf, 10056));
 close(t3533f90);
 t3505f90 = TEMP_FAILURE_RETRY(open("file152", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
 TEMP_FAILURE_RETRY(pread(t3505f90, buf, 1, 0));
@@ -3042,7 +3042,7 @@
 close(t3505f90);
 t3533f90 = TEMP_FAILURE_RETRY(open("file153", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
 TEMP_FAILURE_RETRY(pread(t3505f96, buf, 16, 24));
-TEMP_FAILURE_RETRY(read(t3533f90, buf, 13271));
+TEMP_FAILURE_RETRY(write(t3533f90, buf, 13271));
 close(t3533f90);
 TEMP_FAILURE_RETRY(pread(t3505f96, buf, 4096, 16384));
 TEMP_FAILURE_RETRY(pread(t3505f96, buf, 4096, 12288));
@@ -3461,7 +3461,7 @@
 TEMP_FAILURE_RETRY(fdatasync(t3545f97));
 close(t3545f97);
 int  t3575f29 = TEMP_FAILURE_RETRY(open("file16", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE));
-TEMP_FAILURE_RETRY(read(t3575f29, buf, 17344));
+TEMP_FAILURE_RETRY(write(t3575f29, buf, 17344));
 close(t3575f29);
 t3545f97 = TEMP_FAILURE_RETRY(open("file155", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
 TEMP_FAILURE_RETRY(pread(t3545f97, buf, 1, 0));
@@ -3801,11 +3801,11 @@
 TEMP_FAILURE_RETRY(fdatasync(t3499f103));
 t3499f105 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
 TEMP_FAILURE_RETRY(fdatasync(t3499f105));
-TEMP_FAILURE_RETRY(read(t3496f28, buf, 8188));
+TEMP_FAILURE_RETRY(write(t3496f28, buf, 8188));
 close(t3499f105);
 TEMP_FAILURE_RETRY(pwrite(t3499f103, buf, 12, 0));
 TEMP_FAILURE_RETRY(fdatasync(t3499f103));
-TEMP_FAILURE_RETRY(read(t3496f28, buf, 3166));
+TEMP_FAILURE_RETRY(write(t3496f28, buf, 3166));
 TEMP_FAILURE_RETRY(pwrite(t3499f103, buf, 28, 0));
 TEMP_FAILURE_RETRY(fdatasync(t3499f103));
 close(t3499f103);
diff --git a/bench/benchgen.py b/bench/benchgen.py
index d529332..9a2bcd7 100644
--- a/bench/benchgen.py
+++ b/bench/benchgen.py
@@ -216,7 +216,7 @@
                 # TODO: track actual file size instead of guessing
                 count = min(int(e.args[2]), bufsize)
                 f.size += count
-                print >>bench, 'TEMP_FAILURE_RETRY(read(%s, buf, %d));' % (handle, count)
+                print >>bench, 'TEMP_FAILURE_RETRY(write(%s, buf, %d));' % (handle, count)
                 nwrite += 1
 
         elif e.call == "pread64":