STIOCDM

This IOCTL command shows and manipulates one or two messages on the message display. The message that is sent with this call does not always remain on the display. It depends on the current state of the tape device. Refer to the IBM® 3590 manuals for a description of the message display functions.

The input data structure is
#define MAXMSGLEN 8
struct stdm_s
{
   char dm_function;                /* function code */
   /* function selection */
   #define DMSTATUSMSG 	0x00       /* general status message */
   #define DMDVMSG	0x20            /* demount verify message */
   #deinfe DMMIMMED	0x40            /* mount with immediate action indicator */
   #define DMDEMIMMED	0xE0         /* demount/mount with immediate action */
   /* message control */
   #define DMMSG0		0x00            /* display message 0 */
   #define DMMSG1 	0x04            /* display message 1 */
   #define DMFLASHMSG0	0x08         /* flash message 0 */
   #define DMFLASHMSG1	0x0C         /* flash message 1 */
   #define DMALTERNATE	0x10         /* alternate message 0 and message 1 */
   char dm_msg0[MAXMSGLEN];         /* message 0 */
   char dm_msg1[MAXMSGLEN];         /* message 1 */
};
An example of the STIOCDM command is
#include <sys/IBM_tape.h>
struct stdm_s stdm;
memset(&stdm, 0, sizeof(struct stdm_s));
stdm.dm_func = DMSTATUSMSG|DMMSG0;
bcopy("SSG", stdm.dm_msg0, 8);
if(ioctl(tapefd, STIOCDM, &stdm)<0)
{
  printf("IOCTL failure, errno = %d", errno);
  exit(errno);
}