Dave,

Shouldn't "fread(&data,sizeof(data),1,f)" and "read(fn, &data, sizeof(data))" produce identical results?
Is it a bug or what?


Max

Dave Kleikamp wrote:

With this change, the file size on jfs becomes 2^48 + 4 as expected.

--- jfs_bug.c.orig      2005-03-17 14:18:48.229634648 -0600
+++ jfs_bug.c   2005-03-17 15:32:45.952750104 -0600
@@ -13,12 +13,14 @@ int data = 0;
struct flock fl;

void read1() {
-    size_t rc = fread(&data,sizeof(data),1,f);
+    /* size_t rc = fread(&data,sizeof(data),1,f); */
+    size_t rc = read(fn, &data, sizeof(data));
    printf("read() rc = %llu\n",rc);
}

void write1() {
-    size_t rc = fwrite(&data,sizeof(data),1,f);
+    /* size_t rc = fwrite(&data,sizeof(data),1,f); */
+    size_t rc = write(fn, &data, sizeof(data));
    printf("write() rc = %llu\n",rc);
}





- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html

Reply via email to