shrink(4)
NAME
shrink − shrink file format for sparse files
SYNTAX
#include <shrink.h>
DESCRIPTION
The shrink format is used by shrink(1) and unshrink(1) to describe a sparse file. The first block of the file contains an information block. This information block is defined by the following structures:
struct chunk {
longchunk_offset;/∗ starting offset ∗/
longchunk_length;/∗ length of chunk ∗/
};
struct info_block {
shortinfo_magic;/∗ magic number ∗/
shortinfo_version;/∗ file format version ∗/
long info_blksize;/∗ granularity ∗/
struct chunk info_chunk [_CHUNK_COUNT];/∗ chunks ∗/
};
Each chunk is a sequence of contiguous data between “holes.” Chunk_offset is the offset in bytes of the chunk in the sparse file, and can be used directly with lseek(2) and fseek(3S). Chunk_length is the length of the chunk in bytes. _CHUNK_COUNT is defined in terms of the constant MAXBSIZE (defined in <sys/param.h>) such that the size of struct info_block is exactly MAXBSIZE.
Info_magic is the magic number for the shrink format. Info_version is the version number of this format; it is provided for maintainability, should there be a need to change the format in the future. Info_blksize is the granularity of the file; it specifies the size of a block in bytes. Throughout the file, each chunk begins on a multiple of info_blksize. With the possible exception of the last chunk, the length of each chunk is a multiple of info_blksize.
SEE ALSO
CX/UX Programmer’s Reference Manual