6253 F_GETLK doesn't always return lock owner
[illumos-gate.git] / usr / src / man / man1m / rmt.1m
blob82f8614b7765d9e6cc66d523e99b0d431866a61b
1 '\" te
2 .\"  Copyright (c) 1983 Regents of the University
3 .\" of California.  All rights reserved.  The Berkeley software License Agreement
4 .\"  specifies the terms and conditions for redistribution.  Copyright (c) 1995
5 .\" Sun Microsystems, Inc.  All Rights Reserved.
6 .\" from UCB 4.3
7 .TH RMT 1M "Nov 6, 2000"
8 .SH NAME
9 rmt \- remote magtape protocol module
10 .SH SYNOPSIS
11 .LP
12 .nf
13 \fB/usr/sbin/rmt\fR
14 .fi
16 .SH DESCRIPTION
17 .sp
18 .LP
19 \fBrmt\fR is a program used by the remote dump and restore programs in
20 manipulating a magnetic tape drive through an interprocess communication
21 connection. \fBrmt\fR is normally started up with an \fBrexec\fR(3SOCKET) or
22 \fBrcmd\fR(3SOCKET) call.
23 .sp
24 .LP
25 The \fBrmt\fR program accepts requests that are specific to the manipulation of
26 magnetic tapes, performs the commands, then responds with a status indication.
27 All responses are in \fBASCII\fR and in one of two forms. Successful commands
28 have responses of:
29 .sp
30 .in +2
31 .nf
33 .fi
34 .in -2
35 .sp
37 .sp
38 .ne 2
39 .na
40 \fB\fBA\fR\fInumber\fR\fB\en\fR\fR
41 .ad
42 .RS 14n
43 where \fInumber\fR is an \fBASCII\fR representation of a decimal number.
44 .RE
46 .sp
47 .LP
48 Unsuccessful commands are responded to with:
49 .sp
50 .ne 2
51 .na
52 \fB\fBE\fR\fIerror-number\fR\fB\en\fR\fIerror-message\fR\fB\en\fR\fR
53 .ad
54 .sp .6
55 .RS 4n
56 where \fIerror-number\fR is one of the possible error numbers described in
57 \fBintro\fR(3), and \fIerror-message\fR is the corresponding error string as
58 printed from a call to \fBperror\fR(3C).
59 .RE
61 .sp
62 .LP
63  The protocol consists of the following commands:
64 .sp
65 .ne 2
66 .na
67 \fB\fBS\en\fR\fR
68 .ad
69 .RS 25n
70 Return the status of the open device, as obtained with a \fBMTIOCGET\fR
71 \fBioctl\fR call.  If the operation was successful, an "ack" is sent with the
72 size of the status buffer, then the status buffer is sent (in binary).
73 .RE
75 .sp
76 .ne 2
77 .na
78 \fB\fBC\fR\fIdevice\fR\fB\en\fR\fR
79 .ad
80 .RS 25n
81 Close the currently open device. The \fIdevice\fR specified is ignored.
82 .RE
84 .sp
85 .ne 2
86 .na
87 \fB\fBI\fR\fIoperation\fR\fB\en\fR\fIcount\fR\fB\en\fR\fR
88 .ad
89 .RS 25n
90 Perform a \fBMTIOCOP\fR \fBioctl\fR(2) command using the specified parameters.
91 The parameters are interpreted as the \fBASCII\fR representations of the
92 decimal values to place in the \fImt_op\fR and \fImt_count\fR fields of the
93 structure used in the \fBioctl\fR call.   When the operation is successful the
94 return value is the \fIcount\fR parameter.
95 .RE
97 .sp
98 .ne 2
99 .na
100 \fB\fBL\fR\fIoffset\fR\fB\en\fR\fBwhence\fR\fB\en\fR\fR
102 .RS 25n
103 Perform an \fBlseek\fR(2) operation using the specified parameters. The
104 response value is returned from the \fBlseek\fR call.
108 .ne 2
110 \fB\fBO\fR\fIdevice\fR\fB\en\fR\fImode\fR\fB\en\fR\fR
112 .RS 25n
113 Open the specified \fIdevice\fR using the indicated \fImode\fR. \fIdevice\fR is
114 a full pathname, and \fImode\fR is an \fBASCII\fR representation of a decimal
115 number suitable for passing to \fBopen\fR(9E). If a device is already open, it
116 is closed before a new open is performed.
120 .ne 2
122 \fB\fBR\fR\fIcount\fR\fB\en\fR\fR
124 .RS 25n
125 Read \fIcount\fR bytes of data from the open device. \fBrmt\fR performs the
126 requested \fBread\fR(9E) and responds with \fBA\fR\fIcount-read\en\fR if the
127 read was successful; otherwise an error in  standard format is returned. If the
128 read was successful, the data read is sent.
132 .ne 2
134 \fB\fBW\fR\fIcount\fR\fB\en\fR\fR
136 .RS 25n
137 Write data onto the open device. \fBrmt\fR reads \fIcount\fR bytes from the
138 connection, aborting if a premature \fBEOF\fR is encountered. The response
139 value is returned from the \fBwrite\fR(9E) call.
144 Any other command causes \fBrmt\fR to exit.
145 .SH SEE ALSO
148 \fBufsdump\fR(1M), \fBufsrestore\fR(1M), \fBintro\fR(3), \fBioctl\fR(2),
149 \fBlseek\fR(2), \fBperror \fR(3C), \fBrcmd\fR(3SOCKET), \fBrexec\fR(3SOCKET),
150 \fBattributes\fR(5), \fBmtio\fR(7I), \fBopen\fR(9E), \fBread\fR(9E),
151 \fBwrite\fR(9E)
152 .SH DIAGNOSTICS
155 All responses are of the form described above.
156 .SH BUGS
159 Do not use this for a remote file access protocol.