Open System Services System Calls Reference Manual (G06.25+, H06.03+)

tar(4) OSS System Calls Reference Manual
Symbolic constants used in the header block are dened in the header le /usr/include/tar.h
.
The denitions are as follows:
#define TMAGIC "ustar" /* ustar and a null */
#define TMAGLEN 6
#define TVERSION "00" /* 00 and no null */
#define TVERSLEN 2
/* Values used in typeflag field */
#define REGTYPE ’0’ /* regular file */
#define AREGTYPE ’ ’ /* regular file */
#define LNKTYPE ’1’ /* line */
#define SYMTYPE ’2’ /* reserved */
#define CHRTYPE ’3’ /* character special */
#define BLKTYPE ’4’ /* block special */
#define DIRTYPE ’5’ /* directory */
#define FIFOTYPE ’6’ /* FIFO special */
#define CONTTYPE ’7’ /* reserved */
/* Bits used in the mode field - values in octal */
#define TSUID 04000 /* set UID on execution */
#define TSGID 02000 /* set GID on execution */
#define TSVTX 01000 /* reserved */
#define TUREAD 00400 /* read by owner */
#define TUWRITE 00200 /* write by owner */
#define TUEXEC 00100 /* execute/search by owner */
#define TGREAD 00040 /* read by group */
#define TGWRITE 00020 /* write by group */
#define TGEXEC 00010 /* execute/search by group */
#define TOREAD 00004 /* read by other */
#define TOWRITE 00002 /* write by other */
#define TOEXEC 00001 /* execute/search by other */
The elds in the header block must be contiguous; that is, no padding is used. Each character in
the archive le is stored contiguously.
The elds magic, uname, and gname are null-terminated character strings.
The elds name, linkname, and prex are null-terminated character strings except when all the
characters in the eld are nonnull characters, including the last character.
The version eld is two bytes containing the characters "00" (ASCII zero-zero).
The typeag eld contains a single character.
All other elds are leading zero-lled octal numbers in ASCII. Each numeric eld is terminated
by one or more space or null characters.
The name and prex elds produce the pathname of the le. The hierarchical relationship of the
le is retained by specifying the pathname as a path prex, a slash character, and the lename as
the sufx. If prex contains nonnull characters, then the value of prex, a slash character, and
the value of name are concatenated without modication or addition of new characters to pro-
duce a new pathname. In this manner, pathnames of at most 256 characters can be supported. If
a pathname does not t in the space provided, the tar command noties the user of the error and
no attempt is made to store any part of the le, header, or data in the archive.
The linkname eld does not use prex to produce a pathname. As such, linkname is limited to
99 characters. If the name does not t in the space provided, the tar command noties the user
1136 Hewlett-Packard Company 527186-003