The IOCTL is used to query the maximum number and size of User Data Segments (UDS) that are supported from tape drive and driver for the wanted uds_type.
The application calls this IOCTL before the STIOC_GENERATE_RAO and STIOC_RECEIVE_RAO IOCTLs are issued. The application uses the return data to limit the number of UDS requested in the GENERATE_RAO IOCTL.
The structure that is defined for this IOCTL is
struct query_rao_info{ 
          char   uds_type;         /* [IN]   0: UDS_WITHOUT_GEOMETRY    */
                                   /*        1: UDS_WITH_GEOMETRY       */ 
          char   reserved[7]; 
        ushort max_uds_number;     /* [OUT] Max UDS number supported from drive  */ 
        ushort max_uds_size;       /* [OUT] Max single UDS size supported from   */   
                                   /*       drive in byte                        */ 
        ushort max_host_uds_number;/* [OUT] Max UDS number supported from driver */
An example of the QUERY_RAO_INFO command is
#include  <sys/IBMtape.h>
   int rc;
   struct query_rao_info stQueryRao; 

bzero( (void *) &stQueryRao, sizeof(struct query_rao_info));

stQueryRao.uds_type = uds_type;

rc = ioctl(fd, STIOC_QUERY_RAO, &stQueryRao);

  printf(“STIOC_QUERY_RAO fails with rc:   %d\n”, rc);
      max_host_uds_num = stQueryRao.max_host_uds_number;
      max_uds_size = stQueryRao.max_uds_size;
return rc;