HP-UX Reference (11i v1 05/09) - 7 Device (Special) Files, 9 General Information, Index (vol 10)

f
floppy(7) floppy(7)
The FLOPPY_GET_GEOMETRY
ioctl can be used to determine the flexible disk device’s current media
geometry. Current geometry parameters are indicated in the fields of the resultant
floppy_geometry
structure.
The FLOPPY_SET_GEOMETRY
ioctl can be used to specify the desired media geometry. Exclusive access
to the device, obtained through use of the
DIOC_EXCLUSIVE ioctl (see disk(7)), is required prior to set-
ting the media geometry. Exclusive access is necessary to ensure that other applications are not affected.
The Series 800 does not support this ioctl.
The
FLOPPY_FORMAT_TRACK
ioctl can be used to reformat a media track. Exclusive access to the dev-
ice, obtained through use of the
DIOC_EXCLUSIVE
ioctl (see disk(7)), is required prior to reformatting to
ensure that other applications are not affected. The Series 800 does not support this ioctl.
Flexible disk devices support the generic disk ioctls (see disk(7)), typically used for hard disk devices. Flex-
ible disk device drivers may also support driver specific ioctls (see the appropriate driver manual section).
The header file <
sys/floppy.h > has useful information for flexible-media device control. The following
is included from <sys/floppy.h >:
/* ioctls for flexible (floppy) disk devices */
#define FLOPPY_GET_INFO _IOR(’F’, 1, struct floppy_info)
#define FLOPPY_GET_GEOMETRY _IOR(’F’, 2, struct floppy_geom)
#define FLOPPY_SET_GEOMETRY _IOW(’F’, 3, struct floppy_geom)
#define FLOPPY_FORMAT_TRACK _IOW(’F’, 4, struct floppy_format)
/* structure for FLOPPY_GET_INFO ioctl */
struct floppy_info {
unsigned media;
unsigned status;
unsigned valid;
};
/* structure for FLOPPY_GET_GEOMETRY and FLOPPY_SET_GEOMETRY ioctls */
struct floppy_geometry {
unsigned heads;
unsigned tracks;
unsigned sectors;
unsigned sector_size;
unsigned transfer_rate;
unsigned track_density;
unsigned data_encoding;
};
/* structure for FLOPPY_FORMAT_TRACK ioctl */
struct floppy_format {
unsigned head;
unsigned track;
unsigned interleave;
};
ERRORS
The following errors can be returned by a flexible-disk device-driver call:
[EACCES] Required permission is denied for the the device or operation.
[EINVAL] From an open() call: the device is not a floppy device. For other calls: Invalid request or
parameter.
[EIO] I/O error (e.g., media defect or device communication problem).
[ENXIO] If resulting from an open call, this indicates there is no device at the specified address. For
other calls, this indicates the specified address is out of range or the device can no longer be
accessed.
WARNING
Media removal and/or replacement while the device is open is not supported. A floppy disk containing a
mounted file system should not be removed prior to being unmounted. Removal of floppy disks containing
mounted file systems is likely to result in file system errors, and system panics.
Section 730 Hewlett-Packard Company 3 HP-UX 11i Version 1: September 2005