Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ dkio(4) — Ultrix-32 2.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

hp(4)

ra(4)

rb(4)

rd(4)

rk(4)

rl(4)

rx(4)

MAKEDEV(8)

disktab(5)

fs(5)

chpt(8)

diskpart(8)

fsck(8)

mkfs(8)

tunefs(8)

dkio(4)

NAME

dkio − ULTRIX disk interface

SYNTAX

#include <sys/fs.h>
#include <sys/ioctl.h>
#include <sys/dkio.h>

DESCRIPTION

This section describes the ioctl (input/output controller) codes for all disk drivers. 

Basic Ioctls

The basic ioctl (input/output controller) format is: #include <sys/fs.h>
#include <sys/ioctl.h>
#include <sys/dkio.h>
ioctl(fildes, code, arg)
struct pt *arg; The applicable codes are:

DIOCGETPT This code indicates to the driver to store the information in the current partition table in the address pointed to by arg.  The file descriptor must be opened on the raw partitions a or c.  DIOCGETPT does not change the partition table, but it does provide access to the partition table information.

DIOCSETPT This code indicates to the driver to modify the current partition table with the information pointed to by arg.  The file descriptor must be opened on the raw partitions a or c.  If the a or c partition is not mounted, then only the partition table in the driver is modified.  This temporarily modifies the partition table of the disk.  The modifications are overwritten with the default table when the disk is turned off and on.  If the a or c partition is mounted, then both the partition table in the driver and the partition table in the primary superblock are modified.  This permanently modifies the partition table of the disk.  This is not recommended.  To change a partition table permanently, you should use the chpt(8) command. 

DIOCDGTPT This code indicates to the driver to store the default information of the current partition table in the address pointed to by arg.  The file descriptor must be opened on the raw partitions a or c.  DIOCGETPT does not change the partition table, but it does provide access to the partition table information.

DKIOCDOP This code allows the user to issue generic disk operations as defined in <sys/dkio.h>.Itsuseis

DKIOCGET This code allows the user to receive generic disk information as defined in <sys/dkio.h>.

DKIOCACC This code indicates that for an mscp class of disk the driver perform one of the following functions:

- force revector a specified disk block
- scan an area of the disk reporting any forced errors
  found and revectoring any bad blocks found
- clear a forced error condition on the specified block

EXAMPLE

This example shows how to use the DIOGETPT ioctl code to print the length and offset of the a partition of an RA81 disk:

#include <sys/types.h>
#include <sys/param.h>
#include <sys/fs.h>
#include <sys/ioctl.h>
#include <sys/dkio.h>
 main()
{
struct pt arg;
int fd, i;
 /* Open the "a" partition of the disk you want to see */
 if ( (fd = open("/dev/rra0a",0)) < 0 ) {
printf("Unable to open device\n");
exit(1);
}
 /* Get the partition information */
 if ( ioctl(fd,DIOCGETPT,&arg) < 0 )
printf("Error in ioctl\n");
 printf("Length\t\tOffset\n");
  for ( i = 0; i <= 7; i++ ) {
printf("%d\t\t%d\n",arg.pt_part[i].pi_nblocks,
  arg.pt_part[i].pi_blkoff );
}
}

FILES

/dev/{r}ra??? 
/dev/{r}hp???
/dev/{r}rb???
/dev/{r}rd???
/dev/{r}rk???
/dev/{r}rl???
/dev/{r}rx???

RESTRICTIONS

These restrictions apply when using the DIOSETPT ioctl code:

•You must have superuser privileges. 

•You can not shrink or change the offset of a partition with a file system mounted on it or with an open file descriptor on the entire partition. 

•You can not change the offset of the a partition. 

SEE ALSO

hp(4), ra(4), rb(4), rd(4), rk(4), rl(4), rx(4), MAKEDEV(8), disktab(5), fs(5), chpt(8), diskpart(8), fsck(8), mkfs(8), tunefs(8)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026