From: Eric Sandeen Date: Mon, 25 Feb 2002 22:25:25 +0000 (+0000) Subject: Merge of xfs-cmds-2.4.18:slinx:111281a by nathans. X-Git-Tag: v2.1.0~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29e622719f3e094af59250d422fbbe1535b9aec2;p=thirdparty%2Fxfsprogs-dev.git Merge of xfs-cmds-2.4.18:slinx:111281a by nathans. Use BLKGETSIZE64 instead of BLKGETSIZE ioctl to find device size glibc might not have this yet, so define it if we need it --- diff --git a/libxfs/init.c b/libxfs/init.c index 68a758d12..0a388d82b 100644 --- a/libxfs/init.c +++ b/libxfs/init.c @@ -39,6 +39,11 @@ #include #include +/* Until glibc catches up... */ +#ifndef BLKGETSIZE64 +#define BLKGETSIZE64 _IOR(0x12,114,sizeof(__uint64_t)) +#endif + #define findrawpath(x) x #define findblockpath(x) x @@ -128,7 +133,7 @@ findsize(char *path) { int fd; int error; - unsigned long size; + __uint64_t size; struct stat64 st; /* Test to see if we are dealing with a regular file rather than a @@ -150,7 +155,9 @@ findsize(char *path) progname, path, strerror(errno)); exit(1); } - error = ioctl(fd, BLKGETSIZE, &size); + error = ioctl(fd, BLKGETSIZE64, &size); + /* BLKGETSIZE64 returns size in bytes */ + size = size >> 9; if (error < 0) { fprintf(stderr, "%s: can't determine device size\n", progname); exit(1);