BSD 4_3 release
[unix-history] / usr / man / man8 / rmt.8c
CommitLineData
e0d7ce0e
KM
1.\" Copyright (c) 1983 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
95f51977 5.\" @(#)rmt.8c 6.1 (Berkeley) 4/27/85
e0d7ce0e 6.\"
95f51977 7.TH RMT 8C "April 27, 1985"
e0d7ce0e
KM
8.UC 5
9.SH NAME
10rmt \- remote magtape protocol module
11.SH SYNOPSIS
12.B /etc/rmt
13.SH DESCRIPTION
14.I Rmt
15is a program used by the remote dump and restore programs
16in manipulating a magnetic tape drive through an interprocess
17communication connection.
18.I Rmt
19is normally started up with an
20.IR rexec (3X)
21or
22.IR rcmd (3X)
23call.
24.PP
25The
26.I rmt
27program accepts requests specific to the manipulation of
28magnetic tapes, performs the commands, then responds with
29a status indication. All responses are in ASCII and in
30one of two forms.
31Successful commands have responses of
32.PP
33.ti +0.5i
34\fBA\fInumber\fR\en
35.PP
36where
37.I number
38is an ASCII representation of a decimal number.
39Unsuccessful commands are responded to with
40.PP
41.ti +0.5i
42\fBE\fIerror-number\fR\en\fIerror-message\fR\en,
43.PP
44where
45.I error-number
46is one of the possible error
47numbers described in
48.IR intro (2)
49and
50.I error-message
51is the corresponding error string as printed
52from a call to
53.IR perror (3).
54The protocol is comprised of the
55following commands (a space is present between each token).
56.TP 15
57.B O device mode
58Open the specified
59.I device
60using the indicated
61.IR mode .
62.I Device
63is a full pathname and
64.I mode
65is an ASCII representation of a decimal
66number suitable for passing to
67.IR open (2).
68If a device had already been opened, it is
69closed before a new open is performed.
70.TP 15
71.B C device
72Close the currently open device. The
73.I device
74specified is ignored.
75.TP 15
76.B L whence offset
77Perform an
78.IR lseek (2)
79operation using the specified parameters.
80The response value is that returned from the
81.I lseek
82call.
83.TP 15
84.B W count
85Write data onto the open device.
86.I Rmt
87reads
88.I count
89bytes from the connection, aborting if
90a premature end-of-file is encountered.
91The response value is that returned from
92the
93.IR write (2)
94call.
95.TP 15
96.B R count
97Read
98.I count
99bytes of data from the open device.
100If
101.I count
102exceeds the size of the data buffer (10 kilobytes), it is
103truncated to the data buffer size.
104.I Rmt
105then performs the requested
106.IR read (2)
107and responds with
108\fBA\fIcount-read\fR\en if the read was
109successful; otherwise an error in the
110standard format is returned. If the read
111was successful, the data read is then sent.
112.TP 15
113.B I operation count
114Perform a MTIOCOP
115.IR ioctl (2)
116command using the specified parameters.
117The parameters are interpreted as the
118ASCII representations of the decimal values
119to place in the
120.I mt_op
121and
122.I mt_count
123fields of the structure used in the
124.I ioctl
125call. The return value is the
126.I count
127parameter when the operation is successful.
128.TP 15
129.B S
130Return the status of the open device, as
131obtained with a MTIOCGET
132.I ioctl
133call. If the operation was successful,
134an ``ack'' is sent with the size of the
135status buffer, then the status buffer is
136sent (in binary).
137.PP
138Any other command causes
139.I rmt
140to exit.
141.SH DIAGNOSTICS
142All responses are of the form described above.
143.SH "SEE ALSO"
144rcmd(3X),
145rexec(3X),
146mtio(4),
147rdump(8C),
148rrestore(8C)
149.SH BUGS
150People tempted to use this for a remote file access protocol
151are discouraged.