rmtops - remote tape drive access routines
int rmtaccess(char *path, int amode);
int rmtclose(int fildes);
int rmtcreat(char *path, int mode);
int rmtfstat(int fildes, struct stat *buf);
int rmtioctl(int fildes, int request, int arg);
int rmtopen(char *path, int oflag, int mode);
int rmtread(int fildes, char *buf, unsigned int nbyte);
int rmtwrite(int fildes, char *buf, unsigned int nbyte);
Rmtops provides a simple means of transparently accessing tape drives on
remote machines over a network, via rsh(1) and rmt(1M). This version of
the library expects the remote rmt program to be version 2, which is
fairly widespread. These routines are used like their corresponding
system calls, but allow the user to open up a tape drive on a remote
system on which he or she has an account and the appropriate remote
permissions. rmtaccess() always returns 0 in the remote case, since the
protocol doesn't support this concept, deferring access errors until the
rmtopen or rmtcreat.
A remote tape drive file name has the form
where system is the remote system, /dev/??? is the particular drive on
the remote system (raw, blocked, rewinding, non-rewinding, etc.), and the
optional user is the login name to be used on the remote system, if
different from the current user's login name. This corresponds to the
remote syntax used by rcp(1). Note that the remote device must in fact
be a device, and must reside below /dev on the remote system.
The routines differentiate between local and remote file descriptors by
adding a bias to the file descriptor of the pipe. The programmer, if he
must know if a file is remote, should use the isrmt function. Up to 4
remote devices may be in simultaneous use by one program at the same
Contains the remote tape library. To include the library with a
program, add the flag -lrmt to the cc(1) command line.
rcp(1), rsh(1), rmt(2), and the appropriate system calls in section 2.
Several of these routines will return -1 and set errno to EOPNOTSUPP, if
they are given a remote file name or a file descriptor on an open remote
file (e.g., rmtdup).
See diagnostics above. It is to be hoped that true remote file systems
will eventually appear, and eliminate the need for these routines.
There is no way to use remote tape drives with the stdio(3) package with
the current implementation.
The rmt(1m) protocol is not very capable. In particular, it relies on
TCP/IP sockets for error free transmission, and does no data validation
of its own.
The rmt program allows no more than 10K bytes to be transferred at one
time. The rmtread and rmtwrite routines will transfer data in multiple
chunks if necessary to meet this requirement, and the rmt program on the
remote will reassemble the data and pass it via the read and write system
calls as a single system call.
This set of routines is passed on a package posted to the Usenet group
comp.sources.unix, circa 1989. Further changes, particularly to the
rmtioctl code, were made at Silicon Graphics.
Jeff Lee (gatech!jeff) wrote the original routines for accessing tape
drives via rmt(1m).
Fred Fish (unisoft!fnf) redid them into a general purpose library.
Arnold Robbins (gatech!arnold) added the ability to specify a user name
on the remote system, this man page, and cleaned up the library a little.
PPPPaaaaggggeeee 2222 [ Back ]