Force the st_blksize field of a stat call to be 8k.
authorGabe Black <gblack@eecs.umich.edu>
Wed, 14 Feb 2007 17:58:28 +0000 (12:58 -0500)
committerGabe Black <gblack@eecs.umich.edu>
Wed, 14 Feb 2007 17:58:28 +0000 (12:58 -0500)
--HG--
extra : convert_revision : 6cd2dc622ca95cc1ea89bd5e5cbf33d9510c351c

src/sim/syscall_emul.hh

index 27356c9f1f4ed9323cd87ea4b9c1102dbaf138b0..f57bd52729bf3ec83187f7d3bd92e686e3c2f26e 100644 (file)
@@ -377,7 +377,9 @@ convertStatBuf(target_stat &tgt, host_stat *host, bool fakeTTY = false)
     tgt->st_mtimeX = htog(tgt->st_mtimeX);
     tgt->st_ctimeX = host->st_ctime;
     tgt->st_ctimeX = htog(tgt->st_ctimeX);
-    tgt->st_blksize = host->st_blksize;
+    // Force the block size to be 8k. This helps to ensure buffered io works
+    // consistently across different hosts.
+    tgt->st_blksize = 0x2000;
     tgt->st_blksize = htog(tgt->st_blksize);
     tgt->st_blocks = host->st_blocks;
     tgt->st_blocks = htog(tgt->st_blocks);