projects
/
busybox4maemo
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Initial public busybox maemo commit, 3:1.10.2.legal-1osso12
[busybox4maemo]
/
debian
/
sfdisk
/
disksize.c
1
#include "common.h"
2
3
int disksize(int fd, unsigned long long *sectors) {
4
int err;
5
long sz;
6
long long b;
7
8
err = ioctl(fd, BLKGETSIZE, &sz);
9
if (err)
10
return err;
11
err = ioctl(fd, BLKGETSIZE64, &b);
12
if (err || b == 0 || b == sz)
13
*sectors = sz;
14
else
15
*sectors = (b >> 9);
16
return 0;
17
}