HP-UX Reference (11i v1 00/12) - 5 Miscellaneous Topics, 7 Device (Special) Files, 9 General Information, Index (vol 9)
__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man7/!!!intro.7
________________________________________________________________
___ ___
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.
[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.
[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).
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 7−−30 − 3 − HP-UX Release 11i: December 2000
___
___