The extended open operation

An extended open operation is also supported on the device. This operation allows special types of processing during the opening and subsequent closing of the tape device. The Extended Open command is

The O_FLAGS parameter provides the same options that are described in Opening the special file for I/O. The third parameter is always NULL. The E_FLAGS parameter provides the extended options. The E_FLAGS values can be combined during an open operation or they can be used with an OR operation.

The E_FLAGS parameter has the following flags.

    This flag prevents the SCSI Release command from being sent during a close operation.


    The flag forces the release of any current reservation on the device by an initiator. The reservation can either be a SCSI Reserve or SCSI Persistent Reserve.


    This flag kills all currently open processes and then exits the open with errno EINPROGRESS returned.


    This flag overrides the configuration reservation type attribute whether it was set to reserve_6 or persistent. It sets the device driver to use Persistent Reserve while the device is open until closed. The configuration reservation type attribute is not changed and the next open without using this flag uses the configuration reservation type. The device driver also registers the host reservation key on the device. This flag can be used with the other extended flags.


    The device is opened in diagnostic mode, and no SCSI commands are sent to the device during an open operation or a close operation. All operations (such as reserve and mode select) must be processed by the application.


    This flag prevents the SCSI Reserve command from being sent during an open operation.


    No SCSI commands are sent to the device during an open operation or a close operation. All operations (such as reserve the device, release the device, and set the tape parameters) must be processed explicitly by the application. This flag is the same as the SC_DIAGNOSTIC flag. The exception is that a SCSI Test Unit Unit Ready command is issued to the device during an open operation to clear any unit attentions.

  • SC_FEL

    This flag turns on the forced error logging in the tape device for read and write operations.


    This flag turns off the AIX® error logging for all read, write, or IOCTL operations.


    This flag allows up to eight processes to concurrently open a device when the device is already open by another process. There is no restriction for medium changer IOCTL commands that can be issued when this flag is used. However, for tape devices only a limited set of IOCTL commands can be issued. If an IOCTL command cannot be used with this flag, then errno EINVAL is returned.

    If another process already has the device open with this flag, the open fails, and the errno is set to EAGAIN.

If the open system call fails, the errno value contains the error code. See Return codes for a description of the errno values.