1 /* NOTE: this driver is *deprecated* and should not be used. See the Device API
2 * in device-src/ for the new implementation.
21 #define stralloc strdup
24 * Tape drive status structure. This abstracts the things we are
25 * interested in from the free-for-all of what the various drivers
30 char online_valid; /* is the online flag valid? */
31 char bot_valid; /* is the BOT flag valid? */
32 char eot_valid; /* is the EOT flag valid? */
33 char protected_valid; /* is the protected flag valid? */
34 char flags_valid; /* is the flags field valid? */
35 char fileno_valid; /* is the fileno field valid? */
36 char blkno_valid; /* is the blkno field valid? */
37 char device_status_valid; /* is the device status field valid? */
38 char error_status_valid; /* is the device status field valid? */
40 char online; /* true if device is online/ready */
41 char bot; /* true if tape is at the beginning */
42 char eot; /* true if tape is at end of medium */
43 char protected; /* true if tape is write protected */
44 long flags; /* device flags, whatever that is */
45 off_t fileno; /* tape file number */
46 off_t blkno; /* block within file */
47 int device_status_size; /* size of orig device status field */
48 unsigned long device_status; /* "device status", whatever that is */
49 int error_status_size; /* size of orig error status field */
50 unsigned long error_status; /* "error status", whatever that is */
54 int rait_open(char *dev, int flags, mode_t mask);
55 int rait_access(char *, int);
56 int rait_stat(char *, struct stat *);
58 off_t rait_lseek(int, off_t, int);
59 ssize_t rait_write(int, const void *, size_t);
60 ssize_t rait_read(int, void *, size_t);
61 int rait_ioctl(int, int, void *);
62 int rait_copy(char *f1, char *f2, size_t buflen);
63 char *rait_init_namelist(char * dev, char **dev_left, char **dev_right, char **dev_next);
64 int rait_next_name(char * dev_left, char * dev_right, char **dev_next, char * dev_real);
65 int rait_tape_open(char *, int, mode_t);
66 int rait_tapefd_fsf(int rait_tapefd, off_t count);
67 int rait_tapefd_rewind(int rait_tapefd);
68 void rait_tapefd_resetofs(int rait_tapefd);
69 int rait_tapefd_unload(int rait_tapefd);
70 int rait_tapefd_status(int rait_tapefd, struct am_mt_status *stat);
71 int rait_tapefd_weof(int rait_tapefd, off_t count);
72 int rait_tapefd_can_fork(int);
76 /* handle ugly Solaris stat mess */
78 #ifdef _FILE_OFFSET_BITS
82 #if _FILE_OFFSET_BITS == 64
85 long st_pad1[3]; /* reserved for network id */
99 char st_fstype[_ST_FSTYPSZ];
100 long st_pad4[8]; /* expansion area */
106 #define access(p,f) rait_access(p,f)
107 #define stat(a,b) rait_stat(a,b)
108 #define open rait_open
109 #define close(a) rait_close(a)
110 #define read(f,b,l) rait_read(f,b,l)
111 #define write(f,b,l) rait_write(f,b,l)
112 #define ioctl(f,n,x) rait_ioctl(f,n,x)