W wrote:
nah ..., kalau saya buat sendiri file nya ternyata skrh bisa mengukur
sector size skrg ...
##GetSDSectorSize.c
#include <stdio.h>
#include <sys/ioctl.h>
#include <linux/fs.h> /** where BLKSSZGET declared **/
#include <errno.h> /** Where EINVAL declared **/
#include <sys/io.h> /** open() **/
#include <fcntl.h>
#include <errno.h>
int main()
{
int device_sector_size = sector_size_for_device("/dev/mmcblk0p2");
printf("\nUkuran sector sdcard = %d \n", device_sector_size) ;
return 0 ;
}
static int sector_size(int fd)
{
int bsize;
if (ioctl(fd,BLKSSZGET,&bsize) < 0)
return -EINVAL;
else
return bsize;
}
int sector_size_for_device(const char *device)
{
int fd = open(device, O_RDONLY);
int r;
if(fd < 0)
return -EINVAL;
r = sector_size(fd);
close(fd);
return r;
}
Hampir ketemu ...
Gotcha! kalau begitu, device mmcblk0p2 tidak dikenal di bagian ini
static int get_device_infos(const char *device, struct device_infos
*infos) di file setup.c
Btw, keep going :-)
Doni
--
FAQ milis di http://wiki.linux.or.id/FAQ_milis_tanya-jawab
Unsubscribe: kirim email ke [EMAIL PROTECTED]
Arsip dan info milis selengkapnya di http://linux.or.id/milis