AIX

 View Only
  • 1.  MTIOCGET Invalid argument

    Posted Wed October 23, 2024 02:20 AM

    Hi,

    MTIOCGET doesn't work for me. The following program fails with "Invalid argument":

    struct mtget smtget;
    ...
    tape_fd = open("/dev/rmt0.1", O_RDONLY);

    if (tape_fd == -1) {
        perror("open");
        exit(1);
    }

    rc = ioctl(tape_fd, MTIOCGET, &smtget);

    if (!rc) {
        perror("ioctl");
        exit(1);
    }

    MTIOCTOP on the other hand works. However, sys/mtio.h has all the MTIOCGET stuff so what's the trick?



  • 2.  RE: MTIOCGET Invalid argument

    Posted Wed October 23, 2024 08:21 AM

    Hi Jack,

    This seems to be your exact problem:

    https://stackoverflow.com/questions/57927360/how-to-fix-invalid-argument-for-ioctl-requests-to-block-device

    Regards,

    Henrik Morsing



    ------------------------------
    Henrik Morsing
    ------------------------------



  • 3.  RE: MTIOCGET Invalid argument

    Posted Wed October 23, 2024 07:02 PM
    Edited by jack smith Wed October 23, 2024 07:02 PM

    > This seems to be your exact problem
    True, but this is Linux. AIX doesn't have the sg stuff and running MTNOP fails as well.



  • 4.  RE: MTIOCGET Invalid argument

    Posted Mon October 28, 2024 10:42 PM
    Edited by jack smith Mon October 28, 2024 10:42 PM

    So what's the "official" way of getting the current tape position with AIX?