STIOC_LOCATE
This IOCTL command causes the tape to be positioned at the specified block ID. The block ID used for the command must be obtained by using the STIOC_READ_POSITION command.
An example of the STIOC_LOCATE command is
#include <sys/IBM_tape.h>
unsigned int current_blockid;
/* read current tape position */
if (ioctl(tapefd,STIOC_READ_POSITION,¤t_blockid)) {
printf("ioctl failure. errno=%d\n",errno);
exit(1);
}
/* restore current tape position */
if (ioctl(tapefd,STIOC_LOCATE,current_blockid)) {
printf("ioctl failure. errno=%d\n",errno);
exit(1);
}