GETDISKBYNAME(3) — UNIX Programmer’s Manual
NAME
getdiskbyname − get disk description by its name
SYNOPSIS
#include <disktab.h>
struct disktab ∗
getdiskbyname(name)
char ∗name;
DESCRIPTION
Getdiskbyname takes a disk name (e.g. rm03) and returns a structure describing its geometry information and the standard disk partition tables. All information obtained from the disktab(5) file.
<disktab.h> has the following form:
/∗
∗ $Header: /smsa/bsd:include/disktab.h:bsd 1.5 $
∗ $Source: /smsa/bsd:include/disktab.h: $
∗
∗ Copyright (c) 1988 Acorn Computers Ltd., Cambridge, England
∗/
/∗
∗ Copyright (c) 1983 Regents of the University of California.
∗ All rights reserved. The Berkeley software License Agreement
∗ specifies the terms and conditions for redistribution.
∗
∗@(#)disktab.h5.2 (Berkeley) 10/1/85
∗/
#ifndef __disktab_h
#define __disktab_h
/∗
∗ Disk description table, see disktab(5)
∗/
#defineDISKTAB"/etc/disktab"
structdisktab {
char∗d_name;/∗ drive name ∗/
char∗d_type;/∗ drive type ∗/
intd_secsize;/∗ sector size in bytes ∗/
intd_ntracks;/∗ # tracks/cylinder ∗/
intd_nsectors;/∗ # sectors/track ∗/
intd_ncylinders;/∗ # cylinders ∗/
intd_rpm;/∗ revolutions/minute ∗/
intd_badsectforw;/∗ supports DEC bad144 std ∗/
intd_sectoffset;/∗ use sect rather than cyl offsets ∗/
structpartition {
intp_size;/∗ #sectors in partition ∗/
shortp_bsize;/∗ block size in bytes ∗/
shortp_fsize;/∗ frag size in bytes ∗/
} d_partitions[8];
};
structdisktab ∗getdiskbyname(char ∗);
#endif/∗__disktab_h∗/
/∗ EOF disktab.h ∗/
SEE ALSO
BUGS
This information should be obtained from the system for locally available disks (in particular, the disk partition tables).
4.2 Berkeley Distribution — Revision 1.2 of 19/10/88