|
NAMErmtopen, rmtclose, rmtread, rmtwrite, rmtseek, rmtioctl - operate on a connection to a remote tape serverSYNOPSIScc [ flag ... ] file ... -lrmt -lsocket -lnsl [ library ... ]#include <schily/librmt.h> #include <schily/rmtio.h> int rmtopen(int remfd, char *pathname, int fmode); int rmtclose(int remfd); int rmtread(int remfd, char *buf, int count); int rmtwrite(int remfd, char *buf, int count); int rmtseek(int remfd, off_t offset, int whence); int rmtioctl(int remfd, int cmd, int count); DESCRIPTION
RETURNS
ERRORSAll functions return -1 on error and set errno to the errno value retrieved from the remote server.EXAMPLESint remfd; char *remfn; char host[256]; int iosize = 10240; /* socket send/receive size to set up */ if ((remfn = rmtfilename(filename)) != NULL) { rmthostname(host, sizeof (host), filename); if ((remfd = rmtgetconn(host, iosize, 0)) < 0) 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 (rmtread(remfd, buf, sizeof(buf)) < 0) comerr("Read error on '%s'.\n", remfn); rmtclose(remfd); ENVIRONMENTSEE ALSOrmt(1), rsh(1), ssh(1), rcmd(3), rmtinit(3), rmtdebug(3), rmtrmt(3), rmtrsh(3), rmthostname(3), rmtfilename(3), rmtgetconn(3), rmtopen(3), rmtioctl(3), rmtclose(3), rmtread(3), rmtwrite(3), rmtseek(3), rmtxstatus(3), rmtstatus(3), _mtg2rmtg(3), _rmtg2mtg(3), errmsgno(3), mtio(7)DIAGNOSTICSNOTESWhile all other known rmt implementations limit the size of a single rmt command to 64 bytes, this implementation limits all standard command lines to 80 bytes and the file name to 4096 bytes.Note that this may cause problems if the remote rmt server implementation is directly derived from the historic BSD server code. This is true for all BSD systems, for SunOS up to 5.9 and even for the GNU rmt server. As some of the other rmt servers do not even implement bound checking, be prepared that other server implementations may dump core or at least stop honoring the rmt protocol. If you like to use long file names, make sure that you also use the schily rmt server. BUGSIf local and remote errno values do not match, programs may get confused.AUTHORlibrmt has been written in 1990 by Joerg Schilling. In 1995, support for RMT VERSION 1 has been added. librmt is still maintained by Joerg Schilling.Joerg Schilling D-13353 Berlin Germany Mail bugs and suggestions to: joerg@schily.net
Visit the GSP FreeBSD Man Page Interface. |