new copyright notice
[unix-history] / usr / src / usr.sbin / rmt / rmt.8
CommitLineData
1ecd0cc4
KB
1.\" Copyright (c) 1983 The Regents of the University of California.
2.\" All rights reserved.
e0d7ce0e 3.\"
1ecd0cc4
KB
4.\" Redistribution and use in source and binary forms are permitted
5.\" provided that the above copyright notice and this paragraph are
6.\" duplicated in all such forms and that any documentation,
7.\" advertising materials, and other materials related to such
8.\" distribution and use acknowledge that the software was developed
9.\" by the University of California, Berkeley. The name of the
10.\" University may not be used to endorse or promote products derived
11.\" from this software without specific prior written permission.
12.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
13.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
14.\" WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
e0d7ce0e 15.\"
b4b1244b 16.\" @(#)rmt.8 6.3 (Berkeley) %G%
1ecd0cc4
KB
17.\"
18.TH RMT 8 ""
e0d7ce0e
KM
19.UC 5
20.SH NAME
21rmt \- remote magtape protocol module
22.SH SYNOPSIS
23.B /etc/rmt
24.SH DESCRIPTION
25.I Rmt
26is a program used by the remote dump and restore programs
27in manipulating a magnetic tape drive through an interprocess
28communication connection.
29.I Rmt
30is normally started up with an
31.IR rexec (3X)
32or
33.IR rcmd (3X)
34call.
35.PP
36The
37.I rmt
38program accepts requests specific to the manipulation of
39magnetic tapes, performs the commands, then responds with
40a status indication. All responses are in ASCII and in
41one of two forms.
42Successful commands have responses of
b4b1244b
KM
43.IP
44.BI A number \en
e0d7ce0e
KM
45.PP
46where
47.I number
48is an ASCII representation of a decimal number.
49Unsuccessful commands are responded to with
50.PP
b4b1244b
KM
51.IP
52.BI E error-number \en error-message \en
e0d7ce0e
KM
53.PP
54where
55.I error-number
56is one of the possible error
57numbers described in
58.IR intro (2)
59and
60.I error-message
61is the corresponding error string as printed
62from a call to
63.IR perror (3).
64The protocol is comprised of the
b4b1244b
KM
65following commands, which are sent as indicated - no spaces are supplied
66between the command and its arguments, or between its arguments, and
67.B \en
68indicates that a newline should be supplied:
e0d7ce0e 69.TP 15
b4b1244b 70.BI O device \en mode \en
e0d7ce0e
KM
71Open the specified
72.I device
73using the indicated
74.IR mode .
75.I Device
76is a full pathname and
77.I mode
78is an ASCII representation of a decimal
79number suitable for passing to
80.IR open (2).
81If a device had already been opened, it is
82closed before a new open is performed.
83.TP 15
b4b1244b 84.BI C device \en
e0d7ce0e
KM
85Close the currently open device. The
86.I device
87specified is ignored.
88.TP 15
b4b1244b 89.BI L whence \en offset \en
e0d7ce0e
KM
90Perform an
91.IR lseek (2)
92operation using the specified parameters.
93The response value is that returned from the
94.I lseek
95call.
96.TP 15
b4b1244b 97.BI W count \en
e0d7ce0e
KM
98Write data onto the open device.
99.I Rmt
100reads
101.I count
102bytes from the connection, aborting if
103a premature end-of-file is encountered.
104The response value is that returned from
105the
106.IR write (2)
107call.
108.TP 15
b4b1244b 109.BI R count \en
e0d7ce0e
KM
110Read
111.I count
112bytes of data from the open device.
113If
114.I count
115exceeds the size of the data buffer (10 kilobytes), it is
116truncated to the data buffer size.
117.I Rmt
118then performs the requested
119.IR read (2)
120and responds with
b4b1244b
KM
121.BI A count-read \en
122if the read was
e0d7ce0e
KM
123successful; otherwise an error in the
124standard format is returned. If the read
125was successful, the data read is then sent.
126.TP 15
b4b1244b 127.BI I operation \en count \en
e0d7ce0e
KM
128Perform a MTIOCOP
129.IR ioctl (2)
130command using the specified parameters.
131The parameters are interpreted as the
132ASCII representations of the decimal values
133to place in the
134.I mt_op
135and
136.I mt_count
137fields of the structure used in the
138.I ioctl
139call. The return value is the
140.I count
141parameter when the operation is successful.
142.TP 15
143.B S
144Return the status of the open device, as
145obtained with a MTIOCGET
146.I ioctl
147call. If the operation was successful,
148an ``ack'' is sent with the size of the
149status buffer, then the status buffer is
150sent (in binary).
151.PP
152Any other command causes
153.I rmt
154to exit.
155.SH DIAGNOSTICS
156All responses are of the form described above.
157.SH "SEE ALSO"
1ecd0cc4 158rcmd(3), rexec(3), mtio(4), rdump(8), rrestore(8)
e0d7ce0e
KM
159.SH BUGS
160People tempted to use this for a remote file access protocol
161are discouraged.