HP-UX Reference (11i v2 04/09) - 7 Device (Special) Files, 9 General Information, Index (vol 10)
f
floppy(7) floppy(7)
FLOPPY_HIGH_DENSITY(
x) /* Media has high density indication */
The argument
x in the above macros refers to the
status or valid fields of the
FLOPPY_GET_INFO
ioctl. Some floppy devices or floppy device drivers may be unable to determine
some status information. The
valid field indicates whether or not the corresponding status information
is meaningful. Applying a macro to the valid
field indicates whether or not the application of that
same macro to the
status field results in a valid device status.
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 Servers 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 Servers does not support this ioctl.
Flexible disk devices support the generic disk ioctls (see disk(7)), typically used for hard disk devices.
Flexible disk device drivers may also support driver specific ioctls (see the appropriate driver manual sec-
tion).
The header file
<sys/floppy.h>
has useful information for flexible-media device control. The follow-
ing 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.
[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.
Section 7−−30 Hewlett-Packard Company − 3 − HP-UX 11i Version 2: September 2004