home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
misc
/
volume22
/
ftape
/
part01
/
ftape.h
< prev
next >
Wrap
C/C++ Source or Header
|
1991-09-04
|
2KB
|
68 lines
#ident "@(#)2.4 ftape.h 91/09/03 FAST TAPE"
/*
* Original author: Kari Yli-Kuha, SQ Consulting Ltd.
* Address: Kanslerinkatu 8, 33720 Tampere, Finland
* Phone: (358) 31 165200
*
* IPC for FAST TAPE
*
* Defines SHBUF structure and defaults
*/
/*
* defaults, change these if you prefer eg. other cpio options.
* Note: "-v" is default, if can be turned off with "ftape -s" (silent) option.
*/
#define TAPE "/dev/tape" /* tape device */
/*
*
* Depending on the driver (and it's internal buffering) you're porting
* this program to you should select the SHBUFSIZE accordingly.
* eg in SCO Unix 3.2v2 (ODT 1.1) default CTBUFSIZE=64 so SHBUFSIZE should
* be the same to get optimum speed.
*
* In ISC 2.0.2 wt-driver had no buffering so I've chosen 16*20 as default.
* I don't know about ISC 2.2 or any SCSI drivers, you'll have to find out..
*
* NOTE! If the driver you're porting this to has it's own buffering you
* should check what the driver does when the the tape ran to end and the
* tape device is closed. If it flushes it's buffers (like SCO ct), well,
* bye bye multi volume backup... In that case you'll have to find
* something clever (or, if possible, disable the internal buffering)
*
*/
#define SHBUFS 16 /* number of shm buffers */
#define SHBUFSIZE 20 /* size of one buffer * 512 bytes */
#define CPIO_READOPTS "-icdum"
#define CPIO_WRITEOPTS "-ocB"
#define CPIO_LISTOPTS "-ict"
typedef struct SHBUF {
int nread; /* # of bytes in the buffer */
char buf[SHBUFSIZE*512];
};
/*
* normal semaphore handling:
* sem 0 for free buffers
* sem 1 for available buffers
*/
#define NSEMS 2
#define BUFFERS_FREE 0
#define BUFFERS_AVAIL 1
void semup(), semdown();
/* debug to check the errno's (SLOW!!) */
#define DEBUG if (debug) (void)
/*
* Processes that read/write the tape to/from shared memory.
* Used by fork_tape_handling()
*/
#define TAPEREAD "ftaperead"
#define TAPEWRITE "ftapewrite"
extern key_t ftok();