1 .\" $NetBSD: rmtops.3,v 1.14 2010/03/22 22:00:37 joerg Exp $
8 .Nd access tape drives on remote machines
10 Remote Magnetic Tape Library (librmt, -lrmt)
17 .Fn rmtaccess "char *file" "int mode"
21 .Fn rmtcreat "char *file" "int mode"
25 .Fn rmtfcntl "int fd" "int cmd" "int arg"
27 .Fn rmtfstat "int fd" "struct stat *buf"
29 .Fn rmtioctl "int fd" "int request" "char *argp"
31 .Fn rmtisatty "int fd"
33 .Fn rmtlseek "int fd" "long offset" "int whence"
35 .Fn rmtlstat "char *file" "struct stat *buf"
37 .Fn rmtopen "char *file" "int flags" "int mode"
39 .Fn rmtread "int fd" "char *buf" "int nbytes"
41 .Fn rmtstat "char *file" "struct stat *buf"
43 .Fn rmtwrite "int fd" "char *buf" "int nbytes"
47 library provides a simple means of transparently accessing tape drives
48 on remote machines via
52 These routines are used like their corresponding system calls, but
53 allow the user to open up a tape drive on a remote system on which he
54 or she has an account and the appropriate remote permissions.
56 A remote tape drive file name has the form
57 .Dl [user@]hostname:/dev/???
62 is the particular drive on the remote system (raw, blocked, rewinding,
63 non-rewinding, etc.), and the optional
65 is the login name to be used on the remote system, if different from
66 the current user's login name.
68 .\" The library source code may be optionally compiled to recognize the
73 .\" hostname[.user]:/dev/???
75 .\" By default, only the first form (introduced in
79 For transparency, the user should include the file
81 which has the following defines in it:
83 #define access rmtaccess
84 #define close rmtclose
85 #define creat rmtcreat
87 #define fcntl rmtfcntl
88 #define fstat rmtfstat
89 #define ioctl rmtioctl
90 #define isatty rmtisatty
91 #define lseek rmtlseek
92 #define lstat rmtlstat
96 #define write rmtwrite
99 This allows the programmer to use
104 etc. in their normal fashion, with the
106 routines taking care of differentiating between local and remote files.
107 This file should be included
110 .Pa \*[Lt]sys/stat.h\*[Gt] ,
111 since it redefines the identifier ``stat'' which is used to declare
115 The routines differentiate between local and remote file descriptors
116 by adding a bias (currently 128) to the file descriptor of the pipe.
117 The programmer, if he or she must know if a file is remote, should use
120 The RCMD_CMD environment variable can be set to the name or pathname
121 of a program to use, instead of
123 and must have the same calling conventions as
126 .Bl -tag -width /usr/lib/librmt.a -compact
127 .It Pa /usr/lib/librmt.a
131 Several of these routines will return \-1 and set
133 to EOPNOTSUPP, if they are given a remote file name or a file descriptor
134 on an open remote file (e.g.,
141 And the appropriate system calls in section 2.
142 .\" .Sh CONFIGURATION OPTIONS
143 .\" The library may be compiled to allow the use of
145 .\" remote file names. This is not recommended.
147 .\" By default, the library opens two pipes to
149 .\" It may optionally be compiled to use
151 .\" instead. Doing so requires the use of a
153 .\" file in the user's home directory, or that the application designer be
156 .\" prompt the user for a login name and password on the remote host.
158 Jeff Lee wrote the original routines for accessing tape drives via
161 Fred Fish redid them into a general purpose library.
163 Arnold Robbins added the ability to specify a user name on the remote
165 .Pa \*[Lt]rmt.h\*[Gt]
166 include file, this man page, cleaned up the library a little, and made
167 the appropriate changes for
170 Dan Kegel contributed the code to use the
174 There is no way to use remote tape drives with
176 short of recompiling it entirely to use these routines.
180 protocol is not very capable.
181 In particular, it relies on TCP/IP sockets for error
182 free transmission, and does no data validation of its own.