summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2006-01-12 10:10:36 +0000
committerPascal Rigaux <pixel@mandriva.com>2006-01-12 10:10:36 +0000
commit749646d30eb3cefd0df6cbd29f1af6b6b29f745b (patch)
treeec226908d9aafbcb605db091e2089e286e6d1072
parent6b0ec001d1c557d38c3787722d539583d289443f (diff)
downloaddrakx-749646d30eb3cefd0df6cbd29f1af6b6b29f745b.tar
drakx-749646d30eb3cefd0df6cbd29f1af6b6b29f745b.tar.gz
drakx-749646d30eb3cefd0df6cbd29f1af6b6b29f745b.tar.bz2
drakx-749646d30eb3cefd0df6cbd29f1af6b6b29f745b.tar.xz
drakx-749646d30eb3cefd0df6cbd29f1af6b6b29f745b.zip
use BLKGETSIZE64 to allow detecting partitions bigger than 2TB, and use
"double" instead of "unsigned int" (nb: it means we will use doubles instead of ints for computing things, this works quite nicely up to 100_000TB
-rw-r--r--perl-install/c/stuff.xs.pl10
1 files changed, 6 insertions, 4 deletions
diff --git a/perl-install/c/stuff.xs.pl b/perl-install/c/stuff.xs.pl
index 31e37c748..4a1f845c2 100644
--- a/perl-install/c/stuff.xs.pl
+++ b/perl-install/c/stuff.xs.pl
@@ -226,13 +226,15 @@ floppy_info(name)
OUTPUT:
RETVAL
-unsigned int
+double
total_sectors(fd)
int fd
CODE:
{
- long s;
- RETVAL = ioctl(fd, BLKGETSIZE, &s) == 0 ? s : 0;
+ unsigned long long ll;
+ unsigned long l;
+ RETVAL = ioctl(fd, BLKGETSIZE64, &ll) == 0 ? ll / 512 :
+ ioctl(fd, BLKGETSIZE, &l) == 0 ? l : 0;
}
OUTPUT:
RETVAL
@@ -680,7 +682,7 @@ get_iso_volume_ids(int fd)
@macros = (
[ qw(int S_IFCHR S_IFBLK S_IFIFO KDSKBENT KT_SPEC K_NOSUCHMAP NR_KEYS MAX_NR_KEYMAPS BLKRRPART TIOCSCTTY
- HDIO_GETGEO BLKGETSIZE LOOP_GET_STATUS
+ HDIO_GETGEO LOOP_GET_STATUS
MS_MGC_VAL O_WRONLY O_RDWR O_CREAT O_NONBLOCK F_SETFL F_GETFL WNOHANG
VT_ACTIVATE VT_WAITACTIVE VT_GETSTATE CDROM_LOCKDOOR CDROMEJECT CDROM_DRIVE_STATUS
LOG_WARNING LOG_INFO LOG_LOCAL1