STIOC_WRITE_ATTRIBUTE
The IOCTL sets the attributes in medium auxiliary memory at a specific partition.
Following is the structure for STIOC_WRITE_ATTRIBURE IOCTL
struct write_attribute
{
uchar write_cache; /* [IN] WTC - Write-through cache */
uchar partition_number; /* [IN] the partition which the attribute is belonged to */
uint parm_list_len; /* [IN] parameter list length */
uchar reserved[10];
char data[MAX_ATTR_LEN]; /* [IN] write attributes data */
} ;
An example of the STIOC_WRITE_ATTRIBUTE command
is
#include <sys/Atape.h>
int rc;
struct write_attribute wr_attr;
memset(&wr_attr,0,sizeof(struct write_attribute));
wr_attr.write_cache=0;
wr_attr.parm_list_len=0x11;
wr_attr.data[3]=0x0D;
wr_attr.data[4]=0x08;
wr_attr.data[6]=0x01;
wr_attr.data[8]=0x08;
wr_attr.data[9]='I';
wr_attr.data[10]='B';
wr_attr.data[11]='M';
wr_attr.data[12]=' ';
wr_attr.data[13]='T';
wr_attr.data[14]='E';
wr_attr.data[15]='S';
wr_attr.data[16]='T';
printf("Issuing a sample Write Attribute command ....\n\n");
rc=ioctl(fd, STIOC_WRITE_ATTRIBUTE, &wr_attr);
if (rc)
printf ("Write Attribute failed (rc %d)",rc);
else
printf ("Write Attribute Succeeds");