Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
* Finding out the size of drd's
@ 2001-04-16 21:07 Sundar Matpadi
  0 siblings, 0 replies; only message in thread
From: Sundar Matpadi @ 2001-04-16 21:07 UTC (permalink / 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.



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-04-16 21:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-04-16 21:07 Finding out the size of drd's Sundar Matpadi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox