SYNOPSIS

       cc [ flag ... ] file ...  -lrmt -lsocket -lnsl [ library ... ]

       #include <librmt.h>
       #include <rmtio.h>

       int rmtstatus(int remfd, struct mtget *mtp);

       int rmtxstatus(int remfd, struct rmtget *mtp);

       void _rmtg2mtg(struct mtget *mtp, struct rmtget *rmtp);

       int _mtg2rmtg(struct rmtget *rmtp, struct mtget *mtp);


DESCRIPTION

       rmtstatus() and rmtxstatus()
              perform a MTIOCGET request to the remote server, remfd is a file
              descriptor  previously  obtained  from  a  call to rmtgetconn(),
              struct mtget is the local magnetic tape status structure, struct
              rmtget  is  the  enhanced  magnetic  tape  status structure from
              librmt.  rmtstatus() and rmtxstatus() will fail if there was  no
              previous  successful rmtopen() before.  rmtstatus() and rmtxsta-
              tus() take care of using RMT protocol VERSION 1  if  the  remote
              side  implements  support  for protocol version 1.  The function
              rmtstatus() is outdated and should be avoided as the results  in
              struct  mtget  will be the least common denominator of the local
              and remote variants of the structure.  Use rmtxstatus() instead.
              The  member  mt_xflags  in  struct rmtget contains a bitmap that
              indicates which members of the structure contain  valid  values.
              See mtio(7) for more information.

       _rmtg2mtg()
              converts a struct rmtget into a struct mtget.

       _mtg2rmtg()
              converts a struct mtget into a struct rmtget and sets the member
              mt_xflags in struct rmtget to contain a  bitmap  that  indicates
              which members of struct mtget are present in the local implemen-
              tation.


RETURNS

       rmtstatus() and rmtxstatus()
              return a value >= 0 if  the  remote  ioctl(f,  MTIOCGET,  struct
              mtget *) succeeds.



ERRORS

       rmtstatus()  and  rmtxstatus()  return -1 on error and set errno to the
       errno value retrieved from the remote server.

       _mtg2rmtg()
                 comerrno(EX_BAD, "Cannot get connection to '%s'.\n",
                      /* errno not valid !! */      host);
       }

       if (rmtopen(remfd, remfn, mode) < 0)
            comerr("Cannot open '%s'.\n", remfn);

       if (rmtxstatus(remfd, &rmtg) < 0)
            comerr("Cannot retrieve magnetic tape status fom '%s'.\n", remfn);

       rmtclose(remfd);



ENVIRONMENT


SEE ALSO

       rmt(1),  rsh(1),  ssh(1),  rcmd(3),  rmtinit(3),  rmtdebug(3), rmthost-
       name(3), rmtfilename(3), rmtgetconn(3), rmtopen(3),  rmtioctl(3),  rmt-
       close(3),  rmtread(3),  rmtwrite(3), rmtseek(3), rmtxstatus(3), rmtsta-
       tus(3), _mtg2rmtg(3), _rmtg2mtg(3), errmsgno(3), mtio(7)



DIAGNOSTICS


NOTES


BUGS

       If local and remote errno values do not match, programs  may  get  con-
       fused.


AUTHOR

       Joerg Schilling
       Seestr. 110
       D-13353 Berlin
       Germany

       Mail bugs and suggestions to:

       schilling@fokus.fhg.de or js@cs.tu-berlin.de



Joerg Schilling                    02/11/11                      RMTSTATUS(3L)

Man(1) output converted with man2html