X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/8afc7c2e75b5894da896bbf40936a6f236a5912c..653ba8b6da06e68f317c531463801dd809905224:/usr/src/usr.sbin/rmt/rmt.8 diff --git a/usr/src/usr.sbin/rmt/rmt.8 b/usr/src/usr.sbin/rmt/rmt.8 index c7e11182b6..ec5059ab8a 100644 --- a/usr/src/usr.sbin/rmt/rmt.8 +++ b/usr/src/usr.sbin/rmt/rmt.8 @@ -1,151 +1,191 @@ -.\" Copyright (c) 1983 The Regents of the University of California. -.\" All rights reserved. +.\" Copyright (c) 1983, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. .\" .\" %sccs.include.redist.man% .\" -.\" @(#)rmt.8 6.4 (Berkeley) %G% +.\" @(#)rmt.8 8.2 (Berkeley) %G% .\" -.TH RMT 8 "" -.UC 5 -.SH NAME -rmt \- remote magtape protocol module -.SH SYNOPSIS -.B /etc/rmt -.SH DESCRIPTION -.I Rmt +.Dd +.Dt RMT 8 +.Os BSD 4.2 +.Sh NAME +.Nm rmt +.Nd remote magtape protocol module +.Sh SYNOPSIS +.Nm rmt +.Sh DESCRIPTION +.Nm Rmt is a program used by the remote dump and restore programs in manipulating a magnetic tape drive through an interprocess communication connection. -.I Rmt +.Nm Rmt is normally started up with an -.IR rexec (3X) +.Xr rexec 3 or -.IR rcmd (3X) +.Xr rcmd 3 call. -.PP +.Pp The -.I rmt +.Nm rmt program accepts requests specific to the manipulation of magnetic tapes, performs the commands, then responds with -a status indication. All responses are in ASCII and in +a status indication. All responses are in +.Tn ASCII +and in one of two forms. -Successful commands have responses of -.IP -.BI A number \en -.PP -where -.I number -is an ASCII representation of a decimal number. -Unsuccessful commands are responded to with -.PP -.IP -.BI E error-number \en error-message \en -.PP -where -.I error-number +Successful commands have responses of: +.Bd -filled -offset indent +.Sm off +.Sy A Ar number No \en +.Sm on +.Ed +.Pp +.Ar Number +is an +.Tn ASCII +representation of a decimal number. +Unsuccessful commands are responded to with: +.Bd -filled -offset indent +.Sm off +.Xo Sy E Ar error-number +.No \en Ar error-message +.No \en +.Xc +.Sm on +.Ed +.Pp +.Ar Error-number is one of the possible error numbers described in -.IR intro (2) +.Xr intro 2 and -.I error-message +.Ar error-message is the corresponding error string as printed from a call to -.IR perror (3). +.Xr perror 3 . The protocol is comprised of the following commands, which are sent as indicated - no spaces are supplied between the command and its arguments, or between its arguments, and -.B \en +.Ql \en indicates that a newline should be supplied: -.TP 15 -.BI O device \en mode \en +.Bl -tag -width Ds +.Sm off +.It Xo Sy \&O Ar device +.No \en Ar mode No \en +.Xc Open the specified -.I device +.Ar device using the indicated -.IR mode . -.I Device +.Ar mode . +.Ar Device is a full pathname and -.I mode -is an ASCII representation of a decimal +.Ar mode +is an +.Tn ASCII +representation of a decimal number suitable for passing to -.IR open (2). +.Xr open 2 . If a device had already been opened, it is closed before a new open is performed. -.TP 15 -.BI C device \en +.It Xo Sy C Ar device No \en +.Xc Close the currently open device. The -.I device +.Ar device specified is ignored. -.TP 15 -.BI L whence \en offset \en +.It Xo Sy L +.Ar whence No \en +.Ar offset No \en +.Xc +.Sm on Perform an -.IR lseek (2) +.Xr lseek 2 operation using the specified parameters. The response value is that returned from the -.I lseek +.Xr lseek call. -.TP 15 -.BI W count \en +.Sm off +.It Sy W Ar count No \en +.Sm on Write data onto the open device. -.I Rmt +.Nm Rmt reads -.I count +.Ar count bytes from the connection, aborting if a premature end-of-file is encountered. The response value is that returned from the -.IR write (2) +.Xr write 2 call. -.TP 15 -.BI R count \en +.Sm off +.It Sy R Ar count No \en +.Sm on Read -.I count +.Ar count bytes of data from the open device. If -.I count +.Ar count exceeds the size of the data buffer (10 kilobytes), it is truncated to the data buffer size. -.I Rmt +.Nm rmt then performs the requested -.IR read (2) +.Xr read 2 and responds with -.BI A count-read \en +.Sm off +.Sy A Ar count-read No \en +.Sm on if the read was successful; otherwise an error in the standard format is returned. If the read was successful, the data read is then sent. -.TP 15 -.BI I operation \en count \en -Perform a MTIOCOP -.IR ioctl (2) +.Sm off +.It Xo Sy I Ar operation +.No \en Ar count No \en +.Xc +.Sm on +Perform a +.Dv MTIOCOP +.Xr ioctl 2 command using the specified parameters. The parameters are interpreted as the -ASCII representations of the decimal values +.Tn ASCII +representations of the decimal values to place in the -.I mt_op +.Ar mt_op and -.I mt_count +.Ar mt_count fields of the structure used in the -.I ioctl +.Xr ioctl call. The return value is the -.I count +.Ar count parameter when the operation is successful. -.TP 15 -.B S +.It Sy S Return the status of the open device, as -obtained with a MTIOCGET -.I ioctl +obtained with a +.Dv MTIOCGET +.Xr ioctl call. If the operation was successful, an ``ack'' is sent with the size of the status buffer, then the status buffer is sent (in binary). -.PP +.El +.Sm on +.Pp Any other command causes -.I rmt +.Nm rmt to exit. -.SH DIAGNOSTICS +.Sh DIAGNOSTICS All responses are of the form described above. -.SH "SEE ALSO" -rcmd(3), rexec(3), mtio(4), rdump(8), rrestore(8) -.SH BUGS -People tempted to use this for a remote file access protocol -are discouraged. +.Sh SEE ALSO +.Xr rcmd 3 , +.Xr rexec 3 , +.Xr mtio 4 , +.Xr rdump 8 , +.Xr rrestore 8 +.Sh BUGS +People should be discouraged from using this for a remote +file access protocol. +.Sh HISTORY +The +.Nm +command appeared in +.Bx 4.2 .