correct description of syntax (4.3BSD-tahoe/man/4, Guy Harris)
[unix-history] / usr / src / usr.sbin / rmt / rmt.8
.\" Copyright (c) 1983 The Regents of the University of California.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms are permitted
.\" provided that the above copyright notice and this paragraph are
.\" duplicated in all such forms and that any documentation,
.\" advertising materials, and other materials related to such
.\" distribution and use acknowledge that the software was developed
.\" by the University of California, Berkeley. The name of the
.\" University may not be used to endorse or promote products derived
.\" from this software without specific prior written permission.
.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
.\" WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
.\"
.\" @(#)rmt.8 6.3 (Berkeley) %G%
.\"
.TH RMT 8 ""
.UC 5
.SH NAME
rmt \- remote magtape protocol module
.SH SYNOPSIS
.B /etc/rmt
.SH DESCRIPTION
.I Rmt
is a program used by the remote dump and restore programs
in manipulating a magnetic tape drive through an interprocess
communication connection.
.I Rmt
is normally started up with an
.IR rexec (3X)
or
.IR rcmd (3X)
call.
.PP
The
.I rmt
program accepts requests specific to the manipulation of
magnetic tapes, performs the commands, then responds with
a status indication. All responses are in ASCII and in
one of two forms.
Successful commands have responses of
.IP
.BI A number \en
.PP
where
.I number
is an ASCII representation of a decimal number.
Unsuccessful commands are responded to with
.PP
.IP
.BI E error-number \en error-message \en
.PP
where
.I error-number
is one of the possible error
numbers described in
.IR intro (2)
and
.I error-message
is the corresponding error string as printed
from a call to
.IR perror (3).
The protocol is comprised of the
following commands, which are sent as indicated - no spaces are supplied
between the command and its arguments, or between its arguments, and
.B \en
indicates that a newline should be supplied:
.TP 15
.BI O device \en mode \en
Open the specified
.I device
using the indicated
.IR mode .
.I Device
is a full pathname and
.I mode
is an ASCII representation of a decimal
number suitable for passing to
.IR open (2).
If a device had already been opened, it is
closed before a new open is performed.
.TP 15
.BI C device \en
Close the currently open device. The
.I device
specified is ignored.
.TP 15
.BI L whence \en offset \en
Perform an
.IR lseek (2)
operation using the specified parameters.
The response value is that returned from the
.I lseek
call.
.TP 15
.BI W count \en
Write data onto the open device.
.I Rmt
reads
.I count
bytes from the connection, aborting if
a premature end-of-file is encountered.
The response value is that returned from
the
.IR write (2)
call.
.TP 15
.BI R count \en
Read
.I count
bytes of data from the open device.
If
.I count
exceeds the size of the data buffer (10 kilobytes), it is
truncated to the data buffer size.
.I Rmt
then performs the requested
.IR read (2)
and responds with
.BI A count-read \en
if the read was
successful; otherwise an error in the
standard format is returned. If the read
was successful, the data read is then sent.
.TP 15
.BI I operation \en count \en
Perform a MTIOCOP
.IR ioctl (2)
command using the specified parameters.
The parameters are interpreted as the
ASCII representations of the decimal values
to place in the
.I mt_op
and
.I mt_count
fields of the structure used in the
.I ioctl
call. The return value is the
.I count
parameter when the operation is successful.
.TP 15
.B S
Return the status of the open device, as
obtained with a MTIOCGET
.I ioctl
call. If the operation was successful,
an ``ack'' is sent with the size of the
status buffer, then the status buffer is
sent (in binary).
.PP
Any other command causes
.I rmt
to exit.
.SH DIAGNOSTICS
All responses are of the form described above.
.SH "SEE ALSO"
rcmd(3), rexec(3), mtio(4), rdump(8), rrestore(8)
.SH BUGS
People tempted to use this for a remote file access protocol
are discouraged.