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