HP-UX Reference (11i v2 07/12) - 7 Device (Special) Files, 9 General Information, Index (vol 10)

s
scsi_disk(7) scsi_disk(7)
{
int ret;
disk_describe_type descr_type;
if ((ret = ioctl (dfd, DIOC_DESCRIBE, &descr_type)) != 0) {
exit(1);
}
printf ("\nSuccessful ioctl DIOC_DESCRIBE \n");
printf (" model number: %s\n", descr_type.model_num);
printf (" interface: %d <20=scsi>\n", descr_type.intf_type);
}
Exclusive (dfd)
int dfd;
{
int ret, flag=1;
if ((ret = ioctl (dfd, DIOC_EXCLUSIVE, &flag)) != 0) {
exit(1);
}
}
Enable_WOE (dfd)
int dfd;
{
int ret, flag=1;
if ((ret = ioctl (dfd, SIOC_WRITE_WOE, &flag)) != 0) {
exit(1);
}
printf ("\nSuccessful ioctl SIOC_WRITE_WOE \n");
}
main (argc, argv)
int argc;
char ** argv;
{ int ret, fd; if (argc != 2) {
printf ("Usage: %s <disk3_device> \n", argv[0]);
exit(1);
}
if ((fd = open (argv[1], O_RDWR)) < 0) {
exit (1);
}
Describe (fd);
Exclusive (fd);
Enable_WOE (fd);
}
WARNINGS
Historically, disk devices have had small (typically 512 byte) block sizes; however, many newer disk devices
(such as optical disks and disk arrays) have relatively large block sizes. Applications using direct raw disk
access should use the DIOC_DESCRIBE, DIOC_CAPACITY,or
SIOC_CAPACITY ioctl to determine the
appropriate minimum I/O size.
Media removal and insertion while a disk device is open is unsupported and unpredictable. Do not attempt
to circumvent prevention of media removal. Device capacity changes resulting from such intervention may
not be recognized.
Often larger I/O operation sizes are expected to be more efficient. However, SCSI disk I/O operations that
are large relative to the device’s cache can result in insufficient cache space for the device to maintain full-
media-speed data transfer rates. This can result in decreased I/O performance relative to smaller I/O sizes.
DEPENDENCIES
Optical Disk Devices
The
SIOC_VERIFY_WRITES ioctl controls the write mode. Normally written data is assumed to be
correctly stored on the media. Verify-writes mode causes verification of written data to ensure that data
has been correctly written. Verification can substantially reduce write performance and is not generally
needed. The SIOC_VERIFY_WRITES ioctl can be used to enable or disable write verification. A zero
value disables write verification. The value 1 enables write verification. Although write verification is
HP-UX 11i Version 2: December 2007 Update 2 Hewlett-Packard Company 159