Commit | Line | Data |
---|---|---|
98a260ad KB |
1 | .\" Copyright (c) 1983, 1991, 1993 |
2 | .\" The Regents of the University of California. All rights reserved. | |
e0d7ce0e | 3 | .\" |
8afc7c2e | 4 | .\" %sccs.include.redist.man% |
e0d7ce0e | 5 | .\" |
98a260ad | 6 | .\" @(#)rmt.8 8.1 (Berkeley) %G% |
1ecd0cc4 | 7 | .\" |
b42074ab CL |
8 | .Dd |
9 | .Dt RMT 8 | |
10 | .Os BSD 4.2 | |
11 | .Sh NAME | |
12 | .Nm rmt | |
13 | .Nd remote magtape protocol module | |
14 | .Sh SYNOPSIS | |
15 | .Nm rmt | |
16 | .Sh DESCRIPTION | |
17 | .Nm Rmt | |
e0d7ce0e KM |
18 | is a program used by the remote dump and restore programs |
19 | in manipulating a magnetic tape drive through an interprocess | |
20 | communication connection. | |
b42074ab | 21 | .Nm Rmt |
e0d7ce0e | 22 | is normally started up with an |
b42074ab | 23 | .Xr rexec 3 |
e0d7ce0e | 24 | or |
b42074ab | 25 | .Xr rcmd 3 |
e0d7ce0e | 26 | call. |
b42074ab | 27 | .Pp |
e0d7ce0e | 28 | The |
b42074ab | 29 | .Nm rmt |
e0d7ce0e KM |
30 | program accepts requests specific to the manipulation of |
31 | magnetic tapes, performs the commands, then responds with | |
b42074ab CL |
32 | a status indication. All responses are in |
33 | .Tn ASCII | |
34 | and in | |
e0d7ce0e | 35 | one of two forms. |
b42074ab CL |
36 | Successful commands have responses of: |
37 | .Bd -filled -offset indent | |
38 | .Sm off | |
39 | .Sy A Ar number No \en | |
40 | .Sm on | |
41 | .Ed | |
42 | .Pp | |
43 | .Ar Number | |
44 | is an | |
45 | .Tn ASCII | |
46 | representation of a decimal number. | |
47 | Unsuccessful commands are responded to with: | |
48 | .Bd -filled -offset indent | |
49 | .Sm off | |
50 | .Xo Sy E Ar error-number | |
51 | .No \en Ar error-message | |
52 | .No \en | |
53 | .Xc | |
54 | .Sm on | |
55 | .Ed | |
56 | .Pp | |
57 | .Ar Error-number | |
e0d7ce0e KM |
58 | is one of the possible error |
59 | numbers described in | |
b42074ab | 60 | .Xr intro 2 |
e0d7ce0e | 61 | and |
b42074ab | 62 | .Ar error-message |
e0d7ce0e KM |
63 | is the corresponding error string as printed |
64 | from a call to | |
b42074ab | 65 | .Xr perror 3 . |
e0d7ce0e | 66 | The protocol is comprised of the |
b4b1244b KM |
67 | following commands, which are sent as indicated - no spaces are supplied |
68 | between the command and its arguments, or between its arguments, and | |
b42074ab | 69 | .Ql \en |
b4b1244b | 70 | indicates that a newline should be supplied: |
b42074ab CL |
71 | .Bl -tag -width Ds |
72 | .Sm off | |
73 | .It Xo Sy \&O Ar device | |
74 | .No \en Ar mode No \en | |
75 | .Xc | |
e0d7ce0e | 76 | Open the specified |
b42074ab | 77 | .Ar device |
e0d7ce0e | 78 | using the indicated |
b42074ab CL |
79 | .Ar mode . |
80 | .Ar Device | |
e0d7ce0e | 81 | is a full pathname and |
b42074ab CL |
82 | .Ar mode |
83 | is an | |
84 | .Tn ASCII | |
85 | representation of a decimal | |
e0d7ce0e | 86 | number suitable for passing to |
b42074ab | 87 | .Xr open 2 . |
e0d7ce0e KM |
88 | If a device had already been opened, it is |
89 | closed before a new open is performed. | |
b42074ab CL |
90 | .It Xo Sy C Ar device No \en |
91 | .Xc | |
e0d7ce0e | 92 | Close the currently open device. The |
b42074ab | 93 | .Ar device |
e0d7ce0e | 94 | specified is ignored. |
b42074ab CL |
95 | .It Xo Sy L |
96 | .Ar whence No \en | |
97 | .Ar offset No \en | |
98 | .Xc | |
99 | .Sm on | |
e0d7ce0e | 100 | Perform an |
b42074ab | 101 | .Xr lseek 2 |
e0d7ce0e KM |
102 | operation using the specified parameters. |
103 | The response value is that returned from the | |
b42074ab | 104 | .Xr lseek |
e0d7ce0e | 105 | call. |
b42074ab CL |
106 | .Sm off |
107 | .It Sy W Ar count No \en | |
108 | .Sm on | |
e0d7ce0e | 109 | Write data onto the open device. |
b42074ab | 110 | .Nm Rmt |
e0d7ce0e | 111 | reads |
b42074ab | 112 | .Ar count |
e0d7ce0e KM |
113 | bytes from the connection, aborting if |
114 | a premature end-of-file is encountered. | |
115 | The response value is that returned from | |
116 | the | |
b42074ab | 117 | .Xr write 2 |
e0d7ce0e | 118 | call. |
b42074ab CL |
119 | .Sm off |
120 | .It Sy R Ar count No \en | |
121 | .Sm on | |
e0d7ce0e | 122 | Read |
b42074ab | 123 | .Ar count |
e0d7ce0e KM |
124 | bytes of data from the open device. |
125 | If | |
b42074ab | 126 | .Ar count |
e0d7ce0e KM |
127 | exceeds the size of the data buffer (10 kilobytes), it is |
128 | truncated to the data buffer size. | |
b42074ab | 129 | .Nm rmt |
e0d7ce0e | 130 | then performs the requested |
b42074ab | 131 | .Xr read 2 |
e0d7ce0e | 132 | and responds with |
b42074ab CL |
133 | .Sm off |
134 | .Sy A Ar count-read No \en | |
135 | .Sm on | |
b4b1244b | 136 | if the read was |
e0d7ce0e KM |
137 | successful; otherwise an error in the |
138 | standard format is returned. If the read | |
139 | was successful, the data read is then sent. | |
b42074ab CL |
140 | .Sm off |
141 | .It Xo Sy I Ar operation | |
142 | .No \en Ar count No \en | |
143 | .Xc | |
144 | .Sm on | |
145 | Perform a | |
146 | .Dv MTIOCOP | |
147 | .Xr ioctl 2 | |
e0d7ce0e KM |
148 | command using the specified parameters. |
149 | The parameters are interpreted as the | |
b42074ab CL |
150 | .Tn ASCII |
151 | representations of the decimal values | |
e0d7ce0e | 152 | to place in the |
b42074ab | 153 | .Ar mt_op |
e0d7ce0e | 154 | and |
b42074ab | 155 | .Ar mt_count |
e0d7ce0e | 156 | fields of the structure used in the |
b42074ab | 157 | .Xr ioctl |
e0d7ce0e | 158 | call. The return value is the |
b42074ab | 159 | .Ar count |
e0d7ce0e | 160 | parameter when the operation is successful. |
b42074ab | 161 | .It Sy S |
e0d7ce0e | 162 | Return the status of the open device, as |
b42074ab CL |
163 | obtained with a |
164 | .Dv MTIOCGET | |
165 | .Xr ioctl | |
e0d7ce0e KM |
166 | call. If the operation was successful, |
167 | an ``ack'' is sent with the size of the | |
168 | status buffer, then the status buffer is | |
169 | sent (in binary). | |
b42074ab CL |
170 | .El |
171 | .Sm on | |
172 | .Pp | |
e0d7ce0e | 173 | Any other command causes |
b42074ab | 174 | .Nm rmt |
e0d7ce0e | 175 | to exit. |
b42074ab | 176 | .Sh DIAGNOSTICS |
e0d7ce0e | 177 | All responses are of the form described above. |
b42074ab CL |
178 | .Sh SEE ALSO |
179 | .Xr rcmd 3 , | |
180 | .Xr rexec 3 , | |
181 | .Xr mtio 4 , | |
182 | .Xr rdump 8 , | |
183 | .Xr rrestore 8 | |
184 | .Sh BUGS | |
e0d7ce0e KM |
185 | People tempted to use this for a remote file access protocol |
186 | are discouraged. | |
b42074ab CL |
187 | .Sh HISTORY |
188 | The | |
189 | .Nm | |
190 | command appeared in | |
191 | .Bx 4.2 . |