From: Sundar Matpadi <smatpadi@us.oracle.com>
Subject: Finding out the size of drd's
Date: Mon, 16 Apr 2001 14:07:34 -0700 [thread overview]
Message-ID: <3ADB5F16.983CD91F@us.oracle.com> (raw)
Hello :
How to find out the size of the DRDs and its block size using
IOCTL calls ? I tried using DEVGETINFO in ioctl but results seem to be
not matching with the size ?
Can you point what I am missing here ?
Here is the code snippet :
#include <stdio.h>
#include <sys/fcntl.h>
#include <sys/devgetinfo.h>
#include <sys/devio.h>
#include <stropts.h>
device_info_t mydevice;
int fd;
struct disklabel *disk;
char rawdevice_name[50];
char buffcount[25];
strcpy (rawdevice_name, "/dev/rdrd/drd2");
if ( (fd = open(rawdevice_name, O_RDWR)) == -1) {
perror ("Error in opening file ");
exit(1);
}
ioctl (fd, DEVGETINFO, &mydevice);
printf("raw device name is %s \n", rawdevice_name);
printf("device capacity = %ld
\n",mydevice.v1.devinfo.disk.capacity);
printf("device blksiz = %ld \n",mydevice.v1.devinfo.disk.blocksz);
printf("part num = %d \n",mydevice.v1.devinfo.disk.part_num);
printf("ioctl done successfully");
close(fd);
regards,
sundar.
reply other threads:[~2001-04-16 21:07 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox