BSD 4_3_Net_2 release
[unix-history] / usr / src / usr.sbin / rmt / rmt.8
CommitLineData
b42074ab 1.\" Copyright (c) 1983, 1991 The Regents of the University of California.
1ecd0cc4 2.\" All rights reserved.
e0d7ce0e 3.\"
af359dea
C
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\" notice, this list of conditions and the following disclaimer in the
11.\" documentation and/or other materials provided with the distribution.
12.\" 3. All advertising materials mentioning features or use of this software
13.\" must display the following acknowledgement:
14.\" This product includes software developed by the University of
15.\" California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\" may be used to endorse or promote products derived from this software
18.\" without specific prior written permission.
e0d7ce0e 19.\"
af359dea
C
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
1ecd0cc4 31.\"
af359dea
C
32.\" @(#)rmt.8 6.5 (Berkeley) 3/16/91
33.\"
34.Dd March 16, 1991
b42074ab
CL
35.Dt RMT 8
36.Os BSD 4.2
37.Sh NAME
38.Nm rmt
39.Nd remote magtape protocol module
40.Sh SYNOPSIS
41.Nm rmt
42.Sh DESCRIPTION
43.Nm Rmt
e0d7ce0e
KM
44is a program used by the remote dump and restore programs
45in manipulating a magnetic tape drive through an interprocess
46communication connection.
b42074ab 47.Nm Rmt
e0d7ce0e 48is normally started up with an
b42074ab 49.Xr rexec 3
e0d7ce0e 50or
b42074ab 51.Xr rcmd 3
e0d7ce0e 52call.
b42074ab 53.Pp
e0d7ce0e 54The
b42074ab 55.Nm rmt
e0d7ce0e
KM
56program accepts requests specific to the manipulation of
57magnetic tapes, performs the commands, then responds with
b42074ab
CL
58a status indication. All responses are in
59.Tn ASCII
60and in
e0d7ce0e 61one of two forms.
b42074ab
CL
62Successful commands have responses of:
63.Bd -filled -offset indent
64.Sm off
65.Sy A Ar number No \en
66.Sm on
67.Ed
68.Pp
69.Ar Number
70is an
71.Tn ASCII
72representation of a decimal number.
73Unsuccessful commands are responded to with:
74.Bd -filled -offset indent
75.Sm off
76.Xo Sy E Ar error-number
77.No \en Ar error-message
78.No \en
79.Xc
80.Sm on
81.Ed
82.Pp
83.Ar Error-number
e0d7ce0e
KM
84is one of the possible error
85numbers described in
b42074ab 86.Xr intro 2
e0d7ce0e 87and
b42074ab 88.Ar error-message
e0d7ce0e
KM
89is the corresponding error string as printed
90from a call to
b42074ab 91.Xr perror 3 .
e0d7ce0e 92The protocol is comprised of the
b4b1244b
KM
93following commands, which are sent as indicated - no spaces are supplied
94between the command and its arguments, or between its arguments, and
b42074ab 95.Ql \en
b4b1244b 96indicates that a newline should be supplied:
b42074ab
CL
97.Bl -tag -width Ds
98.Sm off
99.It Xo Sy \&O Ar device
100.No \en Ar mode No \en
101.Xc
e0d7ce0e 102Open the specified
b42074ab 103.Ar device
e0d7ce0e 104using the indicated
b42074ab
CL
105.Ar mode .
106.Ar Device
e0d7ce0e 107is a full pathname and
b42074ab
CL
108.Ar mode
109is an
110.Tn ASCII
111representation of a decimal
e0d7ce0e 112number suitable for passing to
b42074ab 113.Xr open 2 .
e0d7ce0e
KM
114If a device had already been opened, it is
115closed before a new open is performed.
b42074ab
CL
116.It Xo Sy C Ar device No \en
117.Xc
e0d7ce0e 118Close the currently open device. The
b42074ab 119.Ar device
e0d7ce0e 120specified is ignored.
b42074ab
CL
121.It Xo Sy L
122.Ar whence No \en
123.Ar offset No \en
124.Xc
125.Sm on
e0d7ce0e 126Perform an
b42074ab 127.Xr lseek 2
e0d7ce0e
KM
128operation using the specified parameters.
129The response value is that returned from the
b42074ab 130.Xr lseek
e0d7ce0e 131call.
b42074ab
CL
132.Sm off
133.It Sy W Ar count No \en
134.Sm on
e0d7ce0e 135Write data onto the open device.
b42074ab 136.Nm Rmt
e0d7ce0e 137reads
b42074ab 138.Ar count
e0d7ce0e
KM
139bytes from the connection, aborting if
140a premature end-of-file is encountered.
141The response value is that returned from
142the
b42074ab 143.Xr write 2
e0d7ce0e 144call.
b42074ab
CL
145.Sm off
146.It Sy R Ar count No \en
147.Sm on
e0d7ce0e 148Read
b42074ab 149.Ar count
e0d7ce0e
KM
150bytes of data from the open device.
151If
b42074ab 152.Ar count
e0d7ce0e
KM
153exceeds the size of the data buffer (10 kilobytes), it is
154truncated to the data buffer size.
b42074ab 155.Nm rmt
e0d7ce0e 156then performs the requested
b42074ab 157.Xr read 2
e0d7ce0e 158and responds with
b42074ab
CL
159.Sm off
160.Sy A Ar count-read No \en
161.Sm on
b4b1244b 162if the read was
e0d7ce0e
KM
163successful; otherwise an error in the
164standard format is returned. If the read
165was successful, the data read is then sent.
b42074ab
CL
166.Sm off
167.It Xo Sy I Ar operation
168.No \en Ar count No \en
169.Xc
170.Sm on
171Perform a
172.Dv MTIOCOP
173.Xr ioctl 2
e0d7ce0e
KM
174command using the specified parameters.
175The parameters are interpreted as the
b42074ab
CL
176.Tn ASCII
177representations of the decimal values
e0d7ce0e 178to place in the
b42074ab 179.Ar mt_op
e0d7ce0e 180and
b42074ab 181.Ar mt_count
e0d7ce0e 182fields of the structure used in the
b42074ab 183.Xr ioctl
e0d7ce0e 184call. The return value is the
b42074ab 185.Ar count
e0d7ce0e 186parameter when the operation is successful.
b42074ab 187.It Sy S
e0d7ce0e 188Return the status of the open device, as
b42074ab
CL
189obtained with a
190.Dv MTIOCGET
191.Xr ioctl
e0d7ce0e
KM
192call. If the operation was successful,
193an ``ack'' is sent with the size of the
194status buffer, then the status buffer is
195sent (in binary).
b42074ab
CL
196.El
197.Sm on
198.Pp
e0d7ce0e 199Any other command causes
b42074ab 200.Nm rmt
e0d7ce0e 201to exit.
b42074ab 202.Sh DIAGNOSTICS
e0d7ce0e 203All responses are of the form described above.
b42074ab
CL
204.Sh SEE ALSO
205.Xr rcmd 3 ,
206.Xr rexec 3 ,
207.Xr mtio 4 ,
208.Xr rdump 8 ,
209.Xr rrestore 8
210.Sh BUGS
e0d7ce0e
KM
211People tempted to use this for a remote file access protocol
212are discouraged.
b42074ab
CL
213.Sh HISTORY
214The
215.Nm
216command appeared in
217.Bx 4.2 .