GETDISKBYNAME(3-BSD)RISC/os Reference Manual GETDISKBYNAME(3-BSD)
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 stan-
dard disk partition tables. All information obtained from
the disktab(5) file.
<disktab.h> has the following form:
#ifndef BSD43_
# include <bsd43/bsd43_.h>
#endif BSD43_
/*
* Disk description table, see disktab(5)
*/
#ifdef mips
#include <bsd43/sys/types.h>
#include <bsd43/mips/dvh.h>
#endif
#ifndef NPARTAB
#define BSD43_NUPART 8
#else
/*
* Number of user partitions is the total number of partitions minus
* the volume header, sector forwarding, and entire volume partitions.
*/
#define BSD43_NUPART (NPARTAB - 3)
#endif
#define BSD43_DISKTAB "/etc/disktab"
struct bsd43_(disktab) {
char *d_name; /* drive name */
char *d_type; /* drive type */
int d_secsize; /* sector size in bytes */
int d_ntracks; /* # tracks/cylinder */
int d_nsectors; /* # sectors/track */
int d_ncylinders; /* # cylinders */
int d_rpm; /* revolutions/minute */
Printed 11/19/92 Page 1
GETDISKBYNAME(3-BSD)RISC/os Reference Manual GETDISKBYNAME(3-BSD)
int d_badsectforw; /* supports DEC bad144 std */
int d_sectoffset; /* use sect rather than cyl offsets */
struct bsd43_(partition) {
int p_size; /* #sectors in partition */
short p_bsize; /* block size in bytes */
short p_fsize; /* frag size in bytes */
} d_partitions[8];
};
struct bsd43_(disktab) *bsd43_(getdiskbyname)();
/*----- NUMIPS: STRIP MACRO PREFIXES (BEGIN) ---------------------------------*/
/*
* Strip off "BSD43_" and "bsd43_" for use with standard BSD code.
* (GENERATED AUTOMATICALLY -- DON'T EDIT BY HAND)
*/
#ifdef SYSTYPE_BSD43
# define DISKTAB BSD43_DISKTAB
# define NUPART BSD43_NUPART
#endif SYSTYPE_BSD43
/*----- NUMIPS: STRIP MACRO PREFIXES (END) -----------------------------------*/
SEE ALSO
disktab(5)
ERRORS
This information should be obtained from the system for
locally available disks (in particular, the disk partition
tables).
Page 2 Printed 11/19/92