Subject GBAK Poser
Author Patrick J. P. Griffin
I have a GBAK poser to share.

When running GBAK directly to tape I have been experiencing a large number
of errors. I've replaced all of my old tapes (and they were really old!)
and the situation is much improved.

However, I'm still randomly getting errors.

The error I'm getting is #22, EINVAL, but lets put that aside for the
moment.

On my AIX system /usr/include/stdio.h has #define BUFSIZ 4096

And Interbase/burp/burp.h contains:

#ifdef BUFSIZ
#define IO_BUFFER_SIZE BUFSIZ
#else
#define IO_BUFFER_SIZE 1024
#endif
#endif

#define GBAK_IO_BUFFER_SIZE (16 * (IO_BUFFER_SIZE))

which then resolves GBAK_IO_BUFFER_SIZE to 64K.

Now, looking in Interbase/burp/mvol.c MVOL_write I see:

cnt = write (... , ptr, left)

where cnt and left are defined as int.

So, since the size to be written can be as high as 64K wouldn't that become
a negative number when stored in 'cnt' or 'left'?

And if 'cnt' can be negative wouldn't that cause the error handling routines
to incorrectly process partial writes since the very first test is for
'cnt>0'.

Any thoughts?

...pat
p.s. I love calling this program 'burp'.