| Skip Navigation Links | |
| Exit Print View | |
|
Sun QFS and Sun Storage Archive Manager 5.3 Reference Manual Sun QFS and Sun Storage Archive Manager 5.3 Information Library |
1. User Commands (Man Pages Section 1)
2. Maintenance Commands (Man Pages Section 1M)
3. Library Functions (Man Pages Section 3)
4. Library Functions (Man Pages Section 3X)
5. File Formats (Man Pages Section 4)
NAME
sam_set_state - Sets the new state for a removable media
device
SYNOPSIS
cc [ flag ... ] file ... -L/opt/SUNWsamfs/lib -lsamapi [library ... ]
#include "/opt/SUNWsamfs/include/devstat.h"
#include "/opt/SUNWsamfs/include/samapi.h"
int sam_set_state(ushort_t eq_number, dstate_t new_state,
int wait_response);
DESCRIPTION
sam_set_state() sets the device at equipment number
eq_number to the specified state enumeration value. The set
of values are:
typedef enum dstate{
DEV_ON, /* Normal operations */
DEV_RO, /* Read only operations */
DEV_IDLE, /* No new opens allowed */
DEV_UNAVAIL, /* Unavaiable for file system */
DEV_OFF, /* Off to this machine */
DEV_DOWN /* Maintenance use only */
}dstate_t;
Depending on the current state, only certain new states can
be set:
Current State Possible Next State
DEV_ON DEV_IDLE, DEV_OFF
DEV_IDLE Automatically goes to OFF when IDLE
DEV_OFF DEV_DOWN, DEV_ON
DEV_DOWN DEV_OFF
The call will return immediately after issuing the command
if zero is specified for wait_response value. Other values
for wait_response will give undefined results.
RETURN VALUES
Upon succesful completion a value of 0 is returned. Other-
wise, a value of -1 is returned and errno is set to indicate
the error.
ERRORS
sam_set_state() fails if one or more of the following are
true:
ER_DEVICE_DOWN_NEW_STATE
If a device state is down, the new state
for the specified eq_number device must
be off.
ER_DEVICE_USE_BY_ANOTHER
The specified eq_number device is in use
by another process.
ER_FIFO_PATH_LENGTH The path and filename for the FIFO pipe
is too long.
ER_NO_EQUIP_ORDINAL eq_number is not a defined equipment
number in this configuration.
ER_INVALID_STATE_SPECIFIED
Specified state is not a valid value.
ER_NO_MASTER_SHM No Sun QFS or SAM-QFS master shared
memory segment defined. Check that the
Sun QFS or SAM-QFS file systems are
mounted.
ER_NO_MASTER_SHM_ATT
No Sun QFS or SAM-QFS master shared
memory segment found. Check that the
Sun QFS or SAM-QFS file systems are
mounted.
ER_NO_RESPONSE_FIFO Unable to create the response FIFO pipe.
ER_NOT_REMOV_MEDIA_DEVICE
The device with equipment number
eq_number is not a removable media dev-
ice.
ER_OPERATOR_NOT_PRIV
Operator does not have permission to set
the state for devices.
FILES
mcf The configuration file for Sun QFS and
SAM-QFS file systems.
SEE ALSO
samu(1M).