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 51 52 53 54 55 56 57
|
--- disk.c~ Fri Apr 11 03:56:00 1997
+++ disk.c Thu Aug 13 10:39:37 1998
@@ -33,13 +33,14 @@
return open(bootdevice);
}
-int read(char *buf, int nbytes, int offset)
+int read(char *buf, int nbytes, long long offset)
{
int nr;
if (nbytes == 0)
return 0;
- call_prom("seek", 3, 1, current_dev, 0, offset);
+ call_prom("seek", 3, 1, current_dev, (int) (offset >> 32),
+ (unsigned int) offset);
nr = (int) call_prom("read", 3, 1, current_dev, buf, nbytes);
return nr;
}
--- file.c~ Fri Apr 11 03:59:58 1997
+++ file.c Thu Aug 13 10:39:09 1998
@@ -47,6 +47,8 @@
linux_flush
};
+extern int read(char *, int, long long);
+
ext2_filsys fs = 0;
static ino_t root, cwd;
static io_manager linux_io_manager = &struct_linux_manager;
@@ -71,7 +73,7 @@
struct mac_partition *mp = (struct mac_partition *) blk;
struct mac_driver_desc *md = (struct mac_driver_desc *) blk;
- rc = read(blk, 512, 0);
+ rc = read(blk, 512, 0LL);
if (rc != 512) {
fatal("Cannot read driver descriptor");
return 0;
@@ -84,7 +86,7 @@
blocks_in_map = 1;
upart = 0;
for (i = 1; i <= blocks_in_map; ++i) {
- if (read(blk, 512, i * secsize) != 512) {
+ if (read(blk, 512, (long long) i * secsize) != 512) {
fatal("Error reading partition map");
return 0;
}
@@ -156,7 +158,7 @@
int size;
size = (count < 0) ? -count : count * bs;
- if (read (data, size, block * bs + doff) != size) {
+ if (read (data, size, (long long) block * bs + doff) != size) {
printf ("\nRead error on block %d", block);
return EXT2_ET_SHORT_READ;
}
|