User Guide

5-40 Ampex 1308911-02
Model No.
Running Head
dst_getstate libdd2 API Functions
5.11 dst_getstate
NAME
dst_getstate() - get tape drive current state.
SYNOPSIS
#include <dd2.h>
int dst_getstate(int fd, dst_state_st *state);
DESCRIPTION
dst_getstate is a limited version of dst_status that lets you quickly determine whether a tape
is installed and ready for I/O operations. It is available to all users.
PARAMETERS
fd The file descriptor returned by the open call.
*state Pointer to a structure of type
dst_state_st.
USAGE
dst_getstate() reports the drive state in the *state structure.
typedef struct dst_state
{
u_int state; /* Current state of drive */
} dst_state_st;
STRUCTURE MEMBERS
state Bit-mask of the current drive state. The following definitions apply
(definitions in parenthesis are old descriptors that have been retained for
compatibility with existing applications):
DST_READY (DST_IS_READY)
DST_PRESENT (DST_CASS_PRESENT)
DST_LOADED (DST_IS_LOADED)
DST_WR_PROTECT (DST_WR_PROTECTED)
DST_PRESENT or DST_CASS_PRESENT is set when a tape is present
in the drive; however, this doesn’t mean that the drive is ready for user
interaction.