17 #define stralloc strdup
20 * Tape drive status structure. This abstracts the things we are
21 * interested in from the free-for-all of what the various drivers
26 char online_valid; /* is the online flag valid? */
27 char bot_valid; /* is the BOT flag valid? */
28 char eot_valid; /* is the EOT flag valid? */
29 char protected_valid; /* is the protected flag valid? */
30 char flags_valid; /* is the flags field valid? */
31 char fileno_valid; /* is the fileno field valid? */
32 char blkno_valid; /* is the blkno field valid? */
33 char device_status_valid; /* is the device status field valid? */
34 char error_status_valid; /* is the device status field valid? */
36 char online; /* true if device is online/ready */
37 char bot; /* true if tape is at the beginning */
38 char eot; /* true if tape is at end of medium */
39 char protected; /* true if tape is write protected */
40 long flags; /* device flags, whatever that is */
41 off_t fileno; /* tape file number */
42 off_t blkno; /* block within file */
43 int device_status_size; /* size of orig device status field */
44 unsigned long device_status; /* "device status", whatever that is */
45 int error_status_size; /* size of orig error status field */
46 unsigned long error_status; /* "error status", whatever that is */
50 int rait_open(char *dev, int flags, mode_t mask);
51 int rait_access(char *, int);
52 int rait_stat(char *, struct stat *);
54 off_t rait_lseek(int, off_t, int);
55 ssize_t rait_write(int, const void *, size_t);
56 ssize_t rait_read(int, void *, size_t);
57 int rait_ioctl(int, int, void *);
58 int rait_copy(char *f1, char *f2, size_t buflen);
59 char *rait_init_namelist(char * dev, char **dev_left, char **dev_right, char **dev_next);
60 int rait_next_name(char * dev_left, char * dev_right, char **dev_next, char * dev_real);
61 int rait_tape_open(char *, int, mode_t);
62 int rait_tapefd_fsf(int rait_tapefd, off_t count);
63 int rait_tapefd_rewind(int rait_tapefd);
64 void rait_tapefd_resetofs(int rait_tapefd);
65 int rait_tapefd_unload(int rait_tapefd);
66 int rait_tapefd_status(int rait_tapefd, struct am_mt_status *stat);
67 int rait_tapefd_weof(int rait_tapefd, off_t count);
68 int rait_tapefd_can_fork(int);
72 /* handle ugly Solaris stat mess */
74 #ifdef _FILE_OFFSET_BITS
78 #if _FILE_OFFSET_BITS == 64
81 long st_pad1[3]; /* reserved for network id */
95 char st_fstype[_ST_FSTYPSZ];
96 long st_pad4[8]; /* expansion area */
102 #define access(p,f) rait_access(p,f)
103 #define stat(a,b) rait_stat(a,b)
104 #define open rait_open
105 #define close(a) rait_close(a)
106 #define read(f,b,l) rait_read(f,b,l)
107 #define write(f,b,l) rait_write(f,b,l)
108 #define ioctl(f,n,x) rait_ioctl(f,n,x)